branch_name
stringclasses 149
values | text
stringlengths 23
89.3M
| directory_id
stringlengths 40
40
| languages
listlengths 1
19
| num_files
int64 1
11.8k
| repo_language
stringclasses 38
values | repo_name
stringlengths 6
114
| revision_id
stringlengths 40
40
| snapshot_id
stringlengths 40
40
|
---|---|---|---|---|---|---|---|---|
refs/heads/master
|
<file_sep>#include<stdio.h>
#define pi 3.1416
float a,r;
main()
{
printf("Dame el valor del radio\n");
scanf("%f",&r);
while(r<-0)
{
printf("El valor debe ser positivo/n");
scanf("%f",&r);
}
a=pi*r*r;
printf("\nEl area es:%f",a);
}
<file_sep>#include<stdio.h>
int a,b,c;
main()
{
printf("Dame un valor\n");
scanf("%d",&a);
printf("dame otro valor\n");
scanf("%d",&b);
c=a+b;
printf("La sumatoria de los numeros es:%d\n",c);
}
<file_sep>#include<stdio.h>
float a=1,cont=0,p=0,num;
main()
{
while (a<4)
{
printf("Dame el valor%d",a);
scanf("%f",&num);
cont=cont+num;
a++;
}
p=cont/3;
printf("\nEl promedio de los tres numeros es:%f",p);
}
|
b12d32ab8a0dcb00656af77cd0c97177af8df91d
|
[
"C++"
] | 3 |
C++
|
KatherineReyesAlonso/practica7_fdp
|
a97f1f2feb68b372fb5b07f7932c6778d56fdcf0
|
5d761200d9b1b377582bc93dac1d90b521ad28f7
|
refs/heads/master
|
<file_sep>class Embassy < ActiveRecord::Base
def self.find_all_embassies(lat, lng)
query = "SELECT name, ST_AsGeoJSON(ST_Centroid(way)) AS way, tags->'country' AS country,
ST_Distance((ST_SetSRID(ST_Point(#{lng}, #{lat}), 4326)::geography), ST_SetSRID(way, 4326)::geography) as distance
FROM planet_osm_polygon
WHERE building IS NOT NULL
AND amenity='embassy'
AND tags ? 'country'"
result = ActiveRecord::Base.connection.execute(query)
geojson = process_result(result)
end
def self.find_embassy(lat, lng, code)
query = "SELECT name, ST_AsGeoJSON(ST_Centroid(way)) AS way, tags->'country' AS country,
ST_Distance((ST_SetSRID(ST_Point(#{lng}, #{lat}), 4326)::geography), ST_SetSRID(way, 4326)::geography) as distance
FROM planet_osm_polygon
WHERE building IS NOT NULL
AND amenity='embassy'
AND tags->'country'='#{code}'"
result = ActiveRecord::Base.connection.execute(query)
geojson = process_result(result)
end
def self.find_embassies_in_radius(lat, lng, radius)
query = "SELECT name, ST_AsGeoJSON(ST_Centroid(way)) AS way, tags->'country' AS country,
ST_Distance((ST_SetSRID(ST_Point(#{lng}, #{lat}), 4326)::geography), ST_SetSRID(way, 4326)::geography) as distance
FROM planet_osm_polygon
WHERE building IS NOT NULL
AND amenity='embassy'
AND tags ? 'country'
AND ST_DWithIn((ST_SetSRID(ST_Point(#{lng}, #{lat}), 4326)::geography), ST_SetSRID(way, 4326)::geography, #{radius})"
result = ActiveRecord::Base.connection.execute(query)
geojson = process_result(result)
end
def self.process_result(result)
geojson = []
result.each do |r|
geojson.push(
{
type: 'Feature',
geometry: JSON.parse(r['way']),
properties: {
title: r['name'],
country: r['country'],
distance: r['distance'],
icon: {
iconUrl: "assets/flags/#{r['country']}.png",
iconSize: [55, 36],
iconAnchor: [27, 18],
popupAnchor: [0, -55],
className: "flag"
}
}
}
)
end
geojson
end
end
<file_sep># Overview
Aplikácia zobrazuje ambasády v Bratislave. Najdôležitejšie možnosti:
- vyhľadať všetky ambasády
- vyhľadať konkrétnu ambasádu po výbere zo zoznamu
- vyhľadať ambasády v nastaviteľnom dosahu od polohy posúvateľného markera
- ambasády sú reprezentované vlajkou krajiny
- po kliknutí na vlajku výpis vzdialenosti od posúvateľného markera
Screenshot:

# Frontend
Frontend aplikácie je html stránka, ktorá zobrazuje mapu prostredníctvom mapbox.js a pomocou javascriptu vytvorené klikateľné menu. Mapa je zobrazená v mierne upravenom OSM Bright 2 štýle. Mapu som vytvoril v Mapbox Studiu, zaradil osm do nej všetky podstatné vrstvy. Jedným nedostatkom je zlé zobrazenie rieky Dunaj, keďže jeho časť nebola reprezentovaná polygónmi, ale čiarami.
Javascript v aplikácii sa stará o
- zobrazenie mapy
- vykonávanie funkcií inicializovaných klikateľnými elementmi
- pridávanie vrstiev do mapy
# Backend
Aplikácia je písaná v Ruby on Rails, ktoré sa stará o spracovávanie SQL dopytov a spracovanie dát získaných z databázy do formátu GeoJSON. V `app/models`, je model `app/models/hotel.rb`, ktorý sa stará o toto spracovávanie dopytov.
## Údaje
Údaje som exportoval z Open Street Maps, zahŕňajú celú Bratislavu, mali veľkosť cca 150 MB. Pomocou osm2pgsql som dáta pretransformoval do PostGIS databázy. Pri dopytovaní sa do databázy som využil viaceré PostGIS funcie (ST_AsGeoJSON, ST_Centroid, ST_Distance, ST_SetSRID, ST_Point, ST_DWithIn).
<file_sep>Rails.application.routes.draw do
get 'embassies/new'
get 'map/home' => 'map#home'
get 'embassies/find_all_embassies' => 'embassies#find_all_embassies'
get 'embassies/find_embassy' => 'embassies#find_embassy'
get 'embassies/find_embassies_in_radius' => 'embassies#find_embassies_in_radius'
root :to => 'map#home'
end
<file_sep>class EmbassiesController < ApplicationController
def new
end
def find_all_embassies
render json: Embassy.find_all_embassies(params[:lat], params[:lng])
end
def find_embassy
render json: Embassy.find_embassy(params[:lat], params[:lng], params[:code])
end
def find_embassies_in_radius
render json: Embassy.find_embassies_in_radius(params[:lat], params[:lng], params[:radius])
end
end
|
c79dad1230bfbee29a713901253853233190e6c9
|
[
"Markdown",
"Ruby"
] | 4 |
Ruby
|
fiit-pdt/assignment-gis-MartinBorak
|
aade91eb5fe2057ae0b235c549fea49ac418255d
|
0ff35f2655f3454401092625371f6600c5c272b8
|
refs/heads/master
|
<file_sep>package searchengine;
import java.util.Scanner;
/**
*
* @author Niro
*/
public class SearchEngine {
private static IndexTable indexTable = new IndexTable();
public static void generateIndexTable() {
String[] html = {
"<title>Java Course</title>\nIn this course we will learn the Java programming language",
"<title>Program Description</title>\nIn this program we learned Java and other programming languages"
};
Website[] websites = new Website[html.length];
// index table retrieves keywords and positions of each word from each
// page and adds that info as columns in the table
for (int i = 0; i < html.length; i++) {
// create a website object out of html text
websites[i] = new Website(i + 1, html[i]);
// add website objects to an index table
indexTable.addWebsite(websites[i]);
}
}
private static int[][] sortResultsByNearness(int[][] phraseSearchResults) {
int[][] sortedResults = phraseSearchResults.clone();
for (int i = 0; i < sortedResults.length - 1; i++) {
int minimumNearnessIndex = i;
int minimumNearness = sortedResults[minimumNearnessIndex][1];
for (int j = i; j < sortedResults.length; j++) {
if (sortedResults[j][1] < minimumNearness) {
minimumNearness = sortedResults[j][1];
minimumNearnessIndex = j;
}
}
// swap nearest to the front
int[] t = sortedResults[i].clone();
sortedResults[i] = sortedResults[minimumNearnessIndex].clone();
sortedResults[minimumNearnessIndex] = t.clone();
}
return sortedResults;
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// create a searchable table
generateIndexTable();
// prompt user for keywordSearch keyword
System.out.print("Search: ");
String userInput = sc.nextLine();
int[][] phraseSearchResult = indexTable.phraseSearch(userInput);
int[][] sortedResults = sortResultsByNearness(phraseSearchResult);
for (int i = 0; i < sortedResults.length; i++) {
System.out.format("Page %d%n", sortedResults[i][0]);
}
}
}
<file_sep>package searchengine;
/**
*
* @author Niro
*/
public class Website {
private int id;
private String content;
Website(int id, String content) {
this.id = id;
this.content = content;
}
public String[] getKeywords() {
return this.content.split(" ");
}
public int getId() {
return id;
}
}
|
1c422f1e44cc5e1435f33c0337007ec716da3a29
|
[
"Java"
] | 2 |
Java
|
NiroSugir/SearchEngine
|
d18c78931b72c218440ae5ad9051e41db07d767d
|
7c0ae8123f4b095a88900a54f5097f646f49afa2
|
refs/heads/master
|
<repo_name>nacholibre/ncm2-symfony<file_sep>/README.md
# ncm2-symfony
Extended autocomplete for symfony based projects for [ncm2](https://github.com/ncm2/ncm2) for NeoVim.
Autocomplete support for:
* Route names
* Twig functions
* Twig filters
* Twig global variables
* Twig tests (for example `is defined`)
### Disclaimer
This is basic, proof of concept if you wish plugin. This is by no means fully
tested etc.
# Install
## VimPlug
```
Plug 'nacholibre/ncm2-symfony', {'do': 'composer install', 'tag': '*'}
```
and run `:PlugInstall`
`{'tag': '*'}` this means the latest tagged release
<file_sep>/command/AutocompleteCommand.php
<?php
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;
class AutocompleteCommand extends Command
{
protected static $defaultName = 'complete';
protected function configure()
{
$this->setDescription('This command is executed by the neovim script to get the autocomplete results');
$this->addOption(
'directory',
'd',
InputOption::VALUE_REQUIRED,
'Directory',
false
);
$this->addOption(
'position',
'p',
InputOption::VALUE_REQUIRED,
'Position',
false
);
$this->addOption(
'extension',
'e',
InputOption::VALUE_REQUIRED,
'Extension',
false
);
}
private function checkIsSymfonyProject($directory) {
$filesystem = new Filesystem();
if (!$filesystem->exists($directory.'/composer.json')) {
return false;
}
$composerData = json_decode(file_get_contents($directory.'/composer.json'), true);
if (isset($composerData['require']['symfony/framework-bundle'])) {
return true;
}
return false;
}
private function getTwigData($directory) {
$process = new Process(['php', $directory.'/bin/console', 'debug:twig', '--format=json']);
$process->run();
// executes after the command finishes
if (!$process->isSuccessful()) {
throw new ProcessFailedException($process);
}
$output = $process->getOutput();
return json_decode($output, true);
}
private function getRoutes($directory) {
$process = new Process(['php', $directory.'/bin/console', 'debug:router', '--format=json']);
$process->run();
// executes after the command finishes
if (!$process->isSuccessful()) {
throw new ProcessFailedException($process);
}
$output = $process->getOutput();
return json_decode($output, true);
}
protected function execute(InputInterface $input, OutputInterface $output)
{
// TODO check if projectc is symfony project
// check if composer file is located
$directory = $input->getOption('directory');
$extension = $input->getOption('extension');
$autocompleteResponse = [];
if (!$this->checkIsSymfonyProject($directory)) {
$output->writeln(json_encode([
'suggestions' => [],
]));
return 0;
}
if (!in_array($extension, ['php', 'twig'])) {
$output->writeln(json_encode([
'suggestions' => [],
]));
return 0;
}
$lines = '';
while( $line = fgets(STDIN) ) {
$lines .= $line;
}
if ($extension == 'php' or $extension == 'twig') {
$paths = $this->getRoutes($directory);
foreach($paths as $routeName => $data) {
$autocompleteResponse[] = [
'short_description' => 'Route ' . $data['defaults']['_controller'],
'name' => $routeName,
];
}
}
if ($extension == 'twig') {
$twigData = $this->getTwigData($directory);
foreach ($twigData['tests'] as $d) {
$autocompleteResponse[] = [
'short_description' => 'Twig test',
'name' => $d,
];
}
foreach ($twigData['globals'] as $k => $d) {
$autocompleteResponse[] = [
'short_description' => 'Twig global variable',
'name' => $k,
];
}
foreach ($twigData['filters'] as $k => $arguments) {
$description = '';
if ($arguments && count($arguments) > 0) {
$description = $k.'('.implode(', ', $arguments) . ')';
}
$description = 'TwigFilter ' . $description;
$autocompleteResponse[] = [
'short_description' => $description,
'name' => $k,
];
}
foreach ($twigData['functions'] as $k => $arguments) {
$description = '';
if ($arguments && count($arguments) > 0) {
$description = $k.'('.implode(', ', $arguments) . ')';
}
$description = 'TwigFunction ' . $description;
$autocompleteResponse[] = [
'short_description' => $description,
'name' => $k,
];
}
}
$jsonOutput = json_encode([
'suggestions' => $autocompleteResponse,
]);
$output->writeln($jsonOutput);
return 0;
}
}
<file_sep>/pythonx/ncm2_symfony.py
# -*- coding: utf-8 -*-
import vim
from ncm2 import Ncm2Source, getLogger, Popen
import re
from copy import deepcopy
import subprocess
import json
import os
logger = getLogger(__name__)
class Source(Ncm2Source):
def __init__(self, nvim):
super(Source, self).__init__(nvim)
self.completion_timeout = self.nvim.eval('g:ncm2_phpactor_timeout') or 5
def on_complete(self, ctx, extension, lines):
if not extension:
extension = '0'
matches = []
src = "\n".join(lines)
src = self.get_src(src, ctx)
lnum = ctx['lnum']
# use byte addressing
bcol = ctx['bcol']
src = src.encode()
pos = self.lccol2pos(lnum, bcol, src)
# get the php autocomplete bin path
dir_path = os.path.dirname(os.path.realpath(__file__))
autocomplete_bin_path = dir_path + '/../bin/app.php'
args = ['php', autocomplete_bin_path, 'complete', '-d', os.getcwd(), '-p', str(pos), '-e', extension]
#args = ['php', autocomplete_bin_path, '-d', os.getcwd(), str(pos)]
proc = Popen(args=args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL)
result, errs = proc.communicate(src, timeout=self.completion_timeout)
result = result.decode()
logger.debug("extension: %s", extension)
logger.debug("args: %s", args)
#logger.debug("result: [%s]", result)
#logger.debug(result)
result = json.loads(result)
if not result or not result.get('suggestions', None):
logger.debug('No matches found...abort')
return
matches = []
for e in result['suggestions']:
shortDescription = e['short_description']
word = e['name']
#t = e['type']
#item = {'word': word, 'menu': menu, 'info': menu}
item = dict(word=word, menu=shortDescription, info=shortDescription)
#snip_args = 'args'
#ph0 = '${%s:%s}' % ('num', 'txt')
#snippet = '%s(%s)%s' % (word, snip_args, ph0)
#item['user_data'] = {'snippet': snippet, 'is_snippet': 1}
matches.append(item)
self.complete(ctx, ctx['startccol'], matches)
source = Source(vim)
on_complete = source.on_complete
|
95cd2d83f2bc74a1be717d991f9d8b7b48bf4eab
|
[
"Markdown",
"Python",
"PHP"
] | 3 |
Markdown
|
nacholibre/ncm2-symfony
|
50770cfd93c328533fe11e089235db573dae90bb
|
f1df9ae1f5a19f4917a578f85d9304b233ae357a
|
refs/heads/master
|
<repo_name>ChenFangzheng/rxjs_practice<file_sep>/RXJS/src/index.ts
import Rx from 'rxjs/Rx';
import { Observable, Observer } from 'rx';
/**Creating Observables */
const observerable = Rx.Observable.create((observer: any) => {
const id = setInterval(() => {
observer.next('hi');
}, 1000);
return function unsubscribe() {
clearInterval(id);
}
})
/**Subscribing to obserables */
const subscription = observerable.subscribe((x: any) => console.log(x));
const subscription3 = observerable.subscribe((x: any) => console.log(`Second subscript ${x}`));
setTimeout(function () {
subscription.unsubscribe();
}, 3000);
/**Excuting Observerables */
const anotherObserverable = Rx.Observable.create(function subscribe(observer: any) {
try {
observer.next(1);
observer.next(2);
observer.complete();
} catch (err) {
observer.error(err);
}
})
/**Dispsing Obsevable */
const observerable2 = Rx.Observable.from([10, 20, 30]);
const subscription2 = observerable2.subscribe((x: number) => console.log(x));
subscription2.unsubscribe();
// const observable = Rx.Observable.create(function (observer: any) {
// observer.next(1);
// observer.next(2);
// observer.next(3);
// setTimeout(() => {
// observer.next(4);
// observer.complete();
// }, 1000);
// });
// console.log('just before subscribe');
// observable.subscribe({
// next: (x: number) => console.log(`Got value:${x}`),
// error: (error: any) => console.error('some error ocuured:' + error),
// complete: () => console.log('done')
// })
// const button = document.querySelector('button');
// Rx.Observable.fromEvent(button, 'click')
// .scan((count: number) => count + 1, 0)
// .subscribe(count => console.log(`Clicked ${count} times`));
// Rx.Observable.fromEvent(button, 'click')
// .throttleTime(1000)
// .scan((count: number) => count + 1, 0)
// .subscribe(count => console.log(`Clicked ${count} times`));
// Rx.Observable.fromEvent(button, 'click')
// .throttleTime(1000)
// .map((event: any) => event.clientX)
// .scan((count: number, clientX) => count + clientX, 0)
// .subscribe(count => console.log(`${count}`));<file_sep>/RXJS/src/creater2.ts
import Rx from 'rxjs/Rx';
import { Observable, Observer } from 'rxjs';
/**fromPromise */
// var result = Rx.Observable.fromPromise(fetch('http://myserver.com/'));
// result.subscribe(x => console.log(x), e => console.error(e));
/** fromEventPattern */
// function addClickHandler(handler: any) {
// document.addEventListener('click', handler);
// }
// function removeClickHandler(handler: any) {
// document.removeEventListener('click', handler);
// }
// const clicks = Rx.Observable.fromEventPattern(
// addClickHandler,
// removeClickHandler
// );
// clicks.subscribe(x => console.log(x));
/**fromEvent */
// const clicks = Rx.Observable.fromEvent(document, 'click');
// clicks.subscribe((x:any)=>console.log(x));
/**add more param to addEventLisener */
// const clicksInDocument = Rx.Observable.fromEvent(document, 'click', true);
// const div = document.querySelector('#test');
// const clicksInDiv = Rx.Observable.fromEvent(div, 'click');
// clicksInDocument.subscribe(() => console.log('document'));
// clicksInDiv.subscribe(() => console.log('div'));
/**Of */
// const array = [10, 20, 30];
// const result = Rx.Observable.from(array);
// result.subscribe(x => console.log(x));<file_sep>/RXJS/src/extends_operater.ts
import Rx from 'rxjs/Rx';
import { Observable, Subscription, Observer } from 'rxjs';
declare module "rxjs/Observable" {
interface Observable<T> {
multiplyByTen: () => Observable<T>;
}
}
Rx.Observable.prototype.multiplyByTen = function multiplyByTen() {
var input = this;
return Rx.Observable.create(function subscribe(observer: Observer<any>) {
input.subscribe({
next: (v: number) => observer.next(10 * v),
error: (err: any) => observer.error(err),
complete: () => observer.complete()
});
});
}
const observable = Rx.Observable.from([1, 2, 3, 4]).multiplyByTen();
observable.subscribe((x: any) => console.log(x));
// function multiplyByTen(input: Observable<any>) {
// const output = Rx.Observable.create(function subscribe(observer: Observer<any>) {
// input.subscribe({
// next: (v: number) => observer.next(10 * v),
// error: (error: any) => observer.error(error),
// complete: () => observer.complete()
// })
// });
// return output;
// }
// const input = Rx.Observable.from([1, 2, 3, 4]);
// const output = multiplyByTen(input);
// output.subscribe((x: number) => console.log(x));<file_sep>/RXJS/src/creater1.ts
import Rx from 'rxjs/Rx';
import { Observable, Observer } from 'rxjs';
/**Empty: do nothing except emit a complete */
// const result = Rx.Observable.empty().startWith(7);
// result.subscribe((x: number) => console.log(x), null, () => console.log('complete'));
const interval = Rx.Observable.interval(1000);
const result = interval.mergeMap((x: number) => {
console.log(x);
return x % 2 === 1 ? Rx.Observable.of('a', 'b', 'c') : Rx.Observable.empty()
});
result.subscribe(x => console.log(x));
/**defer */
// const clicksOrInterval = Rx.Observable.defer(function () {
// if (Math.random() > 0.5) {
// console.log('create a event Observable')
// return Rx.Observable.fromEvent(document, 'click');
// } else {
// console.log('create a interval Obserable');
// return Rx.Observable.interval(1000);
// }
// })
// clicksOrInterval.subscribe((x: any) => console.log(x));
/** Create */
// const observable = Rx.Observable.create(function (observer: Observer<any>) {
// observer.next(1);
// observer.next(2);
// observer.next(3);
// observer.complete();
// });
// observable.subscribe(
// (value: any) => console.log(value),
// (err: any) => { },
// () => console.log('this is then end')
// );
/**Return unsubscribe function */
// const observable1 = Rx.Observable.create((observer: Observer<any>) => {
// const id = setTimeout(() => observer.next('......'), 5000);
// return () => { clearTimeout(id); console.log('cleared!') };
// });
// const subscribe1 = observable1.subscribe((value: any) => console.log(value));
// subscribe1.unsubscribe();
<file_sep>/RXJS/src/subscription.ts
import Rx from 'rxjs/Rx';
const observable1 = Rx.Observable.interval(400);
const observable2 = Rx.Observable.interval(300);
const subscription = observable1.subscribe((x: number) => console.log('first: ' + x));
const childSubscription = observable2.subscribe(x => console.log('second: ' + x));
subscription.add(childSubscription);
// subscription.remove(childSubscription);
setTimeout(() => {
subscription.unsubscribe();
}, 2000);
// const observable = Rx.Observable.interval(1000);
// const subscription = observable.subscribe((x: number) => console.log(x));
// subscription.unsubscribe();<file_sep>/RXJS/src/bindcallback.ts
import Rx from 'rxjs/Rx';
/**BINDCALLBACK */
function add1(x: number, y: number, callback: Function): number {
callback(x, y);
return x + y;
}
const boundSomeFunction1 = Rx.Observable.bindCallback(add);
boundSomeFunction1(3, 5).subscribe((values: Array<number>) => console.log(values));
/**with selector */
function add(x: number, y: number, callback: Function): number {
callback(x, y);
return x + y;
}
const boundSomeFunction = Rx.Observable.bindCallback(add, (a: number, b: number) => a + b);
boundSomeFunction(3, 5).subscribe((value: number) => console.log(value));
function iCallMyCallbackSynchronously(cb: Function) {
cb();
}
const boundSyncFn = Rx.Observable.bindCallback(iCallMyCallbackSynchronously);
const boundAsyncFn = Rx.Observable.bindCallback(iCallMyCallbackSynchronously, null, Rx.Scheduler.async);
boundSyncFn().subscribe(() => console.log('I was sync!'));
boundAsyncFn().subscribe(() => console.log('I was async!'));
console.log('This happened...');<file_sep>/RXJS/src/operater.ts
import Rx from 'rxjs/Rx';
const source = Rx.Observable.timer(1000);
const exmaple = source.do(() => console.log('side effect'))
.mapTo('result');
const subscribe = exmaple.subscribe(val => console.log(val));
const subscribeTwo = exmaple.subscribe(val => console.log(val));
const sharedExample = exmaple.share();
const subscribeThree = sharedExample.subscribe(val => console.log(val));
const subscribeFour = sharedExample.subscribe(val => console.log(val));
/**
* zip
*/
// const age$ = Rx.Observable.of<number>(27, 25, 29);
// const name$ = Rx.Observable.of<string>('Foo', 'Bar', 'Beer');
// const isDev$ = Rx.Observable.of<boolean>(true, true, false);
// const interval$ = Rx.Observable.interval(1000).take(3);
// Rx.Observable.zip(age$, name$, isDev$, interval$, (age: number, name: string, isDev: boolean, interval: number) => ({ age, name, isDev, interval }))
// .subscribe(x => console.log(x));
/**
* Switch
* Converts a higher-order Observable into a first-order Observable
* by subscribing to only the most recently emitted of those inner Observables.
*/
// const clicks = Rx.Observable.fromEvent(document, 'click');
// const higherOrder = clicks.map((ev) => Rx.Observable.interval(1000));
// const switched = higherOrder.switch();
// switched.subscribe(x => console.log(x));<file_sep>/RXJS/src/craeter3.ts
import Rx from 'rxjs/Rx';
import { timer } from 'rxjs/observable/timer';
import { map, tap, retryWhen, delayWhen } from 'rxjs/operators';
/**throw */
const interval = Rx.Observable.interval(1000);
const result = interval.mergeMap((x: number) =>
x === 3 ?
Rx.Observable.throw('three is bad') :
Rx.Observable.of('a', 'b', 'c')
);
result.subscribe(x => console.log(x), e => console.error(e));
/**range */
// const numbers = Rx.Observable.range(1, 10);
// numbers.subscribe(x => console.log(x));
/**repeat */
// const soruce = Rx.Observable.of([1, 2, 3]);
// soruce.repeat(3)
// .mergeMap(val => val)
// .subscribe((val: number) => console.log(val));
/**Retry When */
//emit value every 1s
// const source = interval(1000);
// const example = source.pipe(
// map(val => {
// if (val > 5) {
// //error will be picked up by retryWhen
// throw val;
// }
// return val;
// }),
// retryWhen(errors =>
// errors.pipe(
// //log error message
// tap(val => console.log(`Value ${val} was too high!`)),
// //restart in 5 seconds
// delayWhen(val => timer(val * 1000))
// )
// )
// );
// const message = interval(1000);
// const delayForFiveSeconds = () => timer(5000);
// const delayWhenExample = message.pipe(delayWhen(delayForFiveSeconds));
// const subscribe = delayWhenExample.subscribe(val => console.log(val));
// const subscribe = example.subscribe(val => console.log(val));
/**interval */
// const numbers = Rx.Observable.of(10, 20, 30);
// const letters = Rx.Observable.of('a', 'b', 'c');
// const interval = Rx.Observable.interval(1000);
// const result = numbers.concat(letters).concat(interval);
// result.subscribe(x => console.log(x));<file_sep>/RXJS/src/operater1.ts
import Rx from 'rxjs/Rx';
/**switchMap */
// const one = Rx.Observable.of(1);
// const three = Rx.Observable.of(3).delay(2000);
// const five = Rx.Observable.of(5).delay(3000);
// const all = Rx.Observable.merge(one, three, five);
// const merged = all.switchMap((val: number) => Rx.Observable.interval(500).take(5));
// merged.subscribe(val => console.log(val));
/**pluck
* Like map, but meant only for picking one of the nested properties of every emitted object.
*/
// const clicks = Rx.Observable.fromEvent(document, 'click');
// const tagNames = clicks.pluck('target', 'tagName');
// tagNames.subscribe(x => console.log(x));
/**partition
* It's like filter, but returns two Observables: one like the output of filter, and the other with values that did not pass the condition.
*/
// const clicks = Rx.Observable.fromEvent(document, 'click');
// const parts = clicks.partition((ev: any) => ev.target.tagName === 'DIV');
// const clicksOnDivs = parts[0];
// const clicksElsewhere = parts[1];
// clicksOnDivs.subscribe(x => console.log('DIV clicked: ', x));
// clicksElsewhere.subscribe(x => console.log('Other clicked: ', x));
/**pairwise
* Puts the current value and previous value together as an array, and emits that.
*/
// const clicks$ = Rx.Observable.fromEvent(document, 'click');
// const pairs$ = clicks$.pairwise();
// const distance$ = pairs$.map((pair: any) => {
// const x0 = pair[0].clientX;
// const y0 = pair[0].clientY;
// const x1 = pair[1].clientX;
// const y1 = pair[1].clientY;
// return Math.sqrt(Math.pow(x0 - x1, 2) + Math.pow(y0 - y1, 2));
// })
// distance$.subscribe(x => console.log(x));
/**mergeScan
*
*/
// const click$ = Rx.Observable.fromEvent(document, 'click');
// const one$ = click$.mapTo(1);
// const seed = 0;
// const count$ = one$.mergeScan((acc, one) => Rx.Observable.of(acc + one), seed);
// count$.subscribe(x => console.log(x));
/**
* Scan
* It's like reduce, but emits the current accumulation whenever the source emits a value.
*/
// const clicks = Rx.Observable.fromEvent(document, 'click');
// const ones = clicks.mapTo(3);
// const seed = 0;
// const count = ones.scan((acc, one) => {
// console.log(`acc: ${acc} one: ${one}`);
// return acc + one;
// }, seed);
// count.subscribe((x: number) => console.log(x));
/**
* MergeMap
* Maps each value to an Observable, then flattens all of these inner Observables using mergeAll.
*/
// const one = Rx.Observable.of(1);
// const three = Rx.Observable.of(3).delay(2000);
// const five = Rx.Observable.of(5).delay(3000);
// const all = Rx.Observable.merge(one, three, five);
// const merged = all.mergeMap((val: number) => Rx.Observable.interval(500).take(5));
// merged.subscribe(val => console.log(val));
/**groupBy
*
*/
// Rx.Observable.of<Object>({ id: 1, name: 'aze1' },
// { id: 2, name: 'sf2' },
// { id: 2, name: 'dg2' },
// { id: 1, name: 'erg1' },
// { id: 1, name: 'df1' },
// { id: 2, name: 'sfqfb2' },
// { id: 3, name: 'qfs3' },
// { id: 2, name: 'qsgqsfg2' }
// )
// .groupBy((p: any) => p.id)
// .flatMap((group$) => group$.reduce((acc, cur) => [...acc, cur], []))
// .subscribe(p => console.log(p));
/**
* expand
*/
// const clicks = Rx.Observable.fromEvent(document, 'click');
// const powersOfTwo = clicks.mapTo(1)
// .expand(x => x === 8 ? Rx.Observable.empty() : Rx.Observable.of(2 * x).delay(1000));
// powersOfTwo.subscribe((x: number) => console.log(x));
/**exhaustMap
* Maps each value to an Observable, then flattens all of these inner Observables using exhaust.
*/
// const sourceInterval = Rx.Observable.interval(1000);
// const delayedInterval = sourceInterval.delay(10).take(4);
// const exhaustSub = Rx.Observable.merge(delayedInterval, Rx.Observable.of(true))
// .exhaustMap(() => sourceInterval.take(5))
// .subscribe(val => console.log(val));
/**contactMapTo
* It's like concatMap, but maps each value always to the same inner Observable.
*/
// const clicks = Rx.Observable.fromEvent(document, 'click');
// const result = clicks.concatMapTo(Rx.Observable.from([10, 1, 2]), (ev: any, input: any, outIndex: number, inIndex: number) => input);
// result.subscribe((x: any) => console.log(x));
/**contactMap
* Maps each value to an Observable, then flattens all of these inner Observables using concatAll.
*/
// const clicks = Rx.Observable.from([1, 3, 5]);
// const result = clicks.concatMap(ev => Rx.Observable.of(10, 10, 10).map(i => i * ev));
// result.subscribe((x: number) => console.log(x));<file_sep>/RXJS/src/operater2.ts
import Rx from 'rxjs/Rx';
/**
* windowWhen
*
* Close window at provided time frame emitting observable of collected values from source.
*/
const source = Rx.Observable.timer(0, 1000);
const example = source.windowWhen(() => Rx.Observable.interval(5000)).do(() => console.log('New Window'));
const subscribeTwo = example.mergeAll().subscribe(val => console.log(val));
/**
* windowToggle
* Collect and emit observable of values from source between opening and closing emission.
*/
// const source = Rx.Observable.timer(0, 1000);
// const toggle = Rx.Observable.interval(5000);
// const example = source.windowToggle(toggle, val => Rx.Observable.interval(1000 * val))
// .do(_ => console.log('NEW WINDOW'));
// const subscribeTwo = example.mergeAll().subscribe(val => console.log(val));
/**
* windowCount
* It's like bufferCount, but emits a nested Observable instead of an array.
*/
// const source = Rx.Observable.interval(1000);
// const example = source.windowCount(4).do(_ => console.log('NEW WINDOW'));
// const subscribeTwo = example.mergeAll().subscribe(val => console.log(val));
/**window
* It's like buffer, but emits a nested Observable instead of an array.
*/
// const source = Rx.Observable.timer(0, 1000);
// const example = source.window(Rx.Observable.interval(3000));
// const count = example.scan((acc, curr) => acc + 1, 0);
// const subscribe = count.subscribe(val => console.log(`window ${val}:`));
// const subscribeTwo = example.mergeAll()
// .subscribe(val => console.log(val));<file_sep>/RXJS/src/subject.ts
import Rx from 'rxjs/Rx';
import { Observable, Subscription } from 'rxjs';
/** AsyncSubject
* The AsyncSubject is a variant where only the last value of the Observable execution is sent to its observers,
* and only when the execution completes.
*/
var subject = new Rx.AsyncSubject();
subject.subscribe({
next: (v) => console.log('observerA: ' + v)
});
subject.next(1);
subject.next(2);
subject.next(3);
subject.next(4);
subject.subscribe({
next: (v) => console.log('observerB: ' + v)
});
subject.next(5);
subject.complete();
/**ReplaySubject
* A ReplaySubject records multiple values from the Observable execution and replays them to new subscribers
*/
// var subject = new Rx.ReplaySubject(100, 500 /* windowTime */);
// subject.subscribe({
// next: (v) => console.log('observerA: ' + v)
// });
// var i = 1;
// setInterval(() => subject.next(i++), 200);
// setTimeout(() => {
// subject.subscribe({
// next: (v) => console.log('observerB: ' + v)
// });
// }, 1000);
// const subject = new Rx.ReplaySubject(3);
// subject.subscribe({
// next: (v) => console.log('observerA: ' + v)
// });
// subject.next(1);
// subject.next(2);
// subject.next(3);
// subject.next(4);
// subject.subscribe({
// next: (v) => console.log('observerB: ' + v)
// });
// subject.next(5);
/**BehaviorSubject
* BehaviorSubjects are useful for representing "values over time".
* For instance, an event stream of birthdays is a Subject, but the stream of a person's age would be a BehaviorSubject.
* observerA: 0
* observerA: 1
* observerA: 2
* observerB: 2
* observerA: 3
* observerB: 3
*/
// const subject = new Rx.BehaviorSubject(0);
// subject.subscribe({
// next: (v) => console.log('observerA: ' + v)
// });
// subject.next(1);
// subject.next(2);
// subject.subscribe({
// next: (v) => console.log('obseverB: ' + v)
// });
// subject.next(3);
/**Reference counting
* automatically connect when the first Observer arrives,
* and automatically cancel the shared execution when the last Observer unsubscribes
*/
// const source = Rx.Observable.interval(500);
// const subject = new Rx.Subject();
// const refCounted = source.multicast(subject).refCount();
// let subscription1: Subscription,
// subscription2: Subscription;
// console.log('observer A subscribed');
// subscription1 = refCounted.subscribe({
// next: (v) => console.log('observerA: ' + v)
// });
// setTimeout(() => {
// console.log('observer B subscribed');
// subscription2 = refCounted.subscribe({
// next: (v) => console.log('observerB: ' + v)
// })
// }, 600);
// setTimeout(() => {
// console.log('observerA unsubscribed');
// subscription1.unsubscribe();
// }, 1200);
// setTimeout(() => {
// console.log('observerB unsubscribed');
// subscription2.unsubscribe();
// }, 2000);
/**Multicasted Observables
* A multicasted Observable uses a Subject under the hood to make multiple Observers see the same Observable execution.
*/
// const source = Rx.Observable.from([1, 2, 3, 4]);
// const subject = new Rx.Subject();
// const multicasted = source.multicast(subject);
// multicasted.subscribe({
// next: (v) => console.log('observerA: ' + v)
// });
// multicasted.subscribe({
// next: (v) => console.log('observerB: ' + v)
// });
// multicasted.connect();
/**Subject as a observer
* Since a Subject is an Observer,
* this also means you may provide a Subject as the argument to the subscribe of any Observable,
* like the example below shows:
*/
// const subject1 = new Rx.Subject();
// subject1.subscribe({
// next: (v: number) => console.log('observerA: ' + v)
// });
// subject1.subscribe({
// next: (v: number) => console.log('observerB: ' + v)
// });
// const observerable = Rx.Observable.from([1, 2, 3]);
// observerable.subscribe(subject1);
/**Subject as a observerable
* A Subject is like an Observable, but can multicast to many Observers.
* Subjects are like EventEmitters: they maintain a registry of many listeners.
*/
// const subject = new Rx.Subject();
// subject.subscribe({
// next: (v: number) => console.log('observerA: ' + v)
// });
// subject.subscribe({
// next: (v: number) => console.log('observerB: ' + v)
// });
// subject.next(1);
// subject.next(2);<file_sep>/RXJS/src/catchError.ts
import Rx from 'rxjs/Rx';
import { PromiseObservable } from 'rxjs/observable/PromiseObservable';
import { fromPromise } from 'rxjs/observable/fromPromise';
// const myBadPromise = () => new Promise((resolve: any, reject: any) => { reject('Rejected!') });
// const source = Rx.Observable.timer(1000);
// const example = source.mergeMap(() => Rx.Observable.fromPromise(myBadPromise())
// .catch(error => Rx.Observable.of(`bad promise: ${error}`)
// ));
// const subscribe = example.subscribe(val => console.log(val));
// Rx.Observable.of(1, 2, 3, 4, 5)
// .map(n => {
// if (n == 4) {
// throw 'four';
// }
// return n;
// })
// .catch(err => Rx.Observable.of('I', 'II', 'III', 'IV', 'V'))
// .subscribe(x => console.log(x));
// Rx.Observable.of(1, 2, 3, 4, 5)
// .map(n => {
// if (n === 4) {
// throw 'four';
// }
// return n;
// })
// .catch((err, caught) => caught)
// .take(10)
// .subscribe(x => console.log(x));
// Rx.Observable.of(1, 2, 3, 4, 5)
// .map(n => {
// if (n == 4) {
// throw 'four';
// }
// return n;
// })
// .catch(err => {
// throw 'error in source. details: ' + err;
// })
// .subscribe(
// x => console.log(x),
// err => console.log(err)
// )
// Rx.Observable.of(1, 2, 3, 4, 5)
// .map(n => {
// if (n === 4) {
// throw 'four';
// }
// return n;
// })
// .retry(2)
// // .catch((err, caught) => caught)
// // .take(10)
// .subscribe(x => console.log(x), err => console.error(err));<file_sep>/RXJS/src/buffer.ts
import Rx from 'rxjs/Rx';
/**bufferWhen
* Collects values from the past as an array.
* When it starts collecting values, it calls a function that returns an Observable that tells when to close the buffer and restart collecting.
*/
const clicks = Rx.Observable.fromEvent(document, 'click');
const buffered = clicks.bufferWhen(() =>
Rx.Observable.interval(1000 + Math.random() * 4000)
);
buffered.subscribe(x => console.log(x));
/**bufferToggle
* Collects values from the past as an array. Starts collecting only when opening emits,
* and calls the closingSelector function to get an Observable that tells when to close the buffer.
*/
// //emit value every second
// const sourceInterval = Rx.Observable.interval(1000);
// //start first buffer after 5s, and every 5s after
// const startInterval = Rx.Observable.interval(5000);
// //emit value after 3s, closing corresponding buffer
// const closingInterval = (val: number) => {
// console.log(`Value ${val} emitted, starting buffer! Closing in 3s!`);
// return Rx.Observable.interval(3000);
// };
// //every 5s a new buffer will start, collecting emitted values for 3s then emitting buffered values
// const bufferToggleInterval = sourceInterval
// .bufferToggle(
// startInterval,
// closingInterval
// );
// //log to console
// //ex. emitted buffers [4,5,6]...[9,10,11]
// const subscribe = bufferToggleInterval.subscribe(val =>
// console.log('Emitted Buffer:', val)
// );
/**bufferTime
* Collects values from the past as an array, and emits those arrays periodically in time.
*/
// const interval = Rx.Observable.interval(1000);
// const buffered_time = interval.bufferTime(4000);
// buffered_time.subscribe((x: number[]) => console.log(x));
/**bufferCount
* Collects values from the past as an array, and emits that array only when its size reaches bufferSize.
*/
// const clicks = Rx.Observable.fromEvent(document, 'click');
// const buffered_count = clicks.bufferCount(2, 1);
// buffered_count.subscribe((x: MouseEvent[]) => console.log(x));
/** buffer
* Collects values from the past as an array, and emits that array only when another Observable emits.
*/
// const clicks = Rx.Observable.fromEvent(document, 'click');
// const interval = Rx.Observable.interval(1000);
// const buffered = interval.buffer(clicks);
// buffered.subscribe((x: number[]) => console.log(x));
|
4b863f244d27a1a7b1724988346a20c54c19aa87
|
[
"TypeScript"
] | 13 |
TypeScript
|
ChenFangzheng/rxjs_practice
|
06390ed0dc24c33b1136922eb0b874b16055d608
|
376f7ca93077fd8b964ba4bfcf1a0e7ff4fadd94
|
refs/heads/master
|
<repo_name>dtingg/linked-list-exercises<file_sep>/exercise5.rb
require_relative "list_node"
# Returns the list reversed
# def reverse(head)
# current = head
# new_head = ListNode.new(current.data)
# while !current.next_node.nil?
# new_head = ListNode.new(current.next_node.data, new_head)
# current = current.next_node
# end
# return new_head
# end
def reverse(head)
return nil if head.nil?
current = head
previous_node = nil
until current.nil?
next_node = current.next_node
current.next_node = previous_node
previous_node = current
current = next_node
end
return previous_node
end
# Block 1 - Create the list
head = ListNode.new(8)
head = ListNode.new(7, head)
head = ListNode.new(6, head)
head = ListNode.new(5, head)
head = ListNode.new(4, head)
head = ListNode.new(3, head)
head = ListNode.new(2, head)
head = ListNode.new(1, head)
# Block 2
current = head
puts "Before the reverse the list is:"
until current.nil?
puts current.data
current = current.next_node
end
# Block 3
head = reverse(head)
# Block 4
current = head
puts "The list is now:"
until current.nil?
puts current.data
current = current.next_node
end
|
2beed2d895f847c24ef9665e670ece0a3df57490
|
[
"Ruby"
] | 1 |
Ruby
|
dtingg/linked-list-exercises
|
bc6ffe359678aeb7a9594196474e88bc309445da
|
4d1a31a9eb5521517bbefdb1f106ac7cca36e67e
|
refs/heads/master
|
<repo_name>ff6347/AEMap-Utilities.jsx<file_sep>/AEMap-Utilities.jsx
{
/*
* AEMap Utilities.jsx
* These are some usefull functions. not only for Maps
* Version 0.2 UI Skeleton
* An After Effetcs CS5 Dockable Scripts Panel for Mercator Map Creation
* Copyright (c) 2012 Fabian "fabiantheblind" <NAME>
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy, modify,
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
* The above copyright notice and this permission notice shall be included in all copies
* or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* see also http://www.opensource.org/licenses/mit-license.php
*
*/
// UI BUILD WITH http://crgreen.com/boethos/
// inspired by DUIK Tools
run_aemaputil_script(this);
function run_aemaputil_script(thisObj){
var version = "0.4";
app.settings.saveSetting("aemaputil","version",version);
var WEBSITE = "http://fabiantheblind.github.com/AEMap/";
if (parseFloat(app.version) < 10.0){
// alert("I'm so sorry. This script works only in AE CS 5.\nI will try to fix that");
// return;
}
// if (! app.settings.haveSetting("aemaputil", "version")){
// app.settings.saveSetting("aemaputil","version",version);
// }
//~ alert(app.settings.getSetting("aemaputil","version"));
// alert("this script is not ready yet. its only the ui skeleton.\n check back later on " + WEBSITE);
/// THIS WILL CHECK IF PANEL IS DOCKABLE OR FLAOTING WINDOW
var win = build_aemaputil_UI(thisObj);
if ((win != null) && (win instanceof Window)) {
win.center();
win.show();
}
// ------------ The User Interface ------------
function build_aemaputil_UI(thisObj) {
var BTTNSIZE = [130,20];
var GRPSIZE = [130,110];
var ETXTSIZE = [50,20];
// ------------ 3D and Collapse ------------
var THREEDEE = true;
var COLLTRANS = true;
var INCLUDEPRECOMPS3D = true;
var INCLUDEPRECOMPSSHDOW = true;
// ------------ Sequence ------------
var OFFSET = 1;
// ------------ Set Duration ------------
var DURTYPE = 0; // 0 for frames 1 for seconds
var FRAMES = true;
var SECONDS = false;
var DURATION = 1;
var INCLUDEPRECOMPSDUR = true;
var FPS = (app.settings.haveSetting("aemaputil","fpsbase") == true) ? app.settings.getSetting("aemaputil","fpsbase") : "25";
// ------------ for baking expressions bakeex or bex ------------
var SELECTEDPROPS = true;
var INCLUDEPRECOMPSBEX = false;
// ------------ Error Strings ------------
var ERRORoffset = "Please use only digits for the frameoffset.\nOffset is set to: ";
var ERRORdurfr = "Please use only digits for the duration in frames.\nDuration is set to: ";
var ERRORdursec = "Please use only floating point values for the duration in seconds. For example 2.5.\nDuration is set to: ";
var ERRORfps = "Please use only digits for the frames per seconds.\FPS is set to: ";
var ERRORfpswrong = "The fps rate that you set is different from the active comp please correct that.";
var ERROR3dnosel = "Uh that was hard. Not making 3D layers and not collapsing anything :).\nBut nice project man. Lots of layers and stuff... That means:\nPlease select at least one of the checkboxes";
// ------------ UI Strings ------------
var SEQHelptext = "\nSequencer:\nSelect some layers and define a frame offset. The Textbox accepts only digits!\n"
var DURHelpText = "\nSet Duration:\nSelect some Layers and define a duration in frames or seconds. This will try to step into each precomp and set all layers and coms to the selected length. The Textbox accepts only digits when set to frames. If it is set to seconds it accepts floating point values. e.g. 2.5.\nif you change it will try to calculate the corresponding duration in frames or seconds\nWARNING this will not change the framerate of the comps.\n";
var CT3DELPText = "\nCollapse and 3D:\nThis will change the collapse and 3D attributes of the selected layers.\nIf you select \"precomps\" it will step into every precomp and change them aswell\n";
var BAKEEXHELPText = "\nBake Expressions:\nThis will try to bake all axpressions of every selected layer. If you set it to \"selected properties only\" it will...\n Yes you are right. Bake only the selected props ones. Baking can take a lot of time. It is much faster to use the selected props only\n";
var SETTINGSHELPText ="\nSettings:\nHere you can look up the web resource and set the fps base for the frame to seconds conversion calculation\n";
var TINYTOOLSHELPText = "\nTiny Tools:\nThese oneshot tools should make some tasks easier:\nname 2 source\nchanges the source name of the selected layer to the given name in the comp\nsource 2 name\nchanges the name of the selected layer to the source name in the project\nmarker/frame\nadds on the selected layer a marker per frame for the workare duration\nmarker/prcmps\nadds a marker for every source.layer in point for the selected layer\nnew render loc\nchanges the render location of all queued items in the render list and adds a folder with that name for every eport module. If the folder exists it uses this folder. Usefull when rendering lots of image sequences.\nCamWithDolly\nadds a 50mm camera to the comp and a dolly with some wiggle expression controls.\nZorro 2 Txt\ncreates for every Zorro Tag a Textlayer. It will split by \",\" and remove all asterix\n";
var HELPText = "Quick Help\nFor further info go to the website at\n"+WEBSITE+"\n"+SEQHelptext+DURHelpText+CT3DELPText+BAKEEXHELPText+TINYTOOLSHELPText +SETTINGSHELPText;
// ------------ for opening the website ------------
var winProgramFiles = Folder.commonFiles.parent.fsName;
var winBrowserCmd = winProgramFiles + "\\Internet Explorer\\iexplore.exe";// You can chage the browser to use on windows here, use double slashes
var macBrowserCmdStart = "osascript -e 'open location \"";
var macBrowserCmdEnd = "\"'";
// ------------ END OF GLOBALS ------------
// finally a window
var win = (thisObj instanceof Panel) ? thisObj : new Window('palette', 'AEMap Utilities',[0,0,210,175]);
if (win != null) {
win.vers = win.add('statictext',[7,155,200,170],"v " + version);
win.vers.justify = 'right';
win.help = win.add('button', [7,5,45,25], '?');
win.selector = win.add('dropdownlist',[50,5,200,25],["Sequencer","3D and Collapse","Set Duration","Bake Expressions","Tiny Tools","Settings"]);
win.selector.selection = 0;
var panelsize = [5,30,200,150];
win.seq = win.add('panel', panelsize);
win.seq.visible = true;
win.c3d = win.add('panel',panelsize);
win.c3d.visible = false;
win.dur = win.add('panel', panelsize);
win.dur.visible = false;
win.bex = win.add('panel', panelsize);
win.bex.visible = false;
win.tools = win.add('panel', panelsize);
win.tools.visible = false;
win.settings = win.add('panel', panelsize);
win.settings.visible = false;
win.selector.onChange = function() {
if (this.selection == 0){
win.seq.visible = true;
win.c3d.visible = false;
win.dur.visible = false;
win.bex.visible = false;
win.tools.visible = false;
win.settings.visible = false;
}
if (this.selection == 1){
win.seq.visible = false;
win.c3d.visible = true;
win.dur.visible = false;
win.bex.visible = false;
win.tools.visible = false;
win.settings.visible = false;
} if (this.selection == 2){
//~ if (parseFloat(app.version) < 10.0){
//~ alert("I'm so sorry but this behaves a bit bogus in CS 4 right now");
//~ return;
//~ }
win.seq.visible = false;
win.c3d.visible = false;
win.dur.visible = true;
win.bex.visible = false;
win.tools.visible = false;
win.settings.visible = false;
}
if (this.selection == 3){
win.seq.visible = false;
win.c3d.visible = false;
win.dur.visible = false;
win.bex.visible = true;
win.tools.visible = false;
win.settings.visible = false;
}
if (this.selection == 4){
win.seq.visible = false;
win.c3d.visible = false;
win.dur.visible = false;
win.bex.visible = false;
win.tools.visible = true;
win.settings.visible = false;
}
if (this.selection == 5){
win.seq.visible = false;
win.c3d.visible = false;
win.dur.visible = false;
win.bex.visible = false;
win.tools.visible = false;
win.settings.visible = true;
}
}
// ------------ sequencer ui ------------
win.doseq = win.seq.add('button', [3,2,188,30], 'sequence selection');
win.offsetlabel = win.seq.add('statictext', [7,40,100,60], 'frame offset: ');
win.offsetval = win.seq.add('edittext', [100,40,180,60], '1');
// ------------ 3d ui ------------
win.ct3dbttn = win.c3d.add('button', [3,2,188,30], 'collapse and 3d');
win.threedee = win.c3d.add('checkbox', [5,40,100,60], '3D?');
win.threedee.value = THREEDEE;
win.ctrns = win.c3d.add('checkbox', [5,60,100,80], 'collapse?');
win.ctrns.value = COLLTRANS;
win.inclprc3d = win.c3d.add('checkbox', [105,40,200,60], 'precomps?');
win.inclprc3d.value = INCLUDEPRECOMPS3D;
win.inclprcshdow = win.c3d.add('checkbox', [105,60,200,80], 'shadows?');
win.inclprcshdow.value = INCLUDEPRECOMPSSHDOW;
win.inclprcshdow.visible = false;
// ------------ set dur ui ------------
win.setdur = win.dur.add('button', [3,2,188,30], 'set duration');
win.durlabel = win.dur.add('statictext', [7,40,100,60], 'new duration:');
win.durval = win.dur.add('edittext', [100,40,180,60], '1');
win.fpslabel = win.dur.add('statictext', [7,65,100,85], 'fps base: ');
win.fpsval = win.dur.add('edittext', [100,65,180,85], FPS);
win.radioframes = win.dur.add('radiobutton',[7,90,100,110], 'frames');
win.radioframes.value = FRAMES;
win.radiosec = win.dur.add('radiobutton', [100,90,200,110], 'seconds');
win.radiosec.value = SECONDS;
// ------------ bake ex ui ------------
win.bakeexbttn = win.bex.add('button', [3,2,188,30], 'bake expressions');
win.selprops = win.bex.add('checkbox', [5,40,200,60], 'selected properties only?');
win.selprops.value = SELECTEDPROPS;
win.inclprcmp = win.bex.add('checkbox', [5,60,100,80], 'include precomps?');
win.inclprcmp.value = INCLUDEPRECOMPSBEX;
win.inclprcmp.enabled = false;
win.inclprcmp.visible = false;
// ------------ tools ui ------------
var bh = 25;
var bgttr = 2;
var x1 = 3;
var x2 = 91;
var x3 = 94;
var x4 = 188;
var y1 = 2;
// ------------ row 1 ------------
win.n2sn = win.tools.add('button', [ x1, y1 , x2 , y1 + bh], 'name 2 source');
win.sn2n = win.tools.add('button', [ x3, y1 , x4 , y1 + bh], 'source 2 name');
// ------------ row 2 ------------
win.mpf = win.tools.add('button', [ x1, y1 + bh + bgttr , x2 , y1 + (bh*2) + bgttr], 'marker/frame');
win.mpprcmp = win.tools.add('button', [ x3, y1+ bh + bgttr , x4 , y1 + (bh*2) + bgttr], 'marker/prcmps');
// ------------ row 3 ------------
win.rloc = win.tools.add('button', [ x1, (y1 + (bh*2) + (bgttr*2)), x2 , (y1 + (bh*3) + (bgttr*2))],'new render loc');
win.dollycam = win.tools.add('button', [ x3, (y1 + (bh*2) + (bgttr*2)), x4 , (y1 + (bh*3) + (bgttr*2))], 'CamWithDolly');
// ------------ row 4 ------------
win.dumbCom = win.tools.add('button', [ x1, (y1 + (bh*3) + (bgttr*3)), x2 , (y1 + (bh*4) + (bgttr*3))],'zorro 2 txt');
win.nothing = win.tools.add('button', [ x3, (y1 + (bh*3) + (bgttr*3)), x4 , (y1 + (bh*4) + (bgttr*3))], 'undefined');
win.nothing.enabled = true;
// ------------ settings ui ------------
// var path = ((new File($.fileName)).path);
// var myFile = new File( path+"/tempicon.png");
// var myFile = new File("~/Desktop/xxxmyFilexxx.png");
// myFile.encoding = "BINARY";
// myFile.open( "w" );
// myFile.write( myBinaryImg );
// myFile.close();
win.openolhelp = win.settings.add('button', [3,2,188,30], 'open online reference');
// win.fpslabel = win.settings.add('statictext', [7,40,100,60], 'fps base: ');
// win.fpsval = win.settings.add('edittext', [100,40,180,60], FPS);
// win.img = win.settings.add("image", [3,63,180,80], myFile); //displaying it.
// myFile.remove(); //no longer need the file, remove it.
win.offsetval.onChange = function (){
OFFSET = Math.abs(parseInt (this.text));
if(isNaN (OFFSET)==true){
OFFSET = 1;
this.text = 1;
alert(ERRORoffset + OFFSET);
}
};
win.threedee.onClick = function (){THREEDEE = this.value;};
win.ctrns.onClick = function (){COLLTRANS = this.value;};
win.inclprc3d.onClick = function (){INCLUDEPRECOMPS3D = this.value};
win.inclprcshdow.onClick = function (){INCLUDEPRECOMPSSHDOW = this.value};
win.durval.onChange = function (){
if(FRAMES == true){
DURATION = Math.abs(parseInt (this.text));
if(isNaN (DURATION)==true){
DURATION = 1;
this.text = 1;
alert(ERRORdurfr + DURATION);
}
}
if(SECONDS == true){
DURATION = Math.abs(parseFloat (this.text));
if(isNaN (DURATION)==true){
DURATION = 1;
this.text = 1;
alert(ERRORdursec + DURATION);
}
}
};
win.fpsval.onChange = function (){
FPS = parseFloat (this.text);
alert("This is for the accurate calculation from seconds to frames only.\n It wont change your comps framerate! The script will use the comps framerate.");
if(isNaN (FPS)==true){
FPS = 25;
this.text = 25;
alert(ERRORfps + FPS);
}else{
app.settings.saveSetting("aemaputil","fpsbase",String(FPS));
}
};
// Event listener for the radio buttons
win.radiosec.onClick = win.radioframes.onClick = function () {
if(win.radioframes.value == true) {
FRAMES = true;
SECONDS = false;
DURTYPE = 0;
var buff = win.durval.text;
win.durval.text = parseInt(buff) * FPS;
}
else if(win.radiosec.value == true) {
FRAMES = false;
SECONDS = true;
DURTYPE = 1;
var buff = win.durval.text;
win.durval.text = parseInt(buff) / FPS;
}
};
win.selprops.onClick = function (){SELECTEDPROPS = this.value;};
win.inclprcmp.onClick = function(){INCLUDEPRECOMPSBEX = this.value;};
win.doseq.onClick = function () {
//alert("Do it " + this.text);
do_seq(OFFSET);
};
win.setdur.onClick = function () {
// alert("Do it " + this.text);
do_setDur(DURATION, DURTYPE, FPS);
};
win.bakeexbttn.onClick = function () {
//alert("Do it " + this.text);
do_bakeExpressions(SELECTEDPROPS, INCLUDEPRECOMPSBEX);
};
win.ct3dbttn.onClick = function () {
// alert("Do it " + this.text);
if(THREEDEE||COLLTRANS||INCLUDEPRECOMPSSHDOW){
do_3d_and_ct(THREEDEE,COLLTRANS,INCLUDEPRECOMPS3D,INCLUDEPRECOMPSSHDOW);
}else{alert(ERROR3dnosel);};
};
win.n2sn.onClick = function(){ name2sourceName(); };
win.sn2n.onClick = function(){ sourcename2name(); };
win.rloc.onClick = function(){ ChangeRenderLocations(); };
win.mpprcmp.onClick = function (){ markerPerPrecomp(); };
win.mpf.onClick = function (){markerPerFrame(); };
win.dollycam.onClick = function () { camWithDolly(); };
win.dumbCom.onClick = function () { dumpCommentsToText(); };
win.nothing.onClick = function () { emptyFunction();};
win.openolhelp.onClick = function (){
alert("in here");
openURL(WEBSITE,winBrowserCmd,macBrowserCmdStart,macBrowserCmdEnd);
}
win.help.onClick = function () {
alert(HELPText);
};
// win.layout.layout(true);
// win.layout.resize();
// win.onResizing = win.onResize = function () {this.layout.resize();}
}
return win
}
// ------------ END OF UI ------------
// This function open a URL in a browser -
//Copyright (c) 2006-2007 redefinery (<NAME>). All rights reserved.
function openURL(url,winBrowserCmd,macBrowserCmdStart,macBrowserCmdEnd){
if ($.os.indexOf("Windows") != -1){
system.callSystem("cmd /c \""+winBrowserCmd + "\" " + url);
} else {
system.callSystem(macBrowserCmdStart + url + macBrowserCmdEnd);
}
}
// ------------ tools ------------
function name2sourceName(){
app.beginUndoGroup("Name 2 source name");
var curComp = app.project.activeItem;
if (!curComp || !(curComp instanceof CompItem)){
alert("Please select a Composition.");
return;
}
if (curComp.selectedLayers.length < 1){
alert("Please select at least one layer");
return;
}
var sel = curComp.selectedLayers;
for(var i = 0;i< sel.length; i++){
try{ sel[i].source.name = sel[i].name;}catch(e){/* could be a light or camera*/}
}
app.endUndoGroup();
}
function sourcename2name(){
app.beginUndoGroup("Source name 2 name");
var curComp = app.project.activeItem;
if (!curComp || !(curComp instanceof CompItem)){
alert("Please select a Composition.");
return;
}
if (curComp.selectedLayers.length < 1){
alert("Please select art least one layer");
return;
}
var sel = curComp.selectedLayers;
for(var i = 0;i< sel.length; i++){
sel[i].name = sel[i].source.name;
}
app.endUndoGroup();
}
function markerPerPrecomp(){
app.beginUndoGroup("Marker Per Precomp layer");
var curComp = app.project.activeItem;
if (!curComp || !(curComp instanceof CompItem))
{
alert("Please select a Composition.");
return;
}
if(curComp.selectedLayers.length < 1){
alert("sry. You need to select a layer");
return;
}
var layer = curComp.selectedLayers[0];
for(var i = 0; i < parseInt(layer.source.numLayers);i++){
var newMarkerVal = new MarkerValue("." + layer.source.layers[i+1].name );
var markers = layer.property("marker");
markers.setValueAtTime(layer.source.layers[i+1].inPoint, newMarkerVal);
}
app.endUndoGroup();
}
function markerPerFrame(){
app.beginUndoGroup("Marker Per Frame");
var curComp = app.project.activeItem;
if (!curComp || !(curComp instanceof CompItem))
{
alert("Please select a Composition.");
return;
}
if(curComp.selectedLayers.length < 1){
alert("sry. You need to select a layer");
return;
}
var layers = curComp.selectedLayers;
var a = curComp.frameDuration;
var b = curComp.workAreaDuration;
var c = curComp.workAreaStart;
var d = curComp.frameRate;
var len = b*d;
//alert(len);
for(var j = 0; j < layers.length ; j++){
layer = layers[j];
for(var i = 0; i < len;i++){
var m = new MarkerValue("");
var markers = layer.property("marker");
markers.setValueAtTime(c+(i*(a)),m);
}
app.endUndoGroup();
}
}
function emptyFunction(){
alert("Hello I'm a empty function. play with me...");
};
function ChangeRenderLocations()
{
var scriptName = "Change Render Locations 2 new Folders";
var newLocation = Folder.selectDialog("Select a render output folder...");
if (newLocation != null) {
app.beginUndoGroup(scriptName);
// Process all render queue items whose status is set to Queued.
for (var i = 1; i <= app.project.renderQueue.numItems; ++i) {
var curItem = app.project.renderQueue.item(i);
if (curItem.status == RQItemStatus.QUEUED) {
// Change all output modules for the current render queue item.
for (j = 1; j <= curItem.numOutputModules; ++j) {
var curOM = curItem.outputModule(j);
// this is the addition by fabiantheblind
if(curItem.numOutputModules > 1){
var targetFolder = new Folder(newLocation.fsName +"/"+curItem.comp.name + "_"+j);
}else{
var targetFolder = new Folder(newLocation.fsName +"/"+curItem.comp.name);
}
if(!targetFolder.exists){
targetFolder.create();
}
var tF = targetFolder.fsName;
// now there is a folder for each output module
// from here on
var oldLocation = curOM.file;
curOM.file = new File( tF + "/" + oldLocation.name);
//alert("New output path:\n"+curOM.file.fsName, scriptName);
}
}
}
alert("done");
app.endUndoGroup();
}
}
function camWithDolly()
{
app.beginUndoGroup("build 50mm Cam With Dolly");
var curComp = app.project.activeItem;
if (!curComp || !(curComp instanceof CompItem))
{
alert("Please select a Composition.");
return;
}
var cam = curComp.layers.addCamera("Cam1",[curComp.width/2,curComp.height/2]);
var dolly = curComp.layers.addNull();
// make a unique name for the null
dolly.source.name = "dolly Cam1";
dolly.threeDLayer = true;
var strength = dolly("ADBE Effect Parade").addProperty("ADBE Slider Control");
strength.name = "strength";
var perSecond = dolly("ADBE Effect Parade").addProperty("ADBE Slider Control");
perSecond.name = "perSecond";
dolly.position.expression = "wiggle(effect(\"perSecond\")(\"ADBE Slider Control-0001\"),effect(\"strength\")(\"ADBE Slider Control-0001\"));\n";
cam.parent = dolly;
cam.position.setValue([0,0,-1500]);
app.endUndoGroup();
}
function dumpCommentsToText(){
app.beginUndoGroup("dumb dump comments");
var cc = app.project.activeItem;
if (!cc || !(cc instanceof CompItem)){
alert("Please select a Composition.");
return;
}
if (cc.selectedLayers.length < 1){
alert("Please select at least one layer.");
return;
}
var names = new Array();
var pat = "\*";
//~ var reg = new RegExp("\n|\r","g");
//~ var reg = new RegExp("", "g");
for(var i = 0; i < cc.selectedLayers.length;i++){
if(!cc.selectedLayers[i].locked){
var cmt = cc.selectedLayers[i].comment;
var newStr = cmt.split("*").join("");
var arr = newStr.split(",");
for(var j =0;j< arr.length;j++){
names.push(arr[j]);
};
//~ names.push(cc.selectedLayers[i].comment.substring (1, cc.selectedLayers[i].comment.length));
}
}
for(var j = 0;j < names.length;j++){
if(names[j].length > 0)cc.layers.addText(names[j]);
}
app.endUndoGroup();
}
// ____ _____
// |___ \| __ \
// __) | | | |
// |__ <| | | |
// ___) | |__| |
// |____/|_____/
// ------------ CT & 3D START ------------
function do_3d_and_ct (THREEDEE,COLLTRANS,INCLUDEPRECOMPS3D,INCLUDEPRECOMPSSHDOW){
app.beginUndoGroup("make all 3 D");
var curComp = app.project.activeItem;
if (!curComp || !(curComp instanceof CompItem)){
alert("Please select a Composition.");
return;
}
if (curComp.selectedLayers.length < 1){
alert("Please select at least 1 layers");
return;
}
var ls = curComp.selectedLayers;
loop_Items (ls, 0, THREEDEE,COLLTRANS,INCLUDEPRECOMPS3D,INCLUDEPRECOMPSSHDOW);
};
// the startindex is important
// the app.project.item(index).layers starts at 1 an array starts at 0
function loop_Items(layers,strtNdx,THREEDEE,COLLTRANS,INCLUDEPRECOMPS3D,INCLUDEPRECOMPSSHDOW){
// add the startindex to fit to the app.project.item(index).layers values or the array
var selLen = layers.length;
selLen = selLen + strtNdx;
// the loop
for (var i = strtNdx; i < selLen; i++) {
// now we loop thru all that gets pushed to this function
// the trick is inside
eval_item(layers[i],THREEDEE,COLLTRANS,INCLUDEPRECOMPS3D,INCLUDEPRECOMPSSHDOW);
}
}
function eval_item(inLayer,THREEDEE,COLLTRANS,INCLUDEPRECOMPS3D,INCLUDEPRECOMPSSHDOW){
// the layer to work on
// it also can be a comp
var layer = inLayer;
//thnx 2 <NAME>
// and this: http://www.redefinery.com/ae/fundamentals/layers/
if ((layer.source instanceof CompItem)) {
collapse_and_make3d(layer,THREEDEE,COLLTRANS,INCLUDEPRECOMPSSHDOW);
if(INCLUDEPRECOMPS3D == true){
loop_Items(layer.source.layers,1,THREEDEE,COLLTRANS,INCLUDEPRECOMPS3D,INCLUDEPRECOMPSSHDOW);
}
} else {
collapse_and_make3d(layer,THREEDEE,COLLTRANS,INCLUDEPRECOMPSSHDOW);
}
}
function collapse_and_make3d(layer,THREEDEE,COLLTRANS,INCLUDEPRECOMPSSHDOW){
if(layer.locked ) return;
if(THREEDEE){
try{
if(layer.threeDLayer == false){
layer.threeDLayer = true;
}
}catch(e){/* Could be a light or a camera*/}
}
if(COLLTRANS){
if(layer.canSetCollapseTransformation == true){
layer.collapseTransformation = true;
}
};
if((layer.threeDLayer ==true) && (INCLUDEPRECOMPSSHDOW==true) ){
try{
//~ layer.property("ADBE Material Options Group").property("ADBE Casts Shadows") = 1;
}catch(e){
if(DEBUG)alert("Shadow aktivation failed\n" + e);
};
};
}
// ------------ CT & 3D END ------------
// ------------ sequence stuff ------------
function do_seq(OFFSET){
// based on the script delivered with this VC post
// http://www.videocopilot.net/tutorials/shatterize/
app.beginUndoGroup("sequence layers by " + OFFSET + " frames" );
var curComp = app.project.activeItem;
if (!curComp || !(curComp instanceof CompItem))
{
alert("Please select a composition.");
return;
}
if(curComp.selectedLayers.length < 2){
alert("Please select at least 2 layers");
return;
}
var offsetFrames = OFFSET;
var inpoint = curComp.selectedLayers[0].inPoint;
for (var layerId = 0; layerId < curComp.selectedLayers.length; layerId++)
{
var layer = curComp.selectedLayers[layerId];
layer.startTime = inpoint + (layerId * (OFFSET * curComp.frameDuration));
}
app.endUndoGroup();
}
// ------------ SEQUENZ END ------------
// ------------ SET DURATION START ------------
function do_setDur(DURATION, DURTYPE){
// get the current active composition
var curComp = app.project.activeItem;
// if ther is no comp
if (!curComp || !(curComp instanceof CompItem)) {
// alert and end the script
alert("please select a composition and at least a layer");
return;
}
// start undogroup
app.beginUndoGroup("change duration");
// get all the layers
var sellayers = curComp.selectedLayers;
if (!sellayers.length){
// alert and end the script
alert("please select at least one layer");
return;
}
// get them all into an array
var layers = new Array();
for (var i = 0; i < curComp.selectedLayers.length; i++){
layers.push(sellayers[i]);
}
// ****************************************************
var val;
if(DURTYPE == 0){
// frames
val = DURATION / curComp.frameRate;
}else if (DURTYPE == 1){
//seconds
val = DURATION ;
}
// this starts the looping thru all items
// if(INCLUDEPRECOMPSDUR){
// curComp.duration = val;
// }
chngDur(layers,val,0);
// ****************************************************
//end undogroup
app.endUndoGroup();
}
// the startindex is important
// the app.project.item(index).layers starts at 1 an array starts at 0
function chngDur(layers,val,strtNdx){
// add the startindex to fit to the app.project.item(index).layers values or the array
var selLen = layers.length + strtNdx;
// the loop
for (var i = strtNdx; i < selLen; i++) {
//try {
// now we loop thru all that gets pushed to this function
// the trick is inside
change(layers[i],val);
//}catch(e){
//$.writeln (e);
//}
}
}
function change(inLayer,val){
// the layer to work on
// it also can be a comp
var layer = inLayer;
if((layer instanceof LightLayer)||(layer instanceof CameraLayer) || (layer instanceof TextLayer) || (layer instanceof ShapeLayer)){
layer.inPoint = 0;
layer.outPoint = val;
}else{
// this is the trick if the layer has some layers inside
if (layer.source.numLayers != null) {
// still set the duration and in out points
layer.source.duration = val;
layer.inPoint = 0;
layer.outPoint = val;
// and now send the content of the layer back into the loop
chngDur(layer.source.layers,val,1);
} else {
// if it is just a layer set the in out point
layer.inPoint = 0;
layer.outPoint = val;
}
}
};
// ------------ SET DURATION END ------------
// ____ _ ________ ________ __
// | _ \ /\ | |/ / ____| | ____\ \ / /
// | |_) | / \ | ' /| |__ | |__ \ V /
// | _ < / /\ \ | < | __| | __| > <
// | |_) / ____ \| . \| |____ | |____ / . \
// |____/_/ \_\_|\_\______| |______/_/ \_\
// ------------ BAKE EXPRESSION START ------------
// bake stuff start this is actually by fabiantheblind
// the rest is taken from the world wide world of webs
function do_bakeExpressions(SELECTEDPROPS, INCLUDEPRECOMPSBEX){
// get the current active composition
var curComp = app.project.activeItem;
// if ther is no comp
if (!curComp || !(curComp instanceof CompItem)) {
// alert and end the script
alert("Please select a composition and some layers with expressions");
return;
}
// start undogroup
app.beginUndoGroup("bake expressions");
// get all the layers
var sellayers = curComp.selectedLayers;
if (!sellayers.length){
// alert and end the script
alert("Please select a layer wit some expressions");
return;
}
// get them all into an array
var layers = new Array();
for (var i = 0; i < curComp.selectedLayers.length; i++){
layers.push(sellayers[i]);
}
// this starts the looping thru all items
if(SELECTEDPROPS == true){
for(var j = 0;j < layers.length; j++){
var props = layers[j].selectedProperties;
if(props.length < 1){
alert("there are no properties selected");
return;
}
bex_selProps(props);
}
}else{
bex_loop_Items(layers,0, INCLUDEPRECOMPSBEX);
}
//end undogroup
app.endUndoGroup();
alert("Your cake is ready.\n");
}
// the startindex is important
// the app.project.item(index).layers starts at 1 an array starts at 0
function bex_loop_Items(layers ,strtNdx, INCLUDEPRECOMPSBEX){
// add the startindex to fit to the app.project.item(index).layers values or the array
var selLen = layers.length;
selLen = selLen + strtNdx;
// the loop
for (var i = strtNdx; i < selLen; i++) {
// now we loop thru all that gets pushed to this function
// the trick is inside
bex_eval_item(layers[i], INCLUDEPRECOMPSBEX);
}
}
function bex_eval_item(inLayer, INCLUDEPRECOMPSBEX){
// the layer to work on
// it also can be a comp
var layer = inLayer;
//thnx 2 <NAME>
// and this: http://www.redefinery.com/ae/fundamentals/layers/
if (layer.source instanceof CompItem) {
bex_loop_Prop(layer);
if(INCLUDEPRECOMPSBEX == true){
bex_loop_Items(layer.source.layers,1,INCLUDEPRECOMPSBEX);
}
} else {
bex_loop_Prop(layer);
}
}
function bex_loop_Prop(layer){
for (var j = 1; j <= layer.numProperties; j++){
var prop = layer.property(j);
bex(prop);
}
}
// this is from nab i think
function bex_convertToKeyframes(theProperty){
if (theProperty.canSetExpression && theProperty.expressionEnabled){
theProperty.selected = true;
// english version
//app.executeCommand(app.findMenuCommandId("Convert Expression to Keyframes"));
// german version "Expression in Keyframes umwandeln"
app.executeCommand(2639); // or just use the Id need to test it in english
theProperty.selected = false;
}
}
function bex_selProps(props){
for (var j = 1; j < props.length; j++){
var prop = props[j];
bex(prop);
}
}
function bex(prop){
if (prop.canSetExpression == true){
if((prop.expressionEnabled == true) && (prop.expression != null)){
bex_convertToKeyframes(prop);
}
}
if(prop.numProperties != null){
bex_loop_Prop(prop);
}
}
// ------------ BAKE EX END ------------
};// ------------ THIS IS THE END OF RUNSCRIPT ------------
}<file_sep>/README.md
AEMap-Utilities.jsx
===================
AEMap-Utilities.jsx util scripts for AEMap
|
21f8fd1d0417291cb3af88521925279b6725d66f
|
[
"JavaScript",
"Markdown"
] | 2 |
JavaScript
|
ff6347/AEMap-Utilities.jsx
|
91c7120e3bb9719d62f275c1b4754934d1146f82
|
1da1a93645e6b5c50aeb194feba033e8328d5fed
|
refs/heads/master
|
<file_sep>import React from 'react'
class Tv_Box extends React.Component{
render(){
return <table key={this.props.show.id}>
<tbody>
<tr>
<td>
<img alt="poster" width="245" height="290"src={this.props.show.poster_src}/>
</td>
<td>
<h3>{this.props.show.name}</h3>
<p><b>Release Date: </b>{this.props.show.release_date} | <b>Popularity: </b>{this.props.show.popularity} <br></br> <br></br>
{this.props.show.overview} </p>
<br/><br/>
</td>
</tr>
</tbody>
</table>
}
}
export default Tv_Box<file_sep>import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import InputLabel from '@material-ui/core/InputLabel';
import MenuItem from '@material-ui/core/MenuItem';
import FormControl from '@material-ui/core/FormControl';
import Select from '@material-ui/core/Select';
import Movie_Box from './Movie_Box'
const useStyles = makeStyles(theme => ({
formControl: {
margin: theme.spacing(1),
minWidth: 120,
width:'2in',
},
}));
function Category_movie() {
const classes = useStyles();
const [Category, setValue] = React.useState('');
const inputLabel = React.useRef(null);
const handleChange = event => {
setValue(event.target.value);
new Movie_Box({"info": event.target.value})
};
return (
<FormControl variant="outlined" className={classes.formControl}>
<InputLabel ref={inputLabel} id="demo-simple-select-outlined-label">
Category
</InputLabel>
<Select
onChange={handleChange}
>
<MenuItem value={'now_playing'}>Now Playing</MenuItem>
<MenuItem value={'popular'}>Popular</MenuItem>
<MenuItem value={'top_rated'}>Top Rated</MenuItem>
<MenuItem value={'upcoming'}>Upcoming</MenuItem>
</Select>
</FormControl>
)
}export default Category_movie<file_sep>import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import InputLabel from '@material-ui/core/InputLabel';
import MenuItem from '@material-ui/core/MenuItem';
import FormControl from '@material-ui/core/FormControl';
import Select from '@material-ui/core/Select';
import Tv_Show_Box from './Tv_Show_Box'
const useStyles = makeStyles(theme => ({
formControl: {
margin: theme.spacing(1),
minWidth: 120,
width:'2in',
},
}));
function Category_tvShows() {
const classes = useStyles();
const [Category, setValue] = React.useState('');
const inputLabel = React.useRef(null);
const handleChange = event => {
setValue(event.target.value);
new Tv_Show_Box({"info2": event.target.value});
};
return (
<FormControl variant="outlined" className={classes.formControl}>
<InputLabel ref={inputLabel} id="demo-simple-select-outlined-label">
Category
</InputLabel>
<Select
onChange={handleChange}
>
<MenuItem value={'airing_today'}>Airing Today</MenuItem>
<MenuItem value={'on_the_air'}>On The Air</MenuItem>
<MenuItem value={'popular'}>Popular</MenuItem>
<MenuItem value={'top_rated'}>Top Rated</MenuItem>
</Select>
</FormControl>
)
}
export default Category_tvShows<file_sep>import React from 'react';
import PropTypes from 'prop-types';
import Category_movie from './Category_movie'
import Category_tvShows from './Category_tvShows'
import { makeStyles } from '@material-ui/core/styles';
import AppBar from '@material-ui/core/AppBar';
import Tabs from '@material-ui/core/Tabs';
import Tab from '@material-ui/core/Tab';
import Typography from '@material-ui/core/Typography';
import Box from '@material-ui/core/Box';
import Movie_Box from './Movie_Box';
import Tv_Show_Area from './Tv_Show_Box';
function TabPanel(props) {
const { children, value, index, } = props;
return (
<Typography
component="div"
role="tabpanel"
hidden={value !== index}
id={`simple-tabpanel-${index}`}
aria-labelledby={`simple-tab-${index}`}
>
<Box>{children}</Box>
</Typography>
);
}
TabPanel.propTypes = {
children: PropTypes.node,
index: PropTypes.any.isRequired,
value: PropTypes.any.isRequired,
};
function a11yProps(index) {
return {
id: `simple-tab-${index}`,
'aria-controls': `simple-tabpanel-${index}`,
};
}
const useStyles = makeStyles(theme => ({
root: {
border: '1px solid grey',
margin:'2%'
},
}));
export default function SimpleTabs() {
const classes = useStyles();
const [value, setValue] = React.useState(0);
const handleChange = (event, newValue) => {
setValue(newValue);
};
return (
<div className={classes.root}>
<AppBar position="static">
<Tabs value={value}
onChange={handleChange}
variant="fullWidth"
className = "tab-bar"
>
<Tab id = "t1" label="MOVIES" {...a11yProps(0)}/>
<Tab id = "t2" label="SEARCH RESULT" {...a11yProps(1)} />
<Tab id = "t3" label="TV SHOWS" {...a11yProps(2)} />
</Tabs>
</AppBar>
<TabPanel value={value} index={0}>
<h3> MOVIES </h3>
<Category_movie/>
<Movie_Box info={"popular"}/>
</TabPanel>
<TabPanel value={value} index={1}>
<h3>Please Enter A Search</h3>
</TabPanel>
<TabPanel value={value} index={2}>
<h3>TV SHOWS</h3>
<Category_tvShows/>
<Tv_Show_Area info2={"airing_today"}/>
</TabPanel>
</div>
);
}
<file_sep>import React from 'react'
class Movie_Card extends React.Component{
render(){
return <table key={this.props.movies.id}>
<tbody>
<tr>
<td>
<img alt="poster" width="240" height="290"src={this.props.movies.poster_src}/>
</td>
<td>
<h2>{this.props.movies.title}</h2>
<p><b>Release Date: </b>{this.props.movies.release_date} | <b>Popularity: </b>{this.props.movies.popularity} <br></br><br></br>
{this.props.movies.overview}
</p>
<br/><br/>
</td>
</tr>
</tbody>
</table>
}
}
export default Movie_Card<file_sep>import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import TextField from '@material-ui/core/TextField';
import { Button, Select } from '@material-ui/core';
const style = makeStyles(theme => ({
textField: {
width: '90%',
},
})
);
const Search_bar = () => {
return (
<div id ="SearchContainer">
<TextField
id="search"
label="Enter a search"
variant="outlined"
/>
<Select
labelId="enter_text"
id="searchDrpdwn"
>
<option value={'movies'}>Movie</option>
<option value={'multi'}>Multi</option>
<option value={'tv'}>Tv</option>
</Select>
<Button
id ="submitBtn"
variant="contained"
color="primary" >
Search</Button>
</div>
)
}
export default Search_bar
|
e02054e77fd78dba4ca44841526cf894fbf66c47
|
[
"JavaScript"
] | 6 |
JavaScript
|
mehtabbal/React_Movies_App
|
4e35f0c62d26d5fe3c914e6b730640bf3a249ac8
|
e805f67918212aa907e4930873286d73d871c7e4
|
refs/heads/master
|
<repo_name>kolialike/deco<file_sep>/src/js/main.js
jQuery(function($){
// select
$('select').selectric();
var servicePrItem = $(".services-price-item-ins")
servicePrItem.on('click', function(event) {
$(this).toggleClass('active');
});
// select
// menu
var body = $("body");
var menuBurger = $(".menu-burger");
menuBurger.on('click', function(event) {
event.preventDefault();
body.toggleClass('mobile-menu-open');
});
var mobileMenu = $(".mobile-menu");
mobileMenu.on('click', function(event) {
event.preventDefault();
body.removeClass("mobile-menu-open");
});
var mobileMenuItem = $(".mobile-menu-item");
mobileMenuItem.on('click', function(event) {
var thisLala = event.target;
if(!$(thisLala).data('lang')) event.stopPropagation();
});
// menu
// buttom-scroll
$(".main-content-text-price").on('click', function(event) {
var $mainContant = $('.main-content');
var menuTop = $mainContant.height();
$("body, html").animate({scrollTop: menuTop + "px"}, 1000);
});
// buttom-scroll
});
<file_sep>/build/html/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Pravo</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=0.6,maximum-scale=1,user-scalable=no,minimal-ui">
<link rel="stylesheet" type="text/css" href="../css/screen.css" />
<!-- <link rel="shortcut icon" href="{THEME}/img/favicon.ico" type="image/x-icon"> -->
<!-- <link rel="icon" href="{THEME}/img/favicon.ico" type="image/x-icon"> -->
</head>
<body>
<div class="global-wrapper">
<nav class="mobile-menu">
<div class="mobile-menu-item">
<ul>
<li><a href="#">Услуги и ЦЕНЫ</a></li>
<li><a href="#">ОТЗЫВЫ</a></li>
<li class="current-menu-item"><a href="#">КОНТАКТЫ</a></li>
</ul>
<div class="language">
<a href="#">Ru</a>
</div>
</a>
</div>
</nav>
<header id="header">
<div class="wrapper">
<div class="header-content">
<a href="#" class="logo"><img src="../img/logo.png" alt=""></a>
<div class="menu-burger"><span class="menu-burger-item"></span></div>
<div class="language">
<a href="#">Ru</a>
</div>
<nav class="main-menu">
<ul>
<li><a href="#">Услуги и ЦЕНЫ</a></li>
<li><a href="#">ОТЗЫВЫ</a></li>
<li class="current-menu-item"><a href="#">КОНТАКТЫ</a></li>
</ul>
</nav>
</div>
</div>
</header>
<section class="main-content">
<div class="main-content-img">
<img src="../img/man.jpg" alt="">
<a href="#" class="play"></a>
</div>
<div class="wrapper">
<div class="main-content-text">
<h3>Правовое сопровождение малого ИТ-бизнеса</h3>
<p>Зачастую интернет-проекты, разработчики, маркетологи, дизайнеры, стартаперы и другие IT-специалисты не уделяют должного внимания правовым аспектам своей деятельности. </p>
<p>Но <strong>документы должны быть в порядке</strong>, и мы в этом поможем.</p>
<div class="main-content-text-price">услуги и цены</div>
</div>
</div>
</section>
<section class="services-price">
<div class="wrapper">
<h4 class="main-title">услуги и цены</h4>
<p class="title-desc"><strong>Pravo agency</strong> выполняет роль юристов-аутсорсеров, надежно прикрывая правовой тыл вашей деятельности.</p>
</div>
<div class="services-price-item services-price-item-first">
<div class="wrapper">
<div class="services-price-item-ins">
<h5 class="services-price-icon-1"><span>Наведение порядка</span> в делах<p class="info"></p></h5>
<p>Аудит документов и платежей на предмет:</p>
<ul>
<li>соблюдения необходимых формальностей и процедур,</li>
<li>наличия всех оригиналов договоров, актов, </li>
<li>легализация зависших платежей.</li>
</ul>
<div class="description">
<div class="description-arrow"></div>
<div class="description-item">
<p class="description-item-left first">услуга</p>
<h5 class="services-price-icon-2"><span>Наведение порядка</span> в делах</h5>
<p>Борьба внутри меня, и я был в самых разных ситуациях в моей жизни. <strong>Таким образом, борьба, что у меня на постоянной основе, это просто пробовать и быть лучше.</strong> </p>
<p>Есть определенная разница между публичным человеком и обычным человеком, это как сойти с ума - для меня во всяком случае - открыть себя целиком для всего мира.</p>
</div>
<div class="description-item">
<p class="description-item-left">Цена</p>
<div class="description-item-price">
<strong>< 50</strong>
<p>Сотрудников</p>
<p>от <strong>5000 <span>грн.</span></strong></p>
</div>
<div class="description-item-price">
<strong>50-100</strong>
<p>Сотрудников</p>
<p>от <strong>15000 <span>грн.</span></strong></p>
</div>
<div class="description-item-price">
<strong>> 100</strong>
<p>Сотрудников</p>
<p>от <strong>25000 <span>грн.</span></strong></p>
</div>
<a href="#" class="main-content-text-price">заказать</a>
</div>
</div>
</div>
<div class="services-price-item-ins">
<h5 class="services-price-icon-2"><span>Оптимизация</span> договорных отношений <p class="info"></p></h5>
<ul>
<li>Доработка, латание дыр и улучшение условий основных типовых договоров вашей компании</li>
<li>Оформление сотрудников на оптимальных ведения деятельности и налогообложения</li>
<li>Составление договоров, соглашений о конфиденциальности, публичных офферт</li>
</ul>
<div class="description">
<div class="description-arrow"></div>
<div class="description-item">
<p class="description-item-left">услуга</p>
<h5 class="services-price-icon-2"><span>Оптимизация</span> договорных отношений </h5>
<p>Борьба внутри меня, и я был в самых разных ситуациях в моей жизни. <strong>Таким образом, борьба, что у меня на постоянной основе, это просто пробовать и быть лучше.</strong> </p>
<p>Есть определенная разница между публичным человеком и обычным человеком, это как сойти с ума - для меня во всяком случае - открыть себя целиком для всего мира.</p>
</div>
<div class="description-item">
<p class="description-item-left">Цена</p>
<div class="description-item-price">
<strong>< 50</strong>
<p>Сотрудников</p>
<p>от <strong>5000 <span>грн.</span></strong></p>
</div>
<div class="description-item-price">
<strong>50-100</strong>
<p>Сотрудников</p>
<p>от <strong>15000 <span>грн.</span></strong></p>
</div>
<div class="description-item-price">
<strong>> 100</strong>
<p>Сотрудников</p>
<p>от <strong>25000 <span>грн.</span></strong></p>
</div>
<a href="#" class="main-content-text-price">заказать</a>
</div>
</div>
</div>
</div>
</div>
<div class="services-price-item">
<div class="wrapper">
<div class="services-price-item-ins services-price-item-second">
<h5 class="services-price-icon-3">Правовое сопровождение деятельности (юрист-аутсорсер)<p class="info"></p></h5>
<ul>
<li>Участие в заключении договоров: минимизация рисков, усиление ваших позиций</li>
<li>Юридическая консультация</li>
<li>Дайджест предпринимательских ИТ-новостей с разъяснениями</li>
<li>Представительство интересов в судах</li>
</ul>
<div class="description">
<div class="description-arrow"></div>
<div class="description-item">
<p class="description-item-left first">услуга</p>
<h5 class="services-price-icon-2">Правовое сопровождение деятельности (юрист-аутсорсер)</h5>
<p>Борьба внутри меня, и я был в самых разных ситуациях в моей жизни. <strong>Таким образом, борьба, что у меня на постоянной основе, это просто пробовать и быть лучше.</strong> </p>
<p>Есть определенная разница между публичным человеком и обычным человеком, это как сойти с ума - для меня во всяком случае - открыть себя целиком для всего мира.</p>
</div>
<div class="description-item">
<p class="description-item-left">Цена</p>
<div class="description-item-price">
<strong>< 50</strong>
<p>Сотрудников</p>
<p>от <strong>5000 <span>грн.</span></strong></p>
</div>
<div class="description-item-price">
<strong>50-100</strong>
<p>Сотрудников</p>
<p>от <strong>15000 <span>грн.</span></strong></p>
</div>
<div class="description-item-price">
<strong>> 100</strong>
<p>Сотрудников</p>
<p>от <strong>25000 <span>грн.</span></strong></p>
</div>
<a href="#" class="main-content-text-price">заказать</a>
</div>
</div>
</div>
<div class="services-price-item-ins services-price-item-second">
<h5 class="services-price-icon-4"><span>Разработка договоров</span> и другой документации<p class="info"></p></h5>
<p>К сожалению, конфликты бывают в любой сфере. Если дело близится к суду или уже дошло до него, мы поможем отстоять ваши права и интересы.</p>
<div class="description">
<div class="description-arrow"></div>
<div class="description-item">
<p class="description-item-left first">услуга</p>
<h5 class="services-price-icon-2"><span>Разработка договоров</span> и другой документации</h5>
<p>Борьба внутри меня, и я был в самых разных ситуациях в моей жизни. <strong>Таким образом, борьба, что у меня на постоянной основе, это просто пробовать и быть лучше.</strong> </p>
<p>Есть определенная разница между публичным человеком и обычным человеком, это как сойти с ума - для меня во всяком случае - открыть себя целиком для всего мира.</p>
</div>
<div class="description-item">
<p class="description-item-left">Цена</p>
<div class="description-item-price">
<strong>< 50</strong>
<p>Сотрудников</p>
<p>от <strong>5000 <span>грн.</span></strong></p>
</div>
<div class="description-item-price">
<strong>50-100</strong>
<p>Сотрудников</p>
<p>от <strong>15000 <span>грн.</span></strong></p>
</div>
<div class="description-item-price">
<strong>> 100</strong>
<p>Сотрудников</p>
<p>от <strong>25000 <span>грн.</span></strong></p>
</div>
<a href="#" class="main-content-text-price">заказать</a>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="reviews">
<div class="wrapper">
<h4 class="main-title">отзывы</h4>
<p class="title-desc">Мнение наших клиентов <strong>делает мир и нас лучше :)</strong></p>
<div class="reviews-content">
<a href="#" class="reviews-item">
<div class="reviews-item-subject"><p class="quote"></p></div>
<div class="reviews-item-recall">Главная тема для меня – любовь. Мы все хотим ее, но не знаем как получить, поэтому все, что мы делаем, — это всего лишь попытки найти счастье.</div>
<div class="reviews-item-destination">
<div class="destination-icon"><img src="../img/man-icon-1.jpg" alt=""></div>
<div class="destination-name"><NAME></div>
<div class="destination-company"><span>CEO</span> deco.agency</div>
</div>
</a>
<a href="#" class="reviews-item">
<div class="reviews-item-subject"><p class="quote"></p></div>
<div class="reviews-item-recall">Главная тема для меня – любовь. Мы все хотим ее, но не знаем как получить, поэтому все, что мы делаем, — это всего лишь попытки найти счастье.</div>
<div class="reviews-item-destination">
<div class="destination-icon"><img src="../img/man-icon-2.jpg" alt=""></div>
<div class="destination-name"><NAME></div>
<div class="destination-company"><span>CEO</span> deco.agency</div>
</div>
</a>
<a href="#" class="reviews-item">
<div class="reviews-item-subject"><p class="video"></p></div>
<div class="reviews-item-recall">
<div class="recall-img"><img src="../img/man-1.jpg" alt=""><div class="play"></div></div>
</div>
<div class="reviews-item-destination">
<!-- <div class="destination-icon"><img src="../img/man-icon-1.jpg" alt=""></div> -->
<div class="destination-name"><NAME></div>
<div class="destination-company"><span>CEO</span> deco.agency</div>
</div>
</a>
</div>
<a href="#" class="load-more"><span>загрузить еще</span></a>
</div>
</section>
<section class="services">
<div class="wrapper">
<h4 class="main-title">запрос на услуги</h4>
<div class="services-content">
<div class="services-item">
<input type="text" placeholder="Ростисл">
<input type="text" placeholder="Телефон*">
<input type="text" placeholder="E-mail*">
<input type="text" placeholder="сайт">
<select name="" id="" >
<option value="">МЕНЯ ИНТЕРЕСУЕТ</option>
<option value="">Наведение порядка в делах</option>
<option value="">Правовое сопровождение деятельности</option>
<option value="">Оптимизация договорных отношений</option>
<option value="">Разработка договоров</option>
</select>
</div>
<div class="services-item">
<label><p>Дополнительная информация</p><textarea name="" id="" cols="0" rows="0" placeholder="Введите текст ..."></textarea></label>
</div>
<input type="submit" value="отправить">
</div>
</div>
</section>
<footer id="footer">
<div class="wrapper">
<strong class="footer-pravo-agency">pravo agency:</strong>
<p class="footer-text">01001, Киев, ул.Костёльная 9, оф.8 <span>+380 (67) 324 10 10</span></p>
<a href="mailto:<EMAIL>" class="mail"><EMAIL></a>
<div class="socials">
<a href="#" class="facebook"></a>
<a href="#" class="twitter"></a>
<a href="#" class="linkedin"></a>
</div>
<p class="footer-copy">© 2015, <strong>Pravo agency</strong></p>
</div>
</footer>
</div>
<script type="text/javascript" src="../js/vendor.js"></script>
<script type="text/javascript" src="../js/main.js"></script>
</body>
</html>
|
5cebcf297fc80e6952fd826f986ff2ed4dcc5209
|
[
"JavaScript",
"HTML"
] | 2 |
JavaScript
|
kolialike/deco
|
2577ac4f57e0a9643c902a9f64dccc33b4ae2281
|
4be96e2b5fc91a7363422343347ad8c15ddeae72
|
refs/heads/master
|
<file_sep>//
// ViewController.swift
// Calculator
//
// Created by <NAME> on 5/29/19.
// Copyright © 2019 Lambda School. All rights reserved.
//
import UIKit
class calculatorBrain {
var operand1String = ""
var operand2String = ""
var operatorType: String?
init() {
self.operatorType = nil
}
func addOperandDigit(_ digit: String) -> String {
if operatorType == nil {
operand1String += digit
return(operand1String)
} else { operand2String += digit
return(operand2String)
}
}
func setOperator(_ operatorString: String) {
operatorType = operatorString
return
}
func calculateIfPossible() -> String? {
var solution: String = ""
print(operatorType ?? 0)
if operatorType == "+" { print("1"); solution = String( (Int(operand1String) ?? 0) + (Int(operand2String) ?? 0)) }
else if operatorType == "−" { print("2"); solution = String( (Int(operand1String) ?? 0) - (Int(operand2String) ?? 0)) }
else if operatorType == "÷" { print("3"); solution = String( (Int(operand1String) ?? 0) / (Int(operand2String) ?? 0)) }
else if operatorType == "×" { print("4"); solution = String( (Int(operand1String) ?? 0) * (Int(operand2String) ?? 0)) }
print(solution)
return(solution)
}
func clear () {
operand1String = ""
operand2String = ""
operatorType = ""
}
}
class CalculatorViewController: UIViewController {
var brain: calculatorBrain?
@IBOutlet weak var outputLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
brain = calculatorBrain()
print(brain?.operand1String ?? 0)
outputLabel.text = "0"
}
// MARK: - Action Handlers
@IBAction func operandTapped(_ sender: UIButton) {
outputLabel.text = brain?.addOperandDigit(sender.currentTitle ?? "0")
}
@IBAction func operatorTapped(_ sender: UIButton) {
outputLabel.text = "0"
brain?.setOperator(sender.currentTitle ?? "")
}
@IBAction func equalTapped(_ sender: UIButton) {
outputLabel.text = brain?.calculateIfPossible()
}
@IBAction func clearTapped(_ sender: UIButton) {
clearTransaction()
}
// MARK: - Private
private func clearTransaction() {
outputLabel.text = "0"
brain?.clear()
}
}
<file_sep>//
// CalculatorBrain.swift
// Calculator
//
// Created by <NAME> on 5/30/19.
// Copyright © 2019 Lambda School. All rights reserved.
//
import Foundation
|
8886970474df3f885ae6c263f349cd079bf2dd82
|
[
"Swift"
] | 2 |
Swift
|
oezguenY/ios-sprint-challenge-calculator
|
967d29a4a7fd1e9e1540a57d26960028d09f240c
|
9c51fb6626639494ed24c636fe38ee2b053489af
|
refs/heads/master
|
<file_sep>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Classifier;
import java.util.Enumeration;
import java.util.TreeMap;
import weka.classifiers.AbstractClassifier;
import weka.core.Attribute;
import weka.core.Instance;
import weka.core.Instances;
import weka.filters.Filter;
import weka.filters.supervised.attribute.Discretize;
import weka.filters.unsupervised.attribute.Normalize;
import weka.filters.unsupervised.attribute.Remove;
import weka.filters.unsupervised.instance.RemoveWithValues;
/**
*
* @author USER
*/
public class NaiveBayesClassifier extends AbstractClassifier {
/** The discretize removeFilter used to discretize the test data */
private Discretize discretizeFilter;
/** The normalize filter for the test data */
private Normalize normalFilter;
/** The training data used by the classifier */
private Instances trainingData;
/**
* The model of the classifier, is a Three-Dimentional Map of
* ClassAttributeDomainValue -> NonClassAttribute -> NonClassAttributeDomainValue -> Probability
*/
private final TreeMap<String,TreeMap<String,TreeMap<String,Float>>> ProbabilityMatrix = new TreeMap<>();
/**
* A map between a class attribute value and the probabilty of that value
*/
private final TreeMap<String,Float> ProbMatrixClass = new TreeMap<>();
/**
* Generates a classifier. Must initialize all fields of the classifier that
* are not being set via options (ie. multiple calls of buildClassifier must
* always lead to the same result). Must not change the dataset in any way.
*
* @param data set of instances serving as training data
* @exception Exception if the classifier has not been generated successfully
*/
@Override
public void buildClassifier(Instances data) throws Exception {
// Remove instance with missing class value
data.deleteWithMissingClass();
/** Remove unwanted class attr */
// Remove remove = new Remove();
// remove.setAttributeIndices("28");
// remove.setInputFormat(data);
// Instances tempData = Filter.useFilter(data, remove);
// Discretize all the data attribute
discretizeFilter = new Discretize();
discretizeFilter.setAttributeIndices("first-last");
discretizeFilter.setBinRangePrecision(6);
discretizeFilter.setInputFormat(data);
trainingData = Filter.useFilter(data, discretizeFilter);
RemoveWithValues removeFilter = new RemoveWithValues();
removeFilter.setInvertSelection(true);
// For each of the class attributes domain value in the instances,
Attribute classAttribute = trainingData.classAttribute();
Enumeration<Object> enumerateDomainValues = classAttribute.enumerateValues();
while(enumerateDomainValues.hasMoreElements()) {
// Prepare a sub-tree to contain each of the class attribute value
String classValueString = enumerateDomainValues.nextElement().toString();
ProbabilityMatrix.put(classValueString, new TreeMap<>());
// Get a sub-data where the class-value is classValueString
removeFilter.setAttributeIndex("" + (trainingData.classIndex()+1));
removeFilter.setNominalIndices("" + (classAttribute.indexOfValue(classValueString)+1));
removeFilter.setInputFormat(trainingData);
Instances subDataClassValue = Filter.useFilter(trainingData, removeFilter);
// Insert the probability of this class values
float prob2 = (float)subDataClassValue.size() / trainingData.size();
ProbMatrixClass.put(classValueString, prob2);
// For each of the attributes in the instances,
Enumeration<Attribute> enumerateAttributes = trainingData.enumerateAttributes();
while(enumerateAttributes.hasMoreElements()) {
// Prepare a sub-tree to contain each of this attributes domain value tree
Attribute currAttributes = enumerateAttributes.nextElement();
ProbabilityMatrix.get(classValueString).put(currAttributes.name(), new TreeMap<>());
// For each of this attributes possible domain value
Enumeration<Object> enumerateValues = currAttributes.enumerateValues();
while(enumerateValues.hasMoreElements()) {
// Insert the probability of this attributes values at the current class att values
String currAttDomain = enumerateValues.nextElement().toString();
// Get a sub-data where the currAttributes value is currAttDomain
removeFilter.setAttributeIndex("" + (currAttributes.index()+1) );
removeFilter.setNominalIndices("" + (currAttributes.indexOfValue(currAttDomain)+1) );
removeFilter.setInputFormat(subDataClassValue);
Instances subDataAttValues = Filter.useFilter(subDataClassValue, removeFilter);
float prob = (float)subDataAttValues.size() / subDataClassValue.size();
ProbabilityMatrix.get(classValueString).get(currAttributes.name()).put(currAttDomain, prob);
}
}
}
}
/**
* Return the partial probability of the attributeName value to be
* attribute value if the class attribute value is classDomainValue
*/
private float getPartialProbability(String classDomainValue, String attributeName, String attributeValue) {
return ProbabilityMatrix.get(classDomainValue).get(attributeName).get(attributeValue);
}
/**
* Predicts the class memberships for a given instance. If an instance is
* unclassified, the returned array elements must be all zero. If the class
* is numeric, the array must consist of only one element, which contains
* the predicted value. Note that a classifier MUST implement either this
* or classifyInstance().
*
* @param instance the instance to be classified
*
* @return an array containing the estimated membership probabilities of the
* test instance in each class or the numeric prediction
*
* @exception Exception if distribution could not be computed successfully
*/
@Override
public double[] distributionForInstance(Instance instance) throws Exception {
// Preprocess the instance (discretize using the same filter)
Instances Result = new Instances(trainingData,0);
Result.setClassIndex(trainingData.classIndex());
Result.add(instance);
Result = Filter.useFilter(Result, discretizeFilter);
// Initialize the result array by assigning the probability of each class value
double[] prob = new double[Result.classAttribute().numValues()];
for(int i=0; i<Result.classAttribute().numValues(); i++) {
prob[i] = ProbMatrixClass.get(Result.classAttribute().value(i));
}
// For all the Non-Class attribute in the instance,
Enumeration<Attribute> enumerateAttributes = Result.enumerateAttributes();
while(enumerateAttributes.hasMoreElements()) {
// For all the possible class domain value,
Attribute currAtt = enumerateAttributes.nextElement();
for(int i=0; i<Result.classAttribute().numValues(); i++) {
String classValue = Result.classAttribute().value(i);
String attName = currAtt.name();
String attValue = currAtt.value((int) Result.firstInstance().value(currAtt));
prob[i] *= getPartialProbability(classValue, attName, attValue);
}
}
return prob;
}
}<file_sep>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Classifier.Tree;
import java.util.ArrayList;
import java.util.Enumeration;
import weka.classifiers.AbstractClassifier;
import weka.core.Attribute;
import weka.core.Instance;
import weka.core.Instances;
/**
*
* @author USER
*/
public class ID3Classifier extends AbstractClassifier {
/** The training data used by the classifier */
protected Instances trainingData;
/** The root node of the classifier tree */
protected ID3DecisionTree root;
@Override
public void buildClassifier(Instances data) throws Exception {
// Remove instance with missing class value
data.deleteWithMissingClass();
if(data.classAttribute().isNumeric()) {
throw new Exception("Numeric Class attributes not supported");
}
Enumeration<Attribute> attributes = data.enumerateAttributes();
while(attributes.hasMoreElements()) {
if(attributes.nextElement().isNumeric()) {
throw new Exception("Numeric attributes not supported");
}
}
trainingData = data;
root = new ID3DecisionTree(null, trainingData);
setupTree(root);
System.out.println(root);
}
/**
* Recursive method that will select the best attribute to split the data at
* the given node, and call itself for each of the generated child node
* @param node The node to be build
* @throws Exception
*/
protected void setupTree(ID3DecisionTree node) throws Exception {
Instances data = node.getNodeData();
if(!data.isEmpty()) {
int bestAttributeID = -1;
double bestInformationGain = 0;
// Find the best attribute to be used at this node
for(int i=0; i<data.numAttributes(); i++) {
if(i != data.classIndex()) {
double currentInformationGain = countNominalInformationGain(data, i);
if(currentInformationGain > bestInformationGain) {
bestInformationGain = currentInformationGain;
bestAttributeID = i;
}
}
}
// If there is an attribute that can be used to further classify the
// data, set it as this node splitter and setup each of its child
if(bestAttributeID != -1) {
node.SetNominalSplitter(bestAttributeID);
ArrayList<ID3DecisionTree> subTrees = node.getSubTrees();
for(int i=0; i<subTrees.size(); i++) {
setupTree(subTrees.get(i));
}
}
}
}
/**
* Count the nominal information gain for the given attributes
* @throws Exception
*/
private double countNominalInformationGain(Instances nodeData, int attID) throws Exception {
Instances data = new Instances(nodeData);
Attribute att = data.attribute(attID);
Attribute classAtt = data.classAttribute();
// The number of instances with [index] class value
int[] classCount = new int[classAtt.numValues()];
// The number of instances with [index-i] class value and [index-j] att value
int[][] attClassCount = new int[classAtt.numValues()][att.numValues()];
// The number of instances with [index] att value
int[] attCount = new int[att.numValues()];
// Count the data distributions
Enumeration<Instance> instances = data.enumerateInstances();
while(instances.hasMoreElements()) {
Instance instance = instances.nextElement();
classCount[(int)instance.classValue()] += 1;
if(instance.isMissing(att)) {
throw new Exception("Missing value is not supported");
}
attClassCount[(int)instance.classValue()][(int)instance.value(attID)] += 1;
attCount[(int)instance.value(attID)] += 1;
}
// Calculate the class Attribute entropy
double result = 0;
for(int i=0; i<classCount.length; i++) {
double prob = (double)classCount[i] / (double)data.size();
if(prob > 0) {
result -= prob * (Math.log10(prob) / Math.log10(2));
}
}
// Substract the class entropy with each partial entropy of att
for(int i=0; i<attCount.length; i++) {
for (int[] attClassCount1 : attClassCount) {
double temp = 0;
double prob = (double) attClassCount1[i] / (double)attCount[i];
if(prob > 0) {
temp -= prob * (Math.log10(prob) / Math.log10(2));
}
result -= ((double)attCount[i] / (double)data.size()) * temp;
}
}
return result;
}
@Override
public double[] distributionForInstance(Instance instance) throws Exception {
if(!instance.equalHeaders(trainingData.firstInstance())) {
throw new Exception("Instance header is not equal to training data");
}
ID3DecisionTree currTree = root;
while(true) {
if(currTree.isLeaf) {
double[] classDistribution = currTree.getClassDistribution();
return classDistribution;
} else {
double[] subTreeDist = currTree.getSubTreeDistribution(instance);
double max = 0;
int maxID = -1;
for(int i=0; i<subTreeDist.length; i++) {
if(subTreeDist[i] > max) {
maxID = i;
max = subTreeDist[i];
}
}
if(maxID != -1) {
currTree = currTree.getSubTrees().get(maxID);
} else {
double[] classDistribution = currTree.getClassDistribution();
return classDistribution;
}
}
}
}
}
<file_sep>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Classifier;
import java.io.Serializable;
import static java.lang.Double.NaN;
import java.util.Random;
import java.util.Vector;
/** A single perceptron container/helper class */
class Perceptron implements Serializable {
/**
* The value and weight of all of this perceptron input
* w0 is in index 0 and always had the value of 1
*/
private final Vector<Double> InputValue = new Vector<>();
private final Vector<Double> InputWeight = new Vector<>();
static Random rand = new Random(System.currentTimeMillis());
/** Intiate the perceptron, add x0 with value 1 and a random weight */
public Perceptron() {
InputValue.add(1.0);
InputWeight.add(rand.nextDouble()-0.5);
}
/** Add another input with a random weight, return the new input weight */
public int addInput(double value) {
InputValue.add(value);
InputWeight.add(rand.nextDouble()-0.5);
return InputValue.size()-1;
}
/** Set the value of this input to the paramater's */
public void setValue(int index, double value) {
InputValue.set(index, value);
}
/** Return the sum of all input's value times weight */
public double getRawOutput() {
double res = 0;
for(int i=0; i<InputValue.size(); i++) {
res+= InputValue.get(i) * InputWeight.get(i);
}
return res;
}
/** Return the output with a sigmoid activation function */
public double getOutput() {
return 1/(1+Math.exp(-(getRawOutput())));
}
public double getWeight(int index) {
return InputWeight.get(index);
}
/** Improve each of the InputWeight entry according to the totError value */
public void learn(double rate, double error) {
for(int i=0; i<InputWeight.size(); i++) {
double newWeight = InputWeight.get(i) + rate*error*InputValue.get(i);
InputWeight.set(i, newWeight);
}
}
}
|
c9067c90b1273b1c1f26c92e6a4e82a1d5e97195
|
[
"Java"
] | 3 |
Java
|
FairuzAP/WekAI
|
4bd9e9bed44021e7894e1c888fb7d672a3fa89ce
|
cd20f3a44b08b0ca48aef1649cfee54fbbd562a2
|
refs/heads/master
|
<repo_name>sheshang/Feedback-Vertex-Set<file_sep>/run.sh
#!/bin/bash
base=$(cd $(dirname $0); pwd)
#for single testcase
#java -Xss256M -XX:+UseSerialGC -cp "$base/bin" Main "$@"
#for unit of testcases
TESTCASESdir="testcases/"
if [ "$(ls -A $TESTCASESdir)" ]; then
TESTCASESdir="$TESTCASESdir*"
for f in $TESTCASESdir
do
java -Xss256M -XX:+UseSerialGC -cp "$base/bin" fvs_bf.FVS_BF "$f"
done
else
echo "no testcases in 'testcases' directory."
fi
<file_sep>/README.txt
#FVS_BF
This implementation of Feedback vertex Set problem with Brute force approach is to understand the improvement done by parameterized version (https://github.com/feldsherov/pace2016/) implemented by <NAME> (Moscow State University) in the PACE2016 challange (https://pacechallenge.wordpress.com/pace-2016/track-b-feedback-vertex-set/).
#Input:
list of edges
#Output:
list of vertices in minimum feedback vertex set
#Algorithm:
Store all the edges in edgestore
For each combination of vertex-set (in increasing order of size):
reduce the graph by removing all edges adjecent to the selected combination subset
check acyclicity of that reduced graph with help of union-find algorithm
if reduced graph is acyclic
the current combination of vertex set is the minimum vertex set.
return that subset and terminate program
#Running Time:
Let say input has E edges and V vertices,
Graph reading takes O(E) time.
For subset creation O(2^N) time. O(V^k) is time for k-sub algorithm and V is for all possibility of length of set
In isAcyclic() function:
copy making of edgelist takes O(E) time
cyclicity checking takes O(E*log(V)) time. (for each edge in edgelist copy, verify by union find algorithm)
So total time complexity will be O(2^N*E*log(V))
Here we used union-find algorithm by path compression and by rank, so it gives the better time then original O(V) time logic.
#put your all testcases in 'testcases' folder with '*.graph' format.
#give permission to buil.sh and run.sh on your computer by following command.
chmod +x build.sh
chmod +x run.sh
#now build program with,
./build.sh
#to run you have two options
if you want to run only sigle testcase, comment second script block in run.sh as shown there, and on terminal type,
./run.sh filename.graph
if you want to run multiple testcases automatically, comment first option there, uncomment second script block and on terminal type,
./run.sh
To execute ipynb files you need two output files. One will be created with running this code and another one you have to generate with the implementation you want to compare with.
Testcases has been generated by me and some testcases taken from the PACE2016 site.
<file_sep>/build.sh
#!/bin/bash
rm -rf bin
mkdir bin
javac -sourcepath src -d bin **/*.java
|
036adfd6dea61ac8643c0b53de19fc407bc83d37
|
[
"Text",
"Shell"
] | 3 |
Shell
|
sheshang/Feedback-Vertex-Set
|
f81f0c6cb1fedced21c920a8914fb67a564f3ab3
|
8b2d58ecde883c1b64d24d9cf36636493ecdac25
|
refs/heads/main
|
<repo_name>OscarRuina/TP-pruebas-de-software-2020<file_sep>/Ruina/TestUnidadHelipuerto.java
package Ruina;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import avion.AvionSimple;
import avion.Helicoptero;
import pista.Helipuerto;
import copControl.Posicion;
public class TestUnidadHelipuerto {
int i,j;
Posicion posicionEntrada;
Helipuerto helipuerto;
Helicoptero helicoptero;
AvionSimple avionSimple;
@Before
public void setUp() throws Exception {
i = 10;
j = 15;
posicionEntrada = new Posicion(i,j);
helipuerto = new Helipuerto(posicionEntrada);
}
//4
@Test
public void testPuedeAterrizarHelicoptero() {
assertTrue("Fallo el metodo puedeAterrizar(Helicoptero helicoptero)"
, helipuerto.puedeAterrizar(helicoptero));
}
//5
@Test
public void testPuedeAterrizarAvionSimple(){
assertFalse("Fallo el metodo puedeAterrizar(AvionSimple avionSimple)"
, helipuerto.puedeAterrizar(avionSimple));
}
}
<file_sep>/README.md
# TP-pruebas-de-software-2020<file_sep>/Ruina/TestIntegracionPistaDoble.java
package Ruina;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import avion.AvionSimple;
import copControl.Mapa;
import copControl.Posicion;
import pista.PistaDoble;
public class TestIntegracionPistaDoble {
private PistaDoble pistaDoble;
private Posicion posicionEntrada;
private Posicion posicionInicialAvion;
private Posicion posicionFinalAvion;
private Mapa mapaDeMovimiento;
private AvionSimple avionSimple;
@Before
public void setUp() throws Exception {
posicionEntrada = new Posicion(1,0);
pistaDoble = new PistaDoble(posicionEntrada);
posicionInicialAvion = new Posicion(2,0);
posicionFinalAvion = new Posicion(2,2);
mapaDeMovimiento = new Mapa();
avionSimple = new AvionSimple(posicionInicialAvion,posicionFinalAvion,mapaDeMovimiento);
}
//6
@Test
public void testEstaEnZonaDeAterrizaje() {
assertTrue("Fallo el metodo estaEnZonadeAterrizaje",pistaDoble.estaEnZonaAterrizaje(avionSimple));
}
//7
@Test
public void testPuedeAterrizarAvionSimple(){
assertTrue("Fallo el metodo puedeAterrizar",pistaDoble.puedeAterrizar(avionSimple));
}
}
<file_sep>/Ruina/TestIntegracionNivel.java
package Ruina;
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import pista.Pista;
import pista.PistaSimple;
import avion.AvionComputarizado;
import avion.AvionSimple;
import copControl.Dificultad;
import copControl.Mapa;
import copControl.Nivel;
import copControl.Posicion;
public class TestIntegracionNivel {
private Nivel nivel;
private Mapa mapa;
private Dificultad dificultad;
private Posicion posicion;
private Posicion posicion2;
private AvionSimple avion;
private AvionComputarizado avion2;
private List<Pista> pistas = new ArrayList<Pista>();
private PistaSimple pista;
@Before
public void setUp() throws Exception {
mapa = new Mapa();
dificultad = new Dificultad(10,15,5);
nivel = new Nivel(mapa,dificultad);
posicion = new Posicion(5,7);
posicion2 = new Posicion(8,6);
avion = new AvionSimple(posicion,posicion2,mapa);
avion2 = new AvionComputarizado(posicion,mapa);
pista = new PistaSimple(new Posicion(10,15));
pistas.add(pista);
mapa.setPistas(pistas);
nivel.colocarAvionEnAire(avion);
nivel.colocarAvionEnAire(avion2);
}
//8
@Test
public void testAterrizarAviones() {
assertTrue("Fallo el metodo atterizarAviones",nivel.aterrizarAviones() == 2);
}
//9
@Test
public void testTienePistaAdecuada(){
assertTrue("Fallo el metodo tienePistaAdecuada",nivel.tienePistaAdecuada(avion));
}
//10
@Test
public void testTieneAvionesVolando(){
assertTrue("Fallo el metodo tieneAvionesVolando",nivel.tieneAvionesVolando());
}
}
|
fd55f345257b91e76dbe051d8126e2bb065c361c
|
[
"Markdown",
"Java"
] | 4 |
Java
|
OscarRuina/TP-pruebas-de-software-2020
|
fe5368b963337d6ec5f1596990a5d20286fbf109
|
9634bcfb690f10ea666b4580fb6b3caf128075d7
|
refs/heads/master
|
<file_sep>def pesquisa_binaria(lista, item):
# baixo e alto acompanham a parte da lista que você está procurando.
baixo = 0
alto = len(lista) -1
# enquanto ainda não conseguiu chegar a um único elemento...
while baixo <= alto:
#... verifica o elemento central.
meio = (baixo + alto)//2
chute = lista[meio]
# acha o item
if chute == item:
return meio
# o chute foi muito alto
if chute > item:
alto = meio -1
# o chute foi muito baixo
else:
baixo = meio + 1
# o item não existe
return None
# vamos testar o algoritmo
minha_lista = [1, 3, 5, 7, 9]
# lembre-se, as listas começam com 0. O elemento 7 está no indice 3.
print (pesquisa_binaria(minha_lista, 7)) # => 1
# "None" significa nulo em Python. Ele indica que o item não foi encontrado.
print (pesquisa_binaria(minha_lista, -1)) # => None<file_sep>
nomes = ["Adriano", "Adrian", "Adão", "Adam", "Ana", "Ann", "Anne", "Anna", "Antônio", "Anthony",
"Beatriz", "Beatrice", "Brigite","Bridget", "Carlos", "Charles", "Davi", "David", "Eduardo", "Edward",
"Estêvão", "Steve", "Eva", "Eve", "Guilherme", "William", "Jorge", "George", "José", "Joseph", "João",
"John", "Leonardo", "Leonard", "Luiz", "Luis", "Louis", "Marcos", "Marc", "Mark", "Maria", "Mary",
"Mateus", "Matthew", "Miguel", "Michael", "Nicolau", "Nicholas", "Noé", "Noah", "Paulo", "Paul", "Pedro",
"Peter", "Raimundo", "Raymond", "Raquel", "Rachel", "Ricardo", "Richard", "Rick", "Roberto", "Robert",
"Rosa", "Rose", "Sara", "Sarah", "Suzana", "Susan", "Tiago", "James", "Tomás", "Thomas"]
def pesquisa_binaria(lista, item):
# baixo e alto acompanham a parte da lista que você está procurando.
baixo = 0
alto = len(lista) -1
# enquanto ainda não conseguiu chegar a um único elemento...
while baixo <= alto:
#... verifica o elemento central.
meio = (baixo + alto)//2
chute = lista[meio]
# acha o item
if chute == item:
return meio
# o chute foi muito alto
if chute > item:
alto = meio -1
# o chute foi muito baixo
else:
baixo = meio + 1
# o item não existe
return None
#print (pesquisa_binaria(nomes, "Luis"))
token = 0
for word in nomes:
print (token + 1, word)
token += 1
print (len(nomes))
|
e76d07019a201a764230c44b4fa56b37ce91be73
|
[
"Python"
] | 2 |
Python
|
DavisonFNX/Python
|
908bd088f0c10885466153be8d474ce998940b21
|
a42815417a301ffa97fe77c8a61cf68763ccde1e
|
refs/heads/master
|
<repo_name>realconnexions/demo<file_sep>/README.md
# demo
ar-vr medical pletform to connect medical experts to African healthcare providers
<file_sep>/Assets/Hand.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Controller))]
public class Hand : MonoBehaviour
{
GameObject heldObject;
Controller controller;
Rigidbody simulator;
void Start()
{
simulator = new GameObject().AddComponent<Rigidbody>();
simulator.name = "simulator";
simulator.transform.parent = transform.parent;
controller = GetComponent<Controller>();
}
void Update()
{
if (heldObject)
{
simulator.velocity = (transform.position - simulator.position) * 50f;
if (controller.controller.GetPressUp(Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger))
{
heldObject.transform.parent = null;
heldObject.GetComponent<Rigidbody>().isKinematic = false;
heldObject.GetComponent<Rigidbody>().velocity = simulator.velocity;
heldObject.GetComponent<HeldObject>().parent = null;
heldObject = null;
}
}
else
{
if (controller.controller.GetPressDown(Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger))
{
Collider[] cols = Physics.OverlapSphere(transform.position, 0.1f);
foreach (Collider col in cols)
{
if (heldObject == null && col.GetComponent<HeldObject>() && col.GetComponent<HeldObject>().parent == null)
{
heldObject = col.gameObject;
heldObject.transform.parent = transform;
heldObject.transform.localPosition = Vector3.zero;
heldObject.transform.localRotation = Quaternion.identity;
heldObject.GetComponent<Rigidbody>().isKinematic = true;
heldObject.GetComponent<HeldObject>().parent = controller;
}
}
}
}
}
}
<file_sep>/Dammy/Assets/PickUp.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PickUp : MonoBehaviour {
SteamVR_Controller.Device device;
SteamVR_TrackedObject trackedObj;
// Use this for initialization
void Start ()
{
trackedObj = GetComponent<SteamVR_TrackedObject> ();
}
// Update is called once per frame
void Update ()
{
device = SteamVR_Controller.Input ((int)trackedObj.index);
}
void OnTriggerStay (Collider other)
{
Debug.Log ("Entered a collider");
Debug.Log (other.gameObject.tag + " " + other.gameObject.name);
if (other.gameObject.CompareTag ("Pickable"))
{
Debug.Log ("Picking Obj");
if (device.GetPressUp (SteamVR_Controller.ButtonMask.Trigger))
{
DropIt (other);
}
else if (device.GetPressDown (SteamVR_Controller.ButtonMask.Trigger))
{
GrabIt (other);
}
}
}
void GrabIt (Collider grab)
{
grab.transform.SetParent (gameObject.transform);
grab.gameObject.GetComponent<Rigidbody> ().isKinematic = true;
device.TriggerHapticPulse (2000);
}
void DropIt (Collider grab)
{
grab.transform.SetParent (null);
Rigidbody rb = grab.GetComponent<Rigidbody> ();
rb.isKinematic = false;
rb.velocity = device.velocity;
rb.angularVelocity = device.angularVelocity;
}
}
|
874bafb6ba1b1e0971dcc70ac5ab995dbf97053a
|
[
"Markdown",
"C#"
] | 3 |
Markdown
|
realconnexions/demo
|
357d0d99d6c3d678284bc233c5213cd3fa143e96
|
8b429ce0b2de0eb23de084d096919d48caff1370
|
refs/heads/master
|
<file_sep>#!/bin/bash
rsync -avr ~/bin/ ~/backups
<file_sep>#!/bin/bash
cat <<EOF
Hello World!
EOF
<file_sep>#!/bin/bash
wget -qO - icanhazip.com
<file_sep># scripting
Scripting files for school.
<file_sep>#!/bin/bash
. ~/bin/helloworld.sh
<file_sep>#!/bin/bash
echo "SetUID files"
echo "------------"
find /usr -type f -executable -perm -4000 -ls
cat <<EOF
SetGID Files
------------
EOF
find /usr -type f -executable -perm -2000 -ls
|
7213e2e5dfe86e3445fbc7b254b14a3fa3d3b87e
|
[
"Markdown",
"Shell"
] | 6 |
Shell
|
lukesheardown/school
|
4423465797368f0ea28ef66055a0f0f693e2c608
|
66681f19049a1e2b41ff6fbfaab2d1e0281903bf
|
refs/heads/master
|
<file_sep>import { Component, Output, EventEmitter } from '@angular/core';
import { Note } from '../note';
import { NoteService } from '../note.service';
@Component({
selector: 'app-note-new',
templateUrl: './note-new.component.html',
styleUrls: ['./note-new.component.css']
})
export class NoteNewComponent {
note = new Note();
@Output() newNote = new EventEmitter();
constructor(private _noteApi: NoteService) { }
onClick() {
this._noteApi.addNote(this.note)
.then(note => {
console.log('added new note to db');
this.newNote.emit();
})
.catch();
this.note = new Note();
}
}
<file_sep>import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs';
@Injectable()
export class NoteService {
constructor(private _http: Http) { }
getNotes() {
console.log('getting all notes');
return this._http.get('/api/notes')
.map(response => response.json())
.toPromise();
}
addNote(note) {
return this._http.post('/api/notes', note)
.map(response => response.json())
.toPromise();
}
}
<file_sep>const express = require('express');
const path = require('path');
const parser = require('body-parser');
const port = process.env.PORT || 8000;
const app = express();
app.use(parser.urlencoded({extended: true}));
app.use(parser.json());
app.use(express.static(path.join(__dirname, './public/dist')));
require('./server/config/database');
app.use('/api/notes', require('./server/config/routes/note.routes'));
app.use(require('./server/config/routes/catch-all.routes'));
app.listen(port, console.log(`listening on ${port}`));<file_sep>const Note = require('mongoose').model('Note')
module.exports = {
index(request, response) {
console.log('retrieving notes');
Note.find({})
.then(function (notes){
console.log(notes);
response.json(notes);
})
.catch(function (errors){
console.log(errors);
})
},
create(request, response) {
const note = new Note(request.body);
console.log(`created new note: ${note}`);
note.save()
.then(function (note){
console.log(`saved ${note}`);
response.json(note);
})
.catch(function (errors){
console.log(errors)
})
},
}<file_sep>export class Note {
body: string;
}
|
aa8d5ad7646c940fbca90a8c5883b8bf9b731aa8
|
[
"JavaScript",
"TypeScript"
] | 5 |
TypeScript
|
pazzaInter/testing_deploy
|
260c8d1326d9eac86c34a3d1bf3cdec8e317d7a5
|
2b8e468a53393bd660812e3ce8f2804fe5ac24c5
|
refs/heads/master
|
<file_sep># imdb_multi_trainer
## prepare data
```shell
wget https://fleet.bj.bcebos.com/text_classification_data.tar.gz
tar -zxvf text_classification_data.tar.gz
```
## build
```shell
mkdir build
cd build
rm -rf *
PADDLE_LIB=path/to/your/fluid_inference_install_dir/
cmake .. -DPADDLE_LIB=$PADDLE_LIB -DWITH_MKLDNN=OFF -DWITH_MKL=OFF
make
```
## generate program description
```shell
python generate_program.py bow
```
## run
```shell
bash run.sh
```
<file_sep>
set -exu
build/multi_trainer --flagfile="train.cfg"
|
8fb3adeb8e8dcf69c289590ed827313368255920
|
[
"Markdown",
"Shell"
] | 2 |
Markdown
|
qjing666/imdb_multi_trainer
|
c7ac12829d00338df4424a95b7e2208166e0f3f6
|
99ed65564076c4eeede13fe4668f4a0a2bbb8599
|
refs/heads/i-can
|
<repo_name>Lanseria/iep-ui<file_sep>/src/api/fams/group_reward.js
import request from '@/router/axios'
const prefixUrl = '/fams/total/group_reward'
// @/api/fams/group_reward
//组织
export function getGroupRewardPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
//用户
export function getGroupRewardUserPage (query) {
return request({
url: `${prefixUrl}/user/page`,
method: 'get',
params: query,
})
}
export function postGroupReward (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function postGroupRewardUser (obj) {
return request({
url: `${prefixUrl}_user/create`,
method: 'post',
data: obj,
})
}
<file_sep>/src/views/exam/reviewCenter/certificateLibrary/options.js
const initForm = () => {
return {
id: '',
//subject:'',
field: '',
title: '',
//levelName:'',
level: '',
deptId: '',
iconurl: '',
imgurl: '',
}
}
const initSearchForm = () => {
return {
title: null,
}
}
export { initForm, initSearchForm }<file_sep>/src/api/conm/article_controller.js
import request from '@/router/axios'
const prefixUrl = '/cms/info_article'
// @/api/conm/index
//文章管理控制器
export function getPageById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function getPageByIndexId (id) {
return request({
url: `${prefixUrl}/index/${id}`,
method: 'get',
})
}
//文章迁移
export function postTransferNode (obj) {
return request({
url: `${prefixUrl}/transfer_node`,
method: 'post',
data: obj,
})
}
//添加文章
export function addObj (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
//文章分页
export function getPage (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
//删除
export function logicDeleteNodeById (id) {
return request({
url: `${prefixUrl}/logic_delete/${id}`,
method: 'post',
})
}
export function updateObj (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
// 前台分页查询文章
export function getIndexPage (params) {
return request({
url: `${prefixUrl}/index_page`,
method: 'get',
params: params,
})
}
// 前台查询推荐文章
export function getListBySiteId (params) {
return request({
url: `${prefixUrl}/${params.siteId}/list`,
method: 'get',
params: params,
})
}
//推荐位选择
// export function getInfoAttributePage (siteId) {
// return request({
// url: `${prefixUrl}/${siteId}/list`,
// method: 'get',
// })
// }
<file_sep>/src/views/wenjuan/config/errorCode.js
/*
* Copyright (c) 2018-2025, Wilson All rights reserved.
*
* Author: Wilson
*/
export default {
'400': '当前请求无效',
'401': '当前操作没有权限',
'403': '当前操作没有权限,或者Token已过期,请重新登陆',
'404': '网络错误,找不到接口,检查网络后刷新重试',
'426': '用户名不存在或密码错误',
'428': '验证码错误,请重新输入',
'429': '请求过频繁',
'479': '演示环境,没有权限操作',
'504': '中间层代理中断,请刷新页面重试',
'default': '系统未知错误,请反馈给管理员',
}
<file_sep>/src/views/crms/Customer/options.js
import { mergeByFirst } from '@/util/util'
const initForm = () => {
return {
clientId: '',
clientName: '', //客户名称
clientTypeKey: [], //客户类型
districtType: '', // 区域类型
businessTypeKey: [], // 业务类型
specificBusinessType: '', //具体业务类型
clientRela: '', //客户关系
followUpStatus: '', // 跟进状态
marketManager: '', // 市场经理
Manager: '',
lastTime: '', // 距离上次拜访已有(全部客户没有但依然存着)
iepClientRespDept: {
id: '',
name: '',
}, //负责部门
companyUrl: '', //单位网址
companyFunction: '', //单位职能
contractAddress: '', //单位地址
otherDesc: '', //其他说明
tags: [],
collaborations: [],
assertionsSave: 1,
orgNameForOld: '',//原机构名
clientAbrName: '',//客户简称
toClaim: 0,
unionId: '',
isOpen: 3, //开放范围
}
}
// 全部客户搜索
const allSearchForm = () => {
return {
type: '',
clientName: '',
districtType: '',
clientRela: '',
followUpStatus: '',
businessTypeKey: [],
marketManager: '',
// respDept: {
// id: '',
// name: '',
// },
}
}
// 我的客户/协作客户搜索
const initSearchForm = () => {
return {
type: '',
clientName: '',
districtType: '',
clientRela: '',
followUpStatus: '',
businessTypeKeyString: '',
timeSerach: '',
isContract: '',
}
}
const formToDto = form => {
const newForm = mergeByFirst(initSearchForm(), form)
return newForm
}
export { initSearchForm, allSearchForm, initForm, formToDto }
<file_sep>/src/views/tms/TagList/option.js
function initAddTagForm () {
return {
name: null,
levelId: null,
typeId: null,
typeObjs: [],
typeIds: [],
tagList: [],
tagsList: [],
description: null,
orderNum: 1,
}
}
function initEditTagForm () {
return {
name: null,
levelId: null,
typeId: null,
typeObjs: [],
typeIds: [],
tagList: [],
tagsList: [],
description: null,
orderNum: 1,
}
}
function initFormInline () {
return {
name: null,
typeid: null,
levelid: null,
status: null,
}
}
function initMergeForm () {
return {
mainId: null,
mergeIds: [],
}
}
function initTagFunction () {
return {
'tagReview': null, 'tagNotes': null, 'tagRelation': null,
}
}
const dictMap = {
status:{
0:'废除',
1:'启用',
},
isFree:{
0:'游离词',
1:'中心词',
2:'卫星词',
},
}
const columnsMap = [
{
prop: 'tagId',
label: 'ID',
width: '55',
},
{
prop: 'name',
label: '标签名称',
width: '120',
},
]
export const rules = [
]
export const initForm = [
]
export const initSearchForm = () => {
return {
name: null,
isFree: null,
typeId: null,
levelId: null,
status: null,
}
}
export { dictMap,columnsMap,initAddTagForm,initEditTagForm,initFormInline,initMergeForm,initTagFunction }<file_sep>/src/api/exam/examLibrary/examPaper/examPaper.js
/**
* 新增考卷管理API请求接口
*/
import request from '@/router/axios'
/**
* 获取考卷管理列表页
* @param {Object} params 参数
*/
export function getExamPaperList (params) {
return request({
url: 'exms/iepexaminationmanagement/page',
method: 'get',
params: params,
})
}
/**
* 收卷
*/
export function RollingTestById (params) {
return request({
url: 'exms/iepexaminationmanagement/changeStat',
method: 'post',
data: params,
})
}
/**
* 设为可考
*/
export function setTestById (params) {
return request({
url: 'exms/iepexaminationmanagement/changeNoState',
method: 'post',
data: params,
})
}
/**
* 删除
*/
export function deleteById (params) {
return request({
url: 'exms/iepexaminationmanagement/removeById',
method: 'post',
data: params,
})
}<file_sep>/src/views/fams/wealth/BillingNotice/options.js
// import { mergeByFirst } from '@/util/util'
const dictsMap = {
status: {
0: '待提交',
1: '待确认',
2: '已确认',
3: '驳回',
},
invoicingType: {
1: '增值税专用发票',
2: '增值税普通发票',
3: '其他',
},
}
const columnsMap = [
{
prop: 'buyerName',
label: '购买方',
},
{
prop: 'companyName',
label: '销售方',
},
{
prop: 'amount',
label: '开票金额',
width: '80',
},
{
prop: 'createTime',
label: '申请日期',
},
{
prop: 'status',
label: '状态',
type: 'dict',
width: '80',
},
{
prop: 'auditorName',
label: '核准人',
width: '80',
},
{
prop: 'auditingTime',
label: '核准日期',
},
]
const initForm = () => {
return {
id: 0, //开票id
buyerName: '', //购买方名称
buyerNumber: '', //纳税人识别号
buyerAddress: '', //地址
buyerPhone: '', //电话号码
buyerAccount: '',//开户行及账户
buyerMail: '',//发票邮寄地址
firstSubject: '',//一级科目 字典fams_tax_subject
secondSubject: '',//二级科目
rate: '',//税率
unit: '',//单位
amount: '', //开票金额
invoicingType: 1,//开票种类
projectId: '',//关联项目
projectName: '',//关联项目
orgId: '', //销售方组织ID
companyId: '', //销售方公司ID
remarks: '',//备注
status: '',//状态
content: '',//理由
}
}
const rules = {
buyerName: [
{ required: true, message: '请输入名称', trigger: 'blur' },
],
buyerNumber: [
{ required: true, message: '请输入纳税人号', trigger: 'blur' },
],
buyerAddress: [
{ required: true, message: '请输入地址', trigger: 'blur' },
],
buyerPhone: [
{ required: true, message: '请输入电话号码', trigger: 'blur' },
],
buyerAccount: [
{ required: true, message: '请输入开户行及账户', trigger: 'blur' },
],
buyerMail: [
{ required: true, message: '请输入发票邮寄地址', trigger: 'blur' },
],
firstSubject: [
{ required: true, message: '请输入一级科目', trigger: 'blur' },
],
secondSubject: [
{ required: true, message: '请输入二级科目', trigger: 'blur' },
],
rate: [
{ required: true, message: '请输入税率', trigger: 'blur' },
],
unit: [
{ required: true, message: '请输入单位', trigger: 'blur' },
],
amount: [
{ required: true, message: '请输入金额', trigger: 'blur', type: 'number', min: 1 },
],
invoicingType: [
{ required: true, message: '请选择开票种类', trigger: 'blur' },
],
projectId: [
{ required: true, message: '请输入关联项目', trigger: 'blur' },
],
companyId: [
{ required: true, message: '请输入销售方公司', trigger: 'blur' },
],
}
const initRule = (type) => {
return {
buyerName: [
{ required: true, message: '请输入名称', trigger: 'blur' },
],
buyerNumber: [
{ required: true, message: '请输入纳税人号码', trigger: 'blur' },
],
buyerAddress: [
{ required: type === 2 ? false : true, message: '请输入地址', trigger: 'blur' },
],
buyerPhone: [
{ required: type === 2 ? false : true, message: '请输入电话号码', trigger: 'blur' },
],
buyerAccount: [
{ required: type === 2 ? false : true, message: '请输入开户行及账户', trigger: 'blur' },
],
buyerMail: [
{ required: type === 2 ? false : true, message: '请输入发票邮寄地址', trigger: 'blur' },
],
firstSubject: [
{ required: true, message: '请输入一级科目', trigger: 'change' },
],
secondSubject: [
{ required: true, message: '请输入二级科目', trigger: 'blur' },
],
rate: [
{ required: true, message: '请输入税率', trigger: 'change' },
],
unit: [
{ required: true, message: '请输入单位', trigger: 'blur' },
],
amount: [
{ required: true, message: '请输入金额', trigger: 'blur', type: 'number', min: 1 },
],
invoicingType: [
{ required: true, message: '请选择开票种类', trigger: 'blur' },
],
projectId: [
{ required: true, message: '请输入关联项目', trigger: 'change' },
],
companyId: [
{ required: true, message: '请输入销售方公司', trigger: 'change' },
],
}
}
export {
columnsMap,
dictsMap,
initForm,
rules,
initRule,
}
<file_sep>/src/store/modules/cache.js
import { loadAllDictMap } from '@/api/admin/dict'
import { getUserPyList } from '@/api/admin/contacts'
import { getOneConfig } from '@/api/fams/config'
import { getStore, setStore } from '@/util/store'
import { pickDeep } from '@/util/util'
import keyBy from 'lodash/keyBy'
const cache = {
state: {
dictGroup: getStore({ name: 'dictGroup' }) || {},
contactsPyGroup: getStore({ name: 'contactsPyGroup' }) || {},
famsConfig: getStore({ name: 'famsConfig' }) || {},
},
actions: {
// 获取财务配置
LoadFamsConfig ({
commit,
}) {
return new Promise((resolve, reject) => {
getOneConfig().then(res => {
const { data } = res
commit('SET_FAMS_CONFIG', data.data)
resolve()
}).catch(err => {
reject(err)
})
})
},
// 获取通讯录
LoadContactsPyGroup ({
commit,
}) {
return new Promise((resolve, reject) => {
getUserPyList().then(res => {
const { data } = res
commit('SET_CONTACTS_PY_GROUP', keyBy(data.data, 'id'))
resolve()
}).catch(err => {
reject(err)
})
})
},
// 获取全部字典
LoadAllDictMap ({
commit,
}) {
return new Promise((resolve, reject) => {
loadAllDictMap().then(res => {
const { data } = res
commit('SET_DICT_ALL', data)
resolve()
}).catch(err => {
reject(err)
})
})
},
},
mutations: {
SET_DICT_ALL: (state, dictGroup) => {
for (const key in dictGroup) {
if (dictGroup.hasOwnProperty(key)) {
const element = dictGroup[key]
dictGroup[key] = pickDeep(element)
}
}
state.dictGroup = dictGroup
setStore({
name: 'dictGroup',
content: state.dictGroup,
type: 'session',
})
},
SET_CONTACTS_PY_GROUP: (state, contactsPyGroup) => {
state.contactsPyGroup = contactsPyGroup
setStore({
name: 'contactsPyGroup',
content: contactsPyGroup,
type: 'session',
})
},
SET_FAMS_CONFIG: (state, famsConfig) => {
state.famsConfig = famsConfig
setStore({
name: 'famsConfig',
content: famsConfig,
type: 'session',
})
},
},
}
export default cache<file_sep>/src/api/evaluate/project.js
import request from '@/router/axios'
const queryUrl = '/evaluate/evaluateproject'
export function getPage (params) {
return request({
url: `${queryUrl}/page`,
params: params,
method: 'get',
})
}
// 项目详情接口根据id查找
export function getPageById (id) {
return request({
url: `${queryUrl}/${id}`,
method: 'get',
})
}
// 评测项目保存,状态变为'项目筹备'
export function createData (data) {
return request({
url: `${queryUrl}/preparation`,
method: 'post',
data: data,
})
}
export function deleteData (id) {
return request({
url: `${queryUrl}/delete/${id}`,
method: 'post',
})
}
// 项目告知单保存
export function saveNotice (params) {
return request({
url: `${queryUrl}/approval`,
method: 'post',
data: params,
})
}
//评测项目完善,状态不变
export function evaluateProject (params) {
return request({
url: `${queryUrl}/perfection`,
method: 'post',
data: params,
})
}
// 添加成员
export function addMember (params) {
return request({
url: `${queryUrl}/member`,
method: 'post',
data: params,
})
}
// 项目成员查询
export function findMemberById (id) {
return request({
url: `${queryUrl}/member/${id}`,
method: 'get',
})
}
export function dowloadByProject () {
return request({
url: '/evaluate/evaluatefile/download',
method: 'post',
})
}
// 全部评测项目查询
export function getProjectAll () {
return request({
url: `${queryUrl}/getAll`,
method: 'get',
})
}
// 参评单位分组
export function getGroup (params) {
return request({
url: '/evaluate/evaluategrouping/select',
method: 'get',
params: params,
})
}
// 为指标体系查询分组
export function getGroupForIndex (params) {
return request({
url: '/evaluate/evaluategrouping/infoForIndexSystem',
method: 'get',
params: params,
})
}
// 状态修改,状态变为'正在执行'、'正在收尾'、' 已结项'之一
export function changeStatus (params) {
return request({
url: `${queryUrl}/status`,
method: 'post',
data: params,
})
}
// 关注项目
export function starProject (params) {
return request({
url: '/evaluate/evaluateprojectattention/save',
method: 'post',
data: params,
})
}
// 取消关注项目
export function unStarProject (params) {
return request({
url: '/evaluate/evaluateprojectattention/delete',
method: 'post',
data: params,
})
}
<file_sep>/src/core/use.js
import Vue from 'vue'
import Qrcode from '@chenfengyuan/vue-qrcode'
import Directives from '../directives/index'
import '@/core/components_use'
import '@/core/custom_use'
import '@/core/editor_use'
import '@/core/charts_use'
import '@/core/gov_use'
import '@/styles/common.scss'
// // 引入avue的包
import Avue from '@smallwei/avue/lib/index.js'
import { mergeByFirst, openPage, openTagDetail, fillStatisticsArray } from '@/util/util'
import { wsUrl } from '@/config/env'
import * as filters from '@/filters/' // 全局filter
Vue.prototype.$mergeByFirst = mergeByFirst
Vue.prototype.$openPage = openPage
Vue.prototype.$openTagDetail = openTagDetail
Vue.prototype.$fillStatisticsArray = fillStatisticsArray
Vue.prototype.$wsUrl = wsUrl
Vue.prototype.$wxAppId = '<KEY>'
Vue.use(Directives)
Vue.use(Avue, { menuType: 'text' })
Vue.component(Qrcode.name, Qrcode)
//加载过滤器
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
})
<file_sep>/src/api/exam/testStatistics/examineeStatistics.js
import request from '@/router/axios'
/**
* 获取列表数据
* @param {Object} params 参数
*/
// 获取考生统计列表
export function getExamineeList (params) {
return request({
url: '/exms/iepexaminationstatistics/page',
method: 'get',
params: params,
})
}
// 获取考生考试详情列表
export function getExamList (params) {
return request({
url: '/exms//iepexaminationstatistics/detailPage',
method: 'get',
params: params,
})
}
// 获取考生证书详情列表
export function getCertificateMapList (params) {
return request({
url: '/exms/iepexaminationstatistics/certificateCount',
method: 'get',
params: params,
})
}
// 获取所在组织列
export function getDepList (name) {
return request({
url: '/admin/org/list',
method: 'get',
params: {
name,
},
})
}
/**
* 获取试题选项
* @param {Object} params 参数
*/
export function getTestOption (params) {
return request({
url: 'exms/dict/map',
method: 'get',
params: params,
})
}
export function downloadFile (url) {
request({
url: '/admin/file' + url,
method: 'get',
responseType: 'arraybuffer',
}).then(response => {
// 处理返回的文件流
const blob = new Blob([response.data])
const link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = url
document.body.appendChild(link)
link.style.display = 'none'
link.click()
})
}<file_sep>/src/views/mlms/material/report/custom/option.js
export const dictsMap = {
type: {
1: '类型1',
2: '类型2',
},
}
export const tableOption = [
{
label: '创建人',
prop: 'create',
}, {
label: '创建时间',
prop: 'date',
},
]
export const workListTable = [
{
label: '分类',
prop: 'fenlei',
}, {
label: '名称',
prop: 'mingchen',
}, {
label: '进度',
prop: 'jindu',
}, {
label: '开始时间',
prop: 'kaishishijian',
}, {
label: '完成时间(计划)',
prop: 'wanchengshijian',
}, {
label: '负责人',
prop: 'fuzeren',
}, {
label: '说明',
prop: 'shuming',
},
]
export const initFormData = () => {
return {
id: '',
name: '',
}
}
export const rules = {
name: [
{ required: true, message: '请输入组织名称', trigger: 'blur' },
],
}
<file_sep>/src/views/wenjuan/util/dic.js
import {getStore} from './store'
import isArray from 'lodash/isArray'
import isPlainObject from 'lodash/isPlainObject'
export function getDicAll () {
return getStore({name: 'dictGroup'})
}
function getDeptAll () {
return getStore({
name: 'departmentList',
})
}
export function getDic (name = '') {
if (name === '') {
console.warn('字典名不能为空')
return
}
let dicList = getDicAll()
return dicList[name]
}
export function getDept () {
let deptList = getDeptAll()
return deptList
}
export function setDicList (dicList) {
if (!isPlainObject(dicList)) {
console.warn('数据格式不正确,应为对象')
return
}
let data = {}
for (let key in dicList) {
let arr = []
xhDic(dicList[key], arr)
data[key] = arr
}
return data
}
export function changeDicType (list) {
let change = function (list) {
for (var item of list) {
item.value = parseInt(item.value)
if (item.children) item.children = change(item.children)
}
return list
}
return change(list)
}
function xhDic (data, arr) {
if (!isArray(data)) {
console.warn('数据格式不正确,应为數組')
return
}
for (let i = 0, len = data.length; i < len; i++) {
var obj = {value: data[i].key, label: data[i].value}
if (data[i].dictValueList && data[i].dictValueList.length > 0) {
obj.children = []
xhDic(data[i].dictValueList, obj.children)
}
arr.push(obj)
}
}
// 根据部门的id获取整个部门对象
export function getDeptById (id) {
for (let item of getDept()) {
if (item.value === id) {
return item
}
}
return {}
}
<file_sep>/src/api/goms/org_album.js
import request from '@/router/axios'
const prefixUrl = '/admin/org_album'
// 组织相册
export function geOrgPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
// 新增
export function orgUpdate (data) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: data,
})
}
// 修改
export function orgCreate (data) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: data,
})
}
// 删除
export function orgDelete (id) {
return request({
url: `${prefixUrl}/delete/${id}`,
method: 'post',
})
}
<file_sep>/src/store/modules/im.js
import { getCustomGroup, getGroup, clearUnread, getGroupMembers, updateGroupInfo, deleteGroup, updateCustomGroup, deleteCustomGroup, getTotalHistory } from '@/api/im'
import { getUserListTree } from '@/api/admin/contacts'
function addChat (state, data, isNew = true) {
let message = {
id: data.id,
message: data.message,
messageType: data.messageType,
time: data.time,
sendOrReceive: data.sendOrReceive,
msgCode: data.msgCode,
avatar: data.avatar,
resourceName: data.resourceName,
}
if (state.messageMap.hasOwnProperty(data.chatNo)) {
if (isNew) {
state.messageMap[data.chatNo].push(message)
} else {
state.messageMap[data.chatNo].unshift(message)
}
} else {
let userMessage = {}
userMessage[data.chatNo] = []
if (isNew) {
userMessage[data.chatNo].push(message)
} else {
userMessage[data.chatNo].unshift(message)
}
state.messageMap = {
...state.messageMap,
...userMessage,
}
}
}
function updateChatList (state, chat, reverse = true) {
let chatList = state.chatList
let chatTemp = {}
for (let i = chatList.length; i--;) {
if (chatList[i].chatNo === chat.chatNo) {
chatTemp = chatList[i]
chatList.splice(i, 1)
updateUnread(state, chatTemp.chatNo, chat.unread)
if (reverse) {
chatList.unshift(chatTemp)
} else {
chatList.push(chatTemp)
}
return
}
}
chatTemp = {
id: chat.id,
chatNo: chat.chatNo,
type: chat.type,
avatar: chat.avatar,
realName: chat.realName,
username: chat.username,
originatorId: chat.originatorId || '',
}
updateUnread(state, chat.chatNo, chat.unread)
if (reverse) {
chatList.unshift(chatTemp)
} else {
chatList.push(chatTemp)
}
}
function updateUnread (state, chatNo, num) {
if (!state.unreadMap.hasOwnProperty(chatNo)) {
state.unreadMap[chatNo] = 0
}
if (num) {
state.unreadMap[chatNo] = state.unreadMap[chatNo] + num
} else {
state.unreadMap[chatNo] = 0
}
updateUnreadTotal(state)
}
function updateUnreadTotal (state) {
state.unreadTotal = 0
for (let key in state.unreadMap) {
state.unreadTotal += state.unreadMap[key]
}
}
function newChat (chat, chatList) {
for (let i = chatList.length; i--;) {
if (chatList[i].chatNo === chat.chatNo) {
chatList.splice(i, 1, chat)
return false
}
}
return true
}
function initUserList (state, tree) {
state.userList = treeToList(tree)
}
function treeToList (tree) {
let list = []
for (let i = tree.length; i--;) {
if (tree[i].leaf) {
list.push(tree[i])
} else {
list.push(...treeToList(tree[i].children))
}
}
return list
}
function getUserInfo (state, userId) {
for (let i = state.userList.length; i--;) {
if (state.userList[i].value === userId) {
return {
username: state.userList[i].py,
realName: state.userList[i].label,
avatar: state.userList[i].avatar,
id: state.userList[i].value,
}
}
}
return null
}
function getUserInfoByName (state, username) {
for (let i = state.userList.length; i--;) {
if (state.userList[i].py === username) {
return {
username: state.userList[i].py,
realName: state.userList[i].label,
avatar: state.userList[i].avatar,
id: state.userList[i].value,
}
}
}
}
function getGroupInfro (state, id) {
for (let i = state.groups.length; i--;) {
if (state.groups[i].id === id) {
return {
username: state.groups[i].groupName,
realName: state.groups[i].groupName,
avatar: state.groups[i].avator,
id: state.groups[i].id,
originatorId: state.groups[i].originatorId,
}
}
}
}
function getCustomGroupMembers (state, data) {
let list = []
for (let i = data.length; i--;) {
let children = [{leaf: true}]
let ids = data[i].members ? data[i].members.split(',') : []
for (let j = ids.length; j--;) {
let user = getUserInfo(state, parseInt(ids[j]))
children.unshift({
avatar: user.avatar,
leaf: true,
label: user.realName,
py: user.username,
value: user.id,
})
}
let item = {
label: data[i].name,
leaf: false,
value: data[i].id,
children,
}
list.unshift(item)
}
return list
}
function groupRemove (state, groupId) {
let groups = state.groups
for (let i = 0; i < groups.length; i++) {
if (groups[i].id === groupId) {
groups.splice(i, 1)
break
}
}
let chatList = state.chatList
for (let i = 0; i < chatList.length; i++) {
if (chatList[i].chatNo === `group${groupId}`) {
chatList.splice(i, 1)
break
}
}
}
const im = {
state: {
userList: [],
userTree: [],
messageMap: {},
messageMore: {},
chatList: [],
currentChatList: [],
unreadMap: {},
unreadTotal: 0,
currentChat: {},
groups: [],
customGroups: [],
groupMemberMap: {},
chatShow: false,
},
mutations: {
addMessage (state, data) {
let chat = Object.assign({}, data)
updateChatList(state, {...chat, ...{id: chat.userId}})
let user = getUserInfoByName(state, data.resourceName)
data.resourceName = user.realName
data.avatar = user.avatar
addChat(state, data)
},
addHistoryMessage (state, data) {
let chatNo = ''
if (data.type == 1) {
chatNo = 'user' + data.targetId
} else {
chatNo = 'group' + data.targetId
}
for (let i = 0; i < data.list.length; i++) {
let sendOrReceive = ''
let resourceName = ''
let avatar = ''
if (data.type == 1) {
let user = getUserInfo(state, data.list[i].resourceId)
avatar = user.avatar
resourceName = user.realName
sendOrReceive = data.selfId === data.list[i].targetId ? 1 : 0
} else {
let user = getUserInfo(state, data.list[i].resourceId)
avatar = user.avatar
resourceName = user.realName
sendOrReceive = data.selfId === data.list[i].resourceId ? 0 : 1
}
addChat(state, {
id: data.list[i].id,
chatNo,
message: data.list[i].msg,
messageType: data.list[i].msgType,
msgCode: data.list[i].msgCode,
time: data.list[i].sendTime,
sendOrReceive,
username: data.username,
resourceName,
avatar,
}, false)
}
if (data.list.length < 10) {
state.messageMore[chatNo] = false
}
},
clearUserUnread (state, chatNo) {
if (state.unreadMap.hasOwnProperty(chatNo)) {
state.unreadMap[chatNo] = 0
} else {
let unread = {}
unread[chatNo] = 0
state.unreadMap = {
...state.unreadMap,
...unread,
}
}
updateUnreadTotal(state)
},
closeCurrentChatList (state, index) {
state.currentChatList.splice(index, 1)
},
initHistory (state, {history, selfId}) {
for (let i = 0; i < history.length; i++) {
let chat = {}
let sendOrReceive = ''
let resourceName = ''
let avatar = ''
if (history[i].oneOrMore == 1) {
chat = getUserInfo(state, history[i].resourceId === selfId ? history[i].targetId : history[i].resourceId)
let user = getUserInfo(state, history[i].resourceId)
avatar = user.avatar
resourceName = user.realName
sendOrReceive = history[i].targetId === selfId ? 1 : 0
} else {
chat = getGroupInfro(state, history[i].targetId)
let user = getUserInfo(state, history[i].resourceId)
avatar = user.avatar
resourceName = user.realName
sendOrReceive = selfId === history[i].resourceId ? 0 : 1
}
let chatNo = history[i].oneOrMore == 1 ? `user${chat.id}` : `group${chat.id}`
chat.chatNo = chatNo
chat.unread = history[i].msgNum
chat.type = history[i].oneOrMore
updateChatList(state, chat, false)
addChat(state, {
id: history[i].id,
chatNo,
message: history[i].msg,
messageType: history[i].msgType,
time: history[i].sendTime,
sendOrReceive,
msgCode: history[i].msgCode,
resourceName,
avatar,
})
}
},
imClearAll (state) {
state.messageMap = {}
state.messageMore = {}
state.chatList = []
state.currentChatList = []
state.unreadMap = {}
state.unreadTotal = 0
state.currentChat = {}
state.groups = []
state.customGroups = []
state.groupMemberMap = {}
},
setUserList (state, data) {
state.userTree = data
initUserList(state, data)
},
initGroup (state, data) {
state.groups = data
},
initCustomGroup (state, data) {
state.customGroups = getCustomGroupMembers(state, data)
},
updateCustomGroup (state, data) {
for (let i = state.customGroups.length; i--;) {
if (state.customGroups[i].value === data.id) {
state.customGroups[i].label = data.name
return
}
}
},
deleteCustomGroup (state, id) {
for (let i = state.customGroups.length; i--;) {
if (state.customGroups[i].value === id) {
state.customGroups.splice(i, 1)
return
}
}
},
chatChange (state, {chat, show}) {
state.chatShow = show
state.currentChat = chat || {}
if (chat) {
if (newChat(chat, state.currentChatList)) {
state.currentChatList.unshift(chat)
}
if (!state.messageMore.hasOwnProperty(chat.chatNo)) {
state.messageMore[chat.chatNo] = true
}
}
},
updateGroup (state, data) {
if (data.type) {
state.groups.push(data)
} else {
groupRemove(state, data.id)
}
},
updateGroupInfo (state, {id, groupName}) {
for (let i = state.groups.length; i--;) {
if (state.groups[i].id === id) {
state.groups[i].groupName = groupName
if (state.currentChat.chatNo === `group${id}`) {
state.currentChat.chatName = groupName
}
}
}
},
updateGroupMember (state, {groupId, type, ids}) {
if (state.groupMemberMap.hasOwnProperty(`group${groupId}`)) {
if (type) {
let newMembers = []
for (let i = ids.length; i--;) {
let user = getUserInfo(state, ids[i])
newMembers.push({
id: groupId,
membersId: user.id,
avatar: user.avatar,
membersName: user.username,
realName: user.realName,
})
}
let members = Object.assign([], state.groupMemberMap[`group${groupId}`])
state.groupMemberMap[`group${groupId}`] = [...members, ...newMembers]
} else {
for (let i = state.groupMemberMap[`group${groupId}`].length; i--;) {
if (ids.includes(state.groupMemberMap[`group${groupId}`][i].membersId)) {
state.groupMemberMap[`group${groupId}`].splice(i, 1)
}
}
}
}
},
innitGroupMember (state, {groupId, data}) {
if (state.groupMemberMap.hasOwnProperty(`group${groupId}`)) {
let members = Object.assign([], state.groupMemberMap[`group${groupId}`])
state.groupMemberMap[`group${groupId}`] = [...members, ...data]
} else {
let members = {}
members[`group${groupId}`] = data
state.groupMemberMap = {...state.groupMemberMap, ...members}
}
},
groupRemove (state, groupId) {
groupRemove (state, groupId)
},
},
actions: {
initHistory ({ commit }, selfId) {
return new Promise((resolve, reject) => {
getTotalHistory().then(({ data }) => {
if (data.code === 0) {
commit('initHistory', {history: data.data, selfId})
resolve()
} else {
reject(new Error(data.msg))
}
}, error => {
reject(error)
})
})
},
initCustomGroup ({ commit }) {
return new Promise((resolve, reject) => {
getCustomGroup().then(({data}) => {
if (data.code === 0) {
commit('initCustomGroup', data.data)
resolve()
} else {
reject(new Error(data.msg))
}
}, () => {
reject()
}).catch(() => {
reject()
})
})
},
initGroup ({ commit }) {
return new Promise((resolve, reject) => {
getGroup().then(({data}) => {
if (data.code === 0) {
commit('initGroup', data.data)
resolve()
} else {
reject(new Error(data.msg))
}
}, () => {
reject()
}).catch(() => {
reject()
})
})
},
updateCurrentChat ({ commit }, {chat, show}) {
if (chat) {
clearUnread({type: chat.type, targetId: chat.id}).then(() => {
commit('clearUserUnread', chat.chatNo)
commit('chatChange', {chat, show})
})
} else {
commit('chatChange', {chat, show})
}
},
getUserListTree ({ commit }) {
return new Promise(resolve => {
getUserListTree().then(({data}) => {
commit('setUserList', data.data)
resolve()
})
})
},
updateGroupInfo ({ commit }, {id, groupName}) {
return new Promise((resolve, reject) => {
updateGroupInfo({
id,
groupName,
}).then(({data}) => {
if (data.code === 0) {
commit('updateGroupInfo', {id, groupName})
resolve()
} else {
reject(data)
}
}, (error) => {
reject(error)
})
})
},
setGroupMembers ({ commit }, groupId) {
return new Promise((resolve, reject) => {
getGroupMembers({groupId}).then(({data}) => {
if (data.code === 0) {
commit('innitGroupMember', {groupId, data: data.data})
resolve(data.data)
}
}, error => {
reject(error)
})
})
},
removeGroup ({ commit }, groupId) {
return new Promise((resolve, reject) => {
deleteGroup({groupId}).then(({data}) => {
if (data.code === 0) {
commit('groupRemove', groupId)
resolve()
}
}, error => {
reject(error)
})
})
},
updateCustomGroup ({ commit }, param) {
return new Promise((resolve, reject) => {
updateCustomGroup(param).then(({data}) => {
if (data.code === 0) {
commit('updateCustomGroup', param)
resolve()
} else {
reject(data.msg)
}
}, error => {
reject(error.msg)
})
})
},
deleteCustomGroup ({ commit }, param) {
return new Promise((resolve, reject) => {
deleteCustomGroup(param).then(({data}) => {
if (data.code === 0) {
commit('deleteCustomGroup', param.id)
resolve()
} else {
reject(data.msg)
}
}, error => {
reject(error.msg)
})
})
},
},
}
export default im
<file_sep>/src/views/wenjuan/config/global.js
export const SUCCESS = 0 // 成功接收数据
export const ERROR = 1 // 接收数据失败
export const BASE_URL = '/api'
export const DELETE = '删除成功'
export const CREATE = '创建成功'
export const UPDATE = '修改成功'
export const DELETE_SUCCESS = '删除成功'
export const CREATE_SUCCESS = '创建成功'
export const UPDATE_SUCCESS = '修改成功'
export const EXPORT_SUCCESS = '导出成功'
export const IMPORT_SUCCESS = '导入成功'
export const DELETE_FAILURE = '删除失败'
export const CREATE_FAILURE = '创建失败'
export const UPDATE_FAILURE = '修改失败'
export const EXPORT_FAILURE = '导出失败'
export const IMPORT_FAILURE = '导入失败'
export const IS_DELETE = '确定要删除吗'
export const MULTIPLE_DELETE_EMPTY = '未选择不能批量删除,请选择后操作'
export const EXPORT_TIMEOUT = 1000 * 60 * 30 // 30分钟
export const IMPORT_TIMEOUT = 1000 * 60 * 60 // 60分钟
<file_sep>/src/api/govdata/policy_packet.js
/**
* 新增政策红包API请求接口
*/
import request from '@/router/axios'
const prefixUrl = '/gov'
// 查看政策红包分页
export function getPacketPage (params) {
return request({
url: `${prefixUrl}/redEnvelope/page`,
method: 'get',
params: params,
})
}
// 根据id查看政策红包
export function getPacketById (id) {
return request({
url: `${prefixUrl}/redEnvelope/withRelation/${id}`,
method: 'get',
})
}
// 删除政策红包
export function deletePacket (ids) {
return request({
url: `${prefixUrl}/redEnvelope/delete`,
method: 'post',
data: ids,
})
}
/**
* 新增并提交政策红包
* @param {Object} obj 表单参数
*/
export function postPacket (params) {
return request({
url: `${prefixUrl}/redEnvelope/add`,
method: 'post',
data: params,
})
}
/**
* 修改并提交政策红包
* @param {Object} obj 表单参数
*/
export function putPacket (params) {
return request({
url: `${prefixUrl}/redEnvelope/update`,
method: 'post',
data: params,
})
}
// 查看政策分页
export function getpolicyPage (params) {
return request({
url: `${prefixUrl}/redEnvelope/getPoliciesFromGc`,
method: 'get',
params: params,
})
}
<file_sep>/src/mixins/formMixins.js
export default {
data () {
return {
submitFormLoading: false,
}
},
methods: {
mixinsValidate (formRefName = 'form') {
return new Promise((resolve, reject) => {
this.$refs[formRefName].validate((v, o) => {
if (v) {
resolve(v)
} else {
reject(o)
}
})
})
},
mixinsMessage (error) {
let message = ''
for (const key in error) {
if (error.hasOwnProperty(key)) {
const i = Object.keys(error).indexOf(key)
if (i === 0) {
const element = error[key]
message = element[0].message
this.$message(message)
break
}
}
}
},
async mixinsForm (formRefName = 'form') {
this.submitFormLoading = true
try {
const valid = await this.mixinsValidate(formRefName)
if (valid) {
return true
} else {
return false
}
} catch (error) {
this.mixinsMessage(error)
this.submitFormLoading = false
return false
} finally {
this.submitFormLoading = false
}
},
async * mixinsFormGen (formRefName = 'form') {
this.submitFormLoading = true
try {
const valid = await this.mixinsValidate(formRefName)
if (valid) {
yield true
} else {
yield false
}
} catch (error) {
this.mixinsMessage(error)
// console.log(error, formRefName)
yield false
} finally {
this.submitFormLoading = false
}
},
/**
* 需要 form 表单 ref ='form', 可自定义
* 需要 rules 规则
* 需要 submitForm 方法同步,包括里面的请求函数
*/
async mixinsSubmitFormGen (formRefName = 'form') {
const mixinsFormGen = this.mixinsFormGen(formRefName)
let mixinsResult = false
try {
const valid = (await mixinsFormGen.next()).value
if (valid) {
mixinsResult = await this.submitForm()
}
} finally {
await mixinsFormGen.next()
}
return mixinsResult
},
},
}
<file_sep>/src/store/modules/cpms.js
const fams = {
state: {
apprenticeShow: false,
apprenticeReason: '', // 拜师理由
apprenticePerson: {id: '', name: ''},
},
mutations: {
SET_APPRENTICE_SHOW: (state, apprenticeShow) => {
state.apprenticeShow = apprenticeShow
},
SET_APPRENTICE_REASON: (state, data) => {
state.apprenticeReason = data.reason
state.apprenticePerson = data.person
},
},
actions: {
ApprenticeApply ({ commit }, person = {id: '', name: ''}, reason = '') {
commit('SET_APPRENTICE_REASON', {
reason: reason,
person: person,
})
commit('SET_APPRENTICE_SHOW', true)
},
},
}
export default fams<file_sep>/src/views/atms/MyTasks/options.js
// org config options
const dictsMap = {
status: {
1: '进行中',
2: '已完成',
3: '已确认',
},
}
const columnsMap = [
{
prop: 'name',
label: '任务名称',
width:'250',
},
{
prop: 'parentName',
label: '所属任务',
},
]
const initForm = () => {
return {
name: '',
isOpen: false,
intro: '',
hasBegun:'',//是否待办
childrenCount:'',//是否包含子任务
creatorId:'',
principalId:'',
}
}
const initSearchForm = () => {
return {
name: '',
sex: '',
}
}
export { dictsMap, columnsMap, initForm, initSearchForm }<file_sep>/src/router/app/navList.js
const e_ICAN_URL = '//www.icanvip.net/'
const navList = [
{
id: `${e_ICAN_URL}`,
name: '首页',
}, {
id: `${e_ICAN_URL}newsList/`,
name: '头条新知',
}, {
id: `${e_ICAN_URL}businessList/`,
name: '任务协作',
}, {
id: `${e_ICAN_URL}dataAssets/`,
name: '数据资产',
}, {
id: `${e_ICAN_URL}masterList/`,
name: '人脉资本',
}, {
id: `${e_ICAN_URL}thoughtsList/`,
name: '我要说说',
},
]
const navPathList = navList.map(m => m.id)
export { navList, navPathList }
<file_sep>/vue.config.js
const utils = require('./config/utils')
const cacheGroups = require('./config/cacheGroups')
const devServer = require('./config/devServer')
const isProduction = process.env.NODE_ENV === 'production'
const externals = {
'vue': 'Vue',
'vue-router': 'VueRouter',
'vuex': 'Vuex',
'lodash': '_',
'axios': 'axios',
'element-ui': 'ELEMENT'
}
const commonCss = [
'/cdn/animate/animate.css',
'/cdn/iconfont/index.css',
'/cdn/iep/index.css',
'/cdn/avue.index.css',
'/cdn/element-ui.css',
'/cdn/froala-editor/css/froala_editor.pkgd.min.css',
'/cdn/froala-editor/css/froala_style.min.css',
'/cdn/froala-editor/css/themes/gray.min.css',
'//at.alicdn.com/t/font_1036949_fii13p1mkzs.css'
]
const commonJs = [
'/cdn/jquery.min.js',
'/cdn/froala-editor/froala_editor.pkgd.min.js',
'/cdn/froala-editor/zh_cn.js',
'//at.alicdn.com/t/font_1184303_mhqvids4u2k.js'
]
// CDN外链,会插入到index.html中
const cdn = {
// 开发环境
dev: {
css: [...commonCss],
js: [...commonJs]
},
// 生产环境
build: {
css: [...commonCss],
js: [
...commonJs,
'/cdn/vue.runtime.min.js',
'/cdn/vue-router.min.js',
'/cdn/vuex.min.js',
'/cdn/axios.min.js',
'/cdn/element-ui.js',
'/cdn/lodash.min.js'
]
}
}
module.exports = {
lintOnSave: true,
chainWebpack: config => {
// config.entry('index').add('babel-polyfill').end()
config.plugin('html').tap(args => {
args[0].title = '我能一站式数字化转型服务平台'
args[0].url = 'home.icanvip.net'
if (isProduction) {
args[0].cdn = cdn.build
} else {
args[0].cdn = cdn.dev
}
return args
})
if (isProduction) {
// 删除预加载
config.plugins.delete('preload')
config.plugins.delete('prefetch')
}
config
.plugin('webpack-context-replacement')
.use(require('webpack').ContextReplacementPlugin, [
/moment[/\\]locale$/,
/zh-cn/,
])
config.plugin('define').tap(definitions => {
definitions[0] = Object.assign(definitions[0], {
BUILD_PROJECT: JSON.stringify(utils.getProject()),
BUILD_TEAM_NAME: JSON.stringify(utils.getProjectTeam()),
BUILD_PRO_NAME: JSON.stringify(utils.getProjectName()),
BUILD_VER_TAG: JSON.stringify(utils.getCurrentTag()),
BUILD_GIT_HASH: JSON.stringify(utils.getGitHash()),
BUILD_PRO_DESC: JSON.stringify(utils.getProjectDesc()),
BUILD_TIME: Date.parse(new Date()),
IS_ICAN: true,
})
return definitions
})
return config
},
configureWebpack: config => {
if (isProduction) {
// 用cdn方式引入
config.optimization = {
splitChunks: {
cacheGroups: cacheGroups.cacheGroups
}
}
config.externals = externals
} else {
// 为开发环境修改配置...
}
},
// 生产环境是否生成 sourceMap 文件
productionSourceMap: false,
css: {
// 是否使用css分离插件 ExtractTextPlugin
// extract: true,
// 开启 CSS source maps?
// sourceMap: false,
loaderOptions: {
less: {
modifyVars: {
'primary-color': '#e05255',
// 'link-color': '#1DA57A',
// 'border-radius-base': '2px',
},
javascriptEnabled: true,
},
// pass options to sass-loader
sass: {
// 引入全局变量样式,@使我们设置的别名,执行src目录
prependData: `
@import "@/styles/approval.scss";
@import "@/styles/variables.scss";
`,
},
},
// 启用 CSS modules for all css / pre-processor files.
// modules: false,
},
// 配置转发代理
devServer: {
disableHostCheck: true,
host: devServer.host, // can be overwritten by process.env.HOST
open: false,
port: devServer.port, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
proxy: devServer.proxy,
overlay: {
warnings: true,
errors: true,
},
},
pwa: {
name: 'i-can',
themeColor: '#e05255',
msTileColor: '#000000',
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'black',
workboxOptions: {
skipWaiting: true,
clientsClaim: true,
},
},
}
<file_sep>/src/api/admin/contacts.js
import request from '@/router/axios'
const prefixUrl = '/admin/contacts'
// @/api/admin/contacts
export function getUnionList () {
return request({
url: `${prefixUrl}/union/list`,
method: 'get',
})
}
export function getOrgListById (id) {
return request({
url: `${prefixUrl}/org/list/${id}`,
method: 'get',
})
}
export function getUserListById (id) {
return request({
url: `${prefixUrl}/user/list/${id}`,
method: 'get',
})
}
export function getUserListTree () {
return request({
url: `${prefixUrl}/all/user/list`,
method: 'get',
})
}
export function getUserPyList () {
return request({
url: `${prefixUrl}/user/name/list`,
method: 'get',
})
}
export function loadContactsPyList (query) {
return request({
url: `${prefixUrl}/all/user/name/list`,
method: 'get',
params: query,
})
}
export function getUserList () {
return request({
url: `${prefixUrl}/phone/user/name/list`,
method: 'get',
})
}<file_sep>/src/views/gpms/international/option.js
import { getStore } from '@/util/store'
const dicData = getStore({ name: 'dictGroup' })
function changeDict (list) {
let data = {}
for (let item of list) {
data[item.value] = item.label
}
return data
}
export const dictMap = {
projectStage: changeDict(dicData.prms_project_stage),
}
export const columnsMap = [
]
export const initSearchForm = () => {
return {
projectName: '',//项目名称
projectStatus:'',//项目状态
}
}<file_sep>/src/api/mlms/material/report/project.js
import request from '@/router/axios'
const prefixUrl = '/mlms/projectreport'
export function getTableData (params) {
return request({
url: `${prefixUrl}/list`,
method: 'post',
data: params,
})
}
export function createData (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function updateData (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function getAllReportsOrg (params) {
return request({
url: `${prefixUrl}/getAllReportsOrg`,
method: 'get',
params: params,
})
}
<file_sep>/src/api/fams/total.js
import request from '@/router/axios'
const prefixUrl = '/fams/total'
// @/api/fams/total
export function getTotal () {
return request({
url: `${prefixUrl}`,
method: 'get',
})
}
export function reward (obj) {
return request({
url: `${prefixUrl}/reward`,
method: 'post',
data: obj,
})
}
export function openAccount () {
return request({
url: `${prefixUrl}/open/send`,
method: 'get',
})
}
<file_sep>/src/api/goms/org_thing.js
import request from '@/router/axios'
const prefixUrl = '/admin/org_thing'
//组织大事记
export function geOrgPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function reviewApprovaBatch (obj) {
return request({
url: `${prefixUrl}/status/batch`,
method: 'post',
data: obj,
})
}
export function addObj (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function putOrg (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function deleteJobById (id) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: [id],
})
}
export function deleteJobBatch (ids) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}<file_sep>/src/views/wenjuan/router/views/index.js
import Layout from '@/page/index/'
export default [
{
path: '/info',
component: Layout,
redirect: '/info/show',
children: [{
path: 'password',
name: '修改密码',
component: () => import('@/views/info/password'),
},{
path: 'info',
name: '修改资料',
component: () => import('@/views/info/info'),
}, {
path: 'show',
name: '查看资料',
component: () => import('@/views/info/show'),
}, {
path: 'message',
name: '消息中心',
component: () => import ('@/views/info/message'),
}],
},
]
<file_sep>/src/api/govdata/general_policy.js
/**
* 新增政策库通用政策API请求接口
*/
import request from '@/router/axios'
const prefixUrl = '/gc/policy/general'
/**
* 获取政策列表
* @param {Object} params 参数
*/
export function getGeneralPage (params) {
return request({
url: `${prefixUrl}/pageConsole`,
method: 'get',
params: params,
headers: {
isNoNeed: true,
},
})
}
// 政策中心里根据不同的条件的通用政策分页
export function getGeneralCenterPage (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
headers: {
isNoNeed: true,
},
})
}
/**
* 政策中心里根据id查询通用政策
*/
export function getGeneralCenterById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
headers: {
isNoNeed: true,
},
})
}
/**
* 根据id查询通用政策
*/
export function getGeneralById (id) {
return request({
url: `${prefixUrl}/infoForConsole/${id}`,
method: 'get',
headers: {
isNoNeed: true,
},
})
}
// 删除政策
export function deleteGeneralBatch (id) {
return request({
url: `${prefixUrl}/logicDelete`,
method: 'delete',
data: id,
headers: {
isNoNeed: true,
},
})
}
// 验证通用政策
export function validGeneralTitle (params) {
return request({
url: `${prefixUrl}/repeat`,
method: 'post',
params: params,
headers: {
isNoNeed: true,
},
})
}
/**
* 新增并提交政策
* @param {Object} obj 表单参数
*/
export function postGeneralAndCommit (params) {
return request({
url: `${prefixUrl}/createAndCommit`,
method: 'post',
data: params,
headers: {
isNoNeed: true,
},
})
}
/**
* 修改并提交政策
* @param {Object} obj 表单参数
*/
export function putGeneralAndCommit (params) {
return request({
url: `${prefixUrl}/updateAndCommit`,
method: 'post',
data: params,
headers: {
isNoNeed: true,
},
})
}
// 暂存(添加)
export function postGeneral (params) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: params,
headers: {
isNoNeed: true,
},
})
}
// 暂存(修改)
export function putGeneral (params) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: params,
headers: {
isNoNeed: true,
},
})
}<file_sep>/src/api/mcms/meeting.js
import request from '@/router/axios'
// 新增会议
export function postMeetingmarketing (obj) {
return request({
url: '/mcms/meetingmarketing/create',
method: 'post',
data: obj,
})
}
// 报名新增
export function postMeetingsignup (obj) {
return request({
url: '/mcms/meetingsignup/create',
method: 'post',
data: obj,
})
}
//查看会议信息
export function getmeetingmarketing (id) {
return request({
url: `/mcms/meetingmarketing/${id}`,
method: 'get',
})
}
//查看会议信息列表
export function getMeetingmarketingList (query) {
return request({
url: '/mcms/meetingmarketing/page',
method: 'get',
params: query,
})
}
//查看会议名单列表
export function geTmeetingsignup (query) {
return request({
url: '/mcms/meetingsignup/page',
method: 'get',
params: query,
})
}
//修改报名会议名单人员状态
export function postMeetingsignupStatus (obj) {
return request({
url: '/mcms/meetingsignup/update/status',
method: 'post',
data: obj,
})
}
//报名会议人员名单删除
export function deleteMeetingsignup (id) {
return request({
url: '/mcms/meetingsignup/delete/batch',
method: 'post',
data: id,
})
}
//查询一级标签
export function getMeetingtagAlltag (query) {
return request({
url: '/admin/dict/getDictValue',
method: 'get',
params: query,
})
}
//查询二级标签
export function getMeetingtagSontag (obj) {
return request({
url: '/mcms/meetingtag/sontag',
method: 'post',
data: obj,
})
}
//根据code获取城市名称
export function getCodeName (query) {
return request({
url: '/crm/customer/code/namelist',
method: 'post',
data: query,
})
}
export function getdic (obj) {
return request({
url: '/crm/customer/dictvo',
method: 'post',
data: obj,
})
}
//修改会议
export function putMeetingmarketing (query) {
return request({
url: '/mcms/meetingmarketing/update',
method: 'post',
data: query,
})
}
//删除会议
export function meetingmarketingDelete (ids) {
return request({
url: '/mcms/meetingmarketing/delete/batch',
method: 'post',
data: ids,
})
}
//根据code获取城市名字
export function getCode (query) {
return request({
url: '/crm/customer/code/name',
method: 'get',
params: query,
})
}
//分页查询我报名的会议
export function getMymeetingPage (query) {
return request({
url: '/mcms/meetingmarketing/mymeeting/page',
method: 'get',
params: query,
})
}
//修改报名人员会议信息
export function putMeetingsignup (query) {
return request({
url: '/mcms/meetingsignup/update',
method: 'post',
data: query,
})
}
//查看会议列表
export function getMeetingmarketingStatus (query) {
return request({
url: '/mcms/meetingmarketing/status/page',
method: 'get',
params: query,
})
}
//修改会议状态
export function postMeetingsignupUpdateStatus (query) {
return request({
url: '/mcms/meetingmarketing/update/status',
method: 'post',
data: query,
})
}
//查看我报名的会议名单列表
export function getMeetingsignupUserPage (query) {
return request({
url: '/mcms/meetingsignup/user/page',
method: 'get',
params: query,
})
}
//审核会议
export function postMeetingmarketingAudit (query) {
return request({
url: '/mcms/meetingmarketing/audit',
method: 'post',
data: query,
})
}<file_sep>/src/views/gpms/project/option.js
export const tipContent = {
projectName:'立项日期(八位数)+ 客户简称 + 项目名称',
projectType:'无需备注',
businessType:'请务必结合客户需求准确填写业务类型:<br/>' +
'咨询:规划/行动计划/工作方案/课题研究/标准规范/管理制度/整体解决方案/评测<br/>' +
'产品:DNA/DIPS/营商通/咨询服务产品化<br/>' +
'<br/>' +
'数据:数据采集/普查/编目/标准化/开放共享/应用服务/主题库、基础库建设/事项材料梳理/主题清单规范优化、再造<br/>' +
'<br/>' +
'外包:软件/平台/服务<br/>' +
'会议培训:研讨会/招商合作/培训会<br/>' +
'<br/>' +
'平台:平台新建/<br/>' +
'平台升级<br/>' +
'技术服务:网站/平台/软件<br/>' +
'其他:自定义填写',
relatedClient:'请务必准确关联客户',
projectBudget:'此处填写该项目预算计划,以“元”为单位',
mktManagerList:'请准确选择负责该项目的签订合同市场经理',
projectManagerList:'项目总负责人',
projectMentorList:'请务必为该项目寻找适合的指导人',
projectHandlesList:'项目协作部门的负责人',
projectTagList:'1、项目标签要突出项目主题,合作项目/产品关联,其中合作项目简称,合作产品,客户简称等必须作为标签;<br/>' +
'2、标签次序按照重要性排序;<br/>' +
'3、标签数量必须三个以上。',
isRelevanceProduct:'请务必根据实际情况进行选择。若为“是”,请必须准确关联相关的产品;若为“否”,必须详细说明不关联理由。',
inChargeDeptList:'此处选择该项目的第一责任组织,对该项目负主要责任。',
coopDeptList:'此处选择该项目的合作部门,主要协助协助承接部门完成相关任务。',
groupExternalCooperatePartner:'此处选择该项目的外部协作伙伴。若“无”则无需填写',
}<file_sep>/src/api/atms/index.js
import request from '@/router/axios'
const prefixUrl = '/cpms/task'
export function getMyAtms (obj) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: obj,
})
}
export function getAllAtms (obj) {
return request({
url: `${prefixUrl}/page/all`,
method: 'get',
params: obj,
})
}
export function getMyCount (obj) {
return request({
url: `${prefixUrl}/myCount`,
method: 'get',
params: obj,
})
}
export function getAllCount (obj) {
return request({
url: `${prefixUrl}/allCount`,
method: 'get',
params: obj,
})
}
export function createAtms (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function updateAtms (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function getAtmsById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function deleteAtmsById (id,reserved) {
return request({
url: `${prefixUrl}/delete/${id}`,
method: 'post',
data: {
id,
reserved,
},
})
}
export function changeAtmsStatus (id, status) {
return request({
url: `${prefixUrl}/status/update`,
method: 'post',
data: {
id,
status,
},
})
}
export function transferPrincipal (obj) {
return request({
url: `${prefixUrl}/deliver`,
method: 'post',
data: obj,
})
}
export function conversionAtms (obj) {
return request({
url: `${prefixUrl}/transfer`,
method: 'post',
data: obj,
})
}
export function getAtmsListByName (query) {
return request({
url: `${prefixUrl}/list`,
method: 'get',
params: query,
})
}<file_sep>/src/views/goms/WorkBench/options.js
const initForm = () => {
return {
userId: null,
}
}
export { initForm }
<file_sep>/src/api/app/cpms/custom_module.js
import request from '@/router/axios'
export const prefixUrl = '/cpms/custom_module'
export function putModuleById (moduleId) {
return request({
url: `${prefixUrl}/module_create/${moduleId}`,
method: 'post',
})
}
export function putProductById (productId) {
return request({
url: `${prefixUrl}/product_create/${productId}`,
method: 'post',
})
}
export function getCusList () {
return request({
url: `${prefixUrl}/list`,
method: 'get',
})
}
export function deleteModuleById (id) {
return request({
url: `${prefixUrl}/delete/${id}`,
method: 'post',
})
}
export function deleteBatchDelete (obj) {
return request({
url: `${prefixUrl}/batch_delete`,
method: 'post',
data: obj,
})
}<file_sep>/src/api/ims/system_message.js
import request from '@/router/axios'
const prefixUrl = '/ims/system_message'
// @/api/ims/system_message
export function getSystemMessagePage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function getTypeCountMap () {
return request({
url: `${prefixUrl}/type_count_map`,
method: 'get',
})
}
export function getSystemMessageById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function readSystemMessageBatch (ids) {
return request({
url: `${prefixUrl}/read_or_set/batch`,
method: 'post',
data: ids,
params: {
type: 8,
},
})
}
export function markSystemMessageBatch (ids) {
return request({
url: `${prefixUrl}/read_or_set/batch`,
method: 'post',
data: ids,
params: {
type: 9,
},
})
}
<file_sep>/src/api/mlms/collection/index.js
import request from '@/router/axios'
const prefixUrl = '/mlms/catalogue'
const farelationUrl = '/mlms/farelation'
export function getList (params) {
return request({
url: `${prefixUrl}/tree`,
method: 'get',
params: params,
})
}
// 根绝id获取实际数据
export function getListById (params) {
return request({
url: `${farelationUrl}/page`,
method: 'get',
params: params,
})
}
// 获取全部
export function getAllList (params) {
return request({
url: `${farelationUrl}/all/page`,
method: 'get',
params: params,
})
}
// 新增目录
export function catalogCreate (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
// 修改目录
export function catalogUpdate (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function catalogDelete (id) {
return request({
url: `${prefixUrl}/delete/${id}`,
method: 'post',
})
}
// 取消收藏
export function farelationDelete (id) {
let ids = typeof id === 'object' ? id : [id]
return request({
url: `${farelationUrl}/delete/batch`,
method: 'post',
data: ids,
})
}
// 移动即重新收藏
export function collectUpdate (row) {
return request({
url: `${farelationUrl}/update`,
method: 'post',
data: row,
})
}
<file_sep>/src/views/wenjuan/util/menu.js
// // 判断当前菜单是否存在
// export function isCurrentMenu (menuAll, redirectUrl) {
// let arr = redirectUrl.split('/')
// let menuName = arr[arr.length - 1]
// for (let i = 0, len = menuAll.length; i < len; i++) {
// let children = menuAll.children
// this.findMenu(children, menuName)
// }
// }
// function findMenu (menu, menuName) {
// for (let i = 0, len = menu.length; i < len; i++) {
// let children = menu.children
// if (menuName === menu.name) {
// return true
// }
// if (children && children.length > 0) {
// }
// }
// }<file_sep>/src/api/fams/bank_account.js
import request from '@/router/axios'
const prefixUrl = '/fams/bank_account'
// @/api/fams/bank_account
export function getBankAccountPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function getBankAccountById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function postBankAccount (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function putBankAccount (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function deleteBankAccountById (id) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: [id],
})
}<file_sep>/src/views/fams/FinancialManagement/InvoiceReimbursement/options.js
// import { mergeByFirst } from '@/util/util'
import { genStatus } from '@/const/invoiceConfig'
// org config options
const dictsMap = {
financialAudit: {
0: '待确认',
1: '已确认',
},
referType: {
1: '项目管理类',
2: '日常管理类',
3: '其他类',
},
invoiceType: {
1: '增值税专用发票',
2: '增值税普通发票',
3: '其他',
},
}
const columnsMap = [
{
prop: 'creatorName',
label: '申请人',
width: '70',
},
{
prop: 'referType',
label: '发票类型',
type: 'dict',
width: '110',
},
{
prop: 'companyName',
label: '发票抬头',
type: 'detail',
},
{
prop: 'totalAmount',
label: '发票金额',
},
{
prop: 'createTime',
label: '申请日期',
width: '150',
},
{
prop: null,
label: '状态',
type: 'custom',
customFunction: genStatus,
width: '70',
},
{
prop: 'auditorName',
label: '部门核准人',
width: '110',
},
{
prop: 'auditingTime',
label: '核准日期',
width: '150',
},
{
prop: 'remarks',
label: '备注',
type: 'detail',
},
]
export { dictsMap, columnsMap }<file_sep>/src/const/website.js
export default {
title: 'Iep',
logo: 'Iep',
indexTitle: '我能智慧组织赋能平台',
whiteList: ['/login', '/404', '/401', '/lock'], // 配置无权限可以访问的页面
whiteTagList: ['/login', '/404', '/401', '/lock'], // 配置不添加tags页面 ('/advanced-router/mutative-detail/*'——*为通配符)
lockPage: '/lock',
tokenTime: 6000,
info: {
title: '我能智慧组织赋能平台',
list: [],
},
statusWhiteList: [428],
// http的status默认放行不才用统一处理的,
// 配置首页不可关闭
isFirstPage: false,
fistPage: {
label: '首页',
value: '/wel/index',
params: {},
query: {},
group: [],
close: false,
},
// 配置菜单的属性
menu: {
props: {
name: 'name',
label: 'label',
path: 'path',
icon: 'icon',
children: 'children',
},
// TODO:/wel/index 暂时
firstMenu: {
name: 'ET工作台',
path: '/wel/index',
modulePath: '/wel',
},
},
collectWebsite: [
{
name: '国脉电子政务网',
url: 'http://www.echinagov.com/',
},
{
name: '国脉智慧城市网',
url: 'http://www.besticity.com/',
},
{
name: '国脉物联网',
url: 'http://www.im2m.com.cn/',
},
{
name: '司马钱',
url: 'http://www.smartqian.com/',
},
{
name: '数邦客',
url: 'http://www.databanker.cn/',
},
{
name: '中船通',
url: 'http://www.allship.cn/',
},
{
name: '蟠桃会',
url: 'http://www.51banhui.com/',
},
{
name: '营商通',
url: 'https://www.govmade.com/yingst/',
},
{
name: '国策数据',
url: 'http://gc.govmade.cn/',
},
],
backupUrl: [
{
name: '移动',
url: 'http://192.168.127.12:1888/',
},
{
name: '网通',
url: 'http://192.168.3.11:1888/',
},
{
name: '电信',
url: 'http://192.168.127.12:1888/',
},
],
ican_host: '//www.icanvip.net/',
}
<file_sep>/src/views/fams/OrgAssets/PaymentPlan/options.js
import { getYear, getMonth } from '@/util/date'
const columnsMap = [
{
prop: 'projectName',
label: '项目名称',
},
{
prop: 'projectPaymentTime',
label: '回款时间',
type: 'date',
formatString: 'YYYY-MM-DD',
},
{
prop: 'paymentAmount',
label: '回款计划金额',
},
{
prop: 'contractAmount',
label: '合同金额',
},
{
prop: 'incomeAmount',
label: '到账金额',
},
]
const initForm = () => {
return {
projectName: '',
contractAmount: 0,
publisher: '',
serialNo: '',
publisherList: {id:'',name:''},
projectManagerList: {id:'',name:''},
mktManagerList: {id:'',name:''},
projectTime: '',
endTime: '',
}
}
const initSearchForm = () => {
return {
date: '',
signatureStatus: '',
onlyYear: false,
}
}
const toDtoSearchForm = (row) => {
const newForm = {...row}
newForm.year = getYear(newForm.date) || null
newForm.month = getMonth(newForm.date) || null
if (newForm.onlyYear) {
delete newForm.month
}
return newForm
}
export { columnsMap, initForm, initSearchForm, toDtoSearchForm }<file_sep>/src/api/mlms/common.js
import request from '@/router/axios'
const prefixUrl = '/mlms/contract'
//@/api/mlms/common
export function getContractListByName (query) {
return request({
url: `${prefixUrl}/name/contract/list`,
method: 'get',
params: query,
})
}
export function getProjecListByName (query) {
return request({
url: `${prefixUrl}/name/project/list`,
method: 'get',
params: query,
})
}<file_sep>/src/api/wel/relationship_manage.js
import request from '@/router/axios'
const prefixUrl = '/admin'
// @/api/wel/relationship_manage
export function getRelationshipManagePage (query) {
return request({
url: `${prefixUrl}/contacts/custom/contacts/page`,
method: 'get',
params: query,
})
}
//我关注的分页
export function getMyAttentionPage (query) {
return request({
url: '/cpms/iepuserfollow/address/page',
method: 'get',
params: query,
})
}
export function getRelationshipAddList () {
return request({
url: `${prefixUrl}/contacts/custom/group/list`,
method: 'get',
})
}
export function getRelationshipList () {
return request({
url: `${prefixUrl}/contacts/custom/contacts/list`,
method: 'get',
})
}
// export function getCustomList () {
// return request({
// url: `${prefixUrl}/contacts/custom/list`,
// method: 'get',
// })
// }
export function getTypeCountMap (query) {
return request({
url: `${prefixUrl}/contacts/custom/page`,
method: 'get',
params: query,
})
}
export function getMyMaster (query) {
return request({
url: '/cpms/iepcommoncharacterrelations/pageMyMaster',
method: 'get',
params: query,
})
}
export function getMyApprentice (query) {
return request({
url: '/cpms/iepcommoncharacterrelations/pageMyApprentice',
method: 'get',
params: query,
})
}
export function getMyMasterContactList () {
return request({
url: 'cpms/iepcommoncharacterrelations/listMyMasterDiy',
method: 'get',
})
}
export function getMyApprenticeContactList () {
return request({
url: 'cpms/iepcommoncharacterrelations/listMyApprenticeDiy',
method: 'get',
})
}
export function getMyAttentionContactList () {
return request({
url: '/cpms/iepuserfollow/follow/list',
method: 'get',
})
}//我的关注list
export function getRelationshipManageById (id) {
return request({
url: `${prefixUrl}/contacts/custom/${id}`,
method: 'get',
})
}
export function readRelationshipManageBatch (ids) {
return request({
url: `${prefixUrl}/contacts/custom/read_or_set/batch`,
method: 'post',
data: ids,
params: {
type: 8,
},
})
}
export function joinRelationship (obj) {
return request({
url: `${prefixUrl}/contacts/custom/create`,
method: 'post',
data: obj,
})
}
export function putRelationshipList (obj) {
return request({
url: `${prefixUrl}/contacts/custom/update`,
method: 'post',
data: obj,
})
}
export function deleteRelationshipList (id) {
return request({
url: `${prefixUrl}/contacts/custom/delete/${id}`,
method: 'post',
data: [id],
})
}
export function joinGroup (obj) {
return request({
url: `${prefixUrl}/custom/relation/create`,
method: 'post',
data: obj,
})
}
export function removeRelationshipById (customId, useId) {
return request({
url: `${prefixUrl}/custom/relation/delete/batch`,
method: 'post',
data: {
userId: useId,
customId: customId,
},
})
}
export function removeRelationshipBatch (customId, userId) {
return request({
url: `${prefixUrl}/custom/relation/delete/batch`,
method: 'post',
data: {
customId,
userId,
},
})
}
export function deleteReleaseApprenticeById (apprenticeId) {
return request({
url: `/cpms/iepcommoncharacterrelations/delApprenticeRelation/${apprenticeId}`,
method: 'post',
data: [apprenticeId],
})
}
export function deleteReleaseMentorById (mentorId) {
return request({
url: `/cpms/iepcommoncharacterrelations/delMentorRelation/${mentorId}`,
method: 'post',
data: [mentorId],
})
}
export function getRelationList () {
return request({
url: `${prefixUrl}/contacts/custom/contacts/list`,
method: 'get',
})
}
export function getContactsName () {
return request({
url: `${prefixUrl}/contacts/custom/contacts/name`,
method: 'get',
})
}<file_sep>/src/api/crms/organization_list.js
import request from '@/router/axios'
const prefixUrl = '/crm/organization'
export function getPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function getRecyclePage (query) {
return request({
url: `${prefixUrl}/recycle/page`,
method: 'get',
params: query,
})
}
export function deletePage (query) {
return request({
url: `${prefixUrl}/delete`,
method: 'post',
data: query,
})
}
export function deleteRecyclePage (data) {
return request({
url: `${prefixUrl}/recycle/delete`,
method: 'post',
data: data,
})
}
export function recoverRecyclePage (data) {
return request({
url: `${prefixUrl}/recycle/recover`,
method: 'post',
data: data,
})
}
export function addPage (obj) {
return request({
url: `${prefixUrl}/admin_create`,
method: 'post',
data: obj,
})
}
export function updatePage (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function getDetailPage (id) {
return request({
url: `${prefixUrl}/info/${id}`,
method: 'get',
})
}
export function getforbide (data) {
return request({
url: `${prefixUrl}/forbid`,
method: 'post',
data: data,
})
}
export function applyPass (data) {
return request({
url: `${prefixUrl}/apply_pass`,
method: 'post',
data: data,
})
}
export function applyReject (data) {
return request({
url: `${prefixUrl}/apply_reject`,
method: 'post',
data: data,
})
}
const prefixUrl2 = '/crm'
// @/api/tms/excel
function getDownload (path, fileName) {
return request({
url: `${prefixUrl2}${path}`,
method: 'post',
headers: {
'Content-Type': 'application/json',
},
responseType: 'arraybuffer',
}).then(response => {
// 处理返回的文件流
const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' })
const link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = `${fileName}.xls`
link.click()
})
}
// export function getTagExcelExport () {
// return getDownload('/import', '标签导出信息')
// }
// 提交
export function getModelExcel () {
return getDownload('/organization_excel/download', '导入模板')
}<file_sep>/src/views/wenjuan/mixins/treeTableMixin.js
import cloneDeep from 'lodash/cloneDeep'
export default {
watch: {
'tableTree.pagination.currentPage': {
handler (newVal) {
this.listQuery.page = cloneDeep(newVal)
},
deep: true,
immediate: true,
},
'tableTree.pagination.pageSize': {
handler (newVal) {
this.listQuery.limit = cloneDeep(newVal)
},
deep: true,
immediate: true,
},
'tableTree.pagination.total': {
handler (newVal) {
let total = newVal
let currentPage = this.tableTree.pagination.currentPage
let pageSize = this.tableTree.pagination.pageSize
if (total !== 0 && !(total > pageSize * (currentPage - 1))) {
let result = total / pageSize
let v = total <= pageSize * currentPage && total > pageSize * (currentPage - 1)
if (total / pageSize === 0 && !v) {
this.tableTree.pagination.currentPage = Math.ceil(result)
} else if (!v) {
this.tableTree.pagination.currentPage = Math.ceil(result)
}
setTimeout(() => {
this.getList()
}, 50)
}
},
deep: true,
},
},
} <file_sep>/src/views/wenjuan/components/govPagination/README.md
## 数据基因 通用分页
### 基础用法
> 基础分页
``` html
<gov-pagination
ref="pagination"
@currentChange="currentChange"
@sizeChange="sizeChange"
:pagination="pagination"/>
```
``` javascript
methods: {
// currentPage 改变时会触发
currentChange () {},
// pageSize 改变时会触发
sizeChange () {},
}
```
### 属性/方法/回调
> Attributes 属性
|属性|说明|可选值|默认值|
|:--:|--|:--:|--|
|pagination|分页参数||total: 0,currentPage: 1,pageSize: 10|
|props|当前页名称||currentPage: 'currentPage',pageSize: 'pageSize'|
> event 回调
|事件名称|说明|回调参数|
|--|--|--|
|currentChange|currentPage 改变时会触发|当前页|
|sizeChange|pageSize 改变时会触发|每页条数|<file_sep>/src/views/app/thoughtList/moreThoughts/option.js
export const initFormData = () => {
return {
address: '',
advantage: '',
age: 0,
appWay: '',
arrive: '',
attach: [],
attachFile: [],
avatar: '',
bear: '',
birthday: '',
blacklistArea: '',
blacklistReasons: '',
cities: [],
eduSituation: [],
education: '',
email: '',
health: '',
height: '',
hobbies: '',
honor: '',
id: '',
marriage: '',
name: '',
nation: '',
phone: '',
politics: '',
position: [],
positionId: 0,
positionName: '',
referrer: '',
relation: '',
result: '',
salary: '',
sex: 1,
source: '',
title: '',
trainingSituation: [],
university: '',
userCert: [],
weight: '',
workExperience: [],
workPlace: '',
}
}
export const rules = {
name: [
{ required: true, message: '必填', trigger: 'blur' },
],
phone: [
{ required: true, message: '必填', trigger: 'blur' },
],
position: [
{ required: true, message: '必填', trigger: 'change' },
],
}<file_sep>/src/api/rss/gms.js
import request from '@/router/axios'
export const prefixUrl = '/rss/gms'
// @/api/rss/gms
export function getRssGmsPage (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
<file_sep>/src/api/evaluate/projectStep.js
// 项目阶段
import request from '@/router/axios'
const queryUrl = '/evaluate/evaluatesection'
// 项目阶段删除
export function deleteData (id) {
return request({
url: `${queryUrl}/delete/${id}`,
method: 'post',
})
}
// 项目阶段保存
export function createData (params) {
return request({
url: `${queryUrl}/save`,
method: 'post',
data: params,
})
}
// 项目阶段修改
export function updateData (params) {
return request({
url: `${queryUrl}/update`,
method: 'post',
data: params,
})
}
// 项目阶段查询
export function getData (params) {
return request({
url: `${queryUrl}/select`,
method: 'get',
params: params,
})
}
<file_sep>/src/router/ics/index.js
import Layout from '@/page/index'
import { noKeepAlive } from '../config'
export default [
{
path: '/ics_spa',
component: Layout,
redirect: '/ics_spa/help_center',
children: [
{
path: 'help_center',
name: '智能帮助中心',
component: () => import(/* webpackChunkName: "ics" */'@/views/ics/helpCenter/index'),
meta: noKeepAlive,
},
],
},
]
<file_sep>/src/views/hrms/TrainingAssessment/TrainingRecord/options.js
import { mergeByFirst } from '@/util/util'
import { checkContactUser } from '@/util/rules'
const columnsMap = [
{
prop: 'trainingTheme',
label: '培训主题',
},
{
prop: 'trainerName',
label: '培训老师',
width:'100',
},
{
prop: 'startTime',
label: '开始时间',
width:'150',
},
{
prop: 'endTime',
label: '结束时间',
width:'150',
},
{
prop: 'type',
label: '培训类型',
width:'100',
},
{
prop: 'method',
label: '培训方式',
width:'100',
},
]
const rules = {
trainingTheme: [
{ required: true, message: '请输入主题', trigger: 'blur' },
],
user: [
{ required: true, validator: checkContactUser('培训老师'), trigger: 'blur' },
],
rangeTime: [
{ type: 'array', required: true, message: '请输入培训时间', trigger: 'blur' },
],
typeId: [
{ required: true, message: '请输入类型', trigger: 'blur' },
],
methodId: [
{ required: true, message: '请输入方法', trigger: 'blur' },
],
place: [
{ required: true, message: '请输入地点', trigger: 'blur' },
],
material: [
{ required: false, message: '请输入材料', trigger: 'blur' },
],
trainingTag: [
{ type:'array', required: true, message: '请选择标签', trigger: 'blur' },
],
trainingBrief: [
{ required: true, message: '请选择简介', trigger: 'blur' },
],
themePictures: [
{ required: true, message: '请上传图片', trigger: 'blur' },
],
}
const initForm = () => {
return {
id: null, // ID
trainingTheme: '', // 培训主题
teacher: '', // 培训老师
user: {
id: '',
name: '',
}, // 培训老师
rangeTime: [],
startTime: '', // 培训开始时间
endTime: '', // 培训结束时间
typeId: null, // 培训类型
methodId: '', // 培训方式
place: '', // 培训地点
material: [], // 培训材料(暂时无, 以后考虑)
materialList: [], // 关联材料(暂时无, 以后考虑)
attachFile: [], // 文件
trainingTag: [], // 标签
trainingBrief: '', // 简介
themePictures: '', // 图片
}
}
const formToVo = (row) => {
const newForm = mergeByFirst(initForm(), row)
newForm.rangeTime = [newForm.startTime, newForm.endTime]
newForm.material = row.attachFile || []
newForm.user = row.trainerList[0]
return newForm
}
const formToDto = (row) => {
const newForm = { ...row }
newForm.startTime = row.rangeTime[0]
newForm.endTime = row.rangeTime[1]
newForm.materialIds = row.materialList.map(m => m.id)
newForm.attachFileUrl = row.material.map(m => m.url)[0]
newForm.teacher = row.user.id
delete newForm.material
delete newForm.attachFile
return newForm
}
const initSearchForm = () => {
return {
trainingTheme: '',
teacher: '',
type: '',
date: '',
}
}
export { columnsMap, initForm, initSearchForm, rules, formToVo, formToDto }
<file_sep>/src/filters/index.js
import moment from 'moment'
import Nzh from 'nzh'
export function parseDate (date, formatString) {
if (date === undefined) {
return '暂无'
}
if (moment(date).isValid()) {
return moment(date).format(formatString)
} else {
return '暂无'
}
}
export function parseToTimeSeconds (time) {
return parseDate(time, 'YYYY-MM-DD HH:mm:ss')
}
export function parseToTimeMinutes (time) {
return parseDate(time, 'YYYY-MM-DD HH:mm')
}
export function parseToDay (time) {
return parseDate(time, 'YYYY-MM-DD')
}
export function parseToMonth (time) {
return parseDate(time, 'YYYY-MM')
}
export function parseToYear (time) {
return parseDate(time, 'YYYY')
}
export function parseToMonthDay (time) {
return parseDate(time, 'MM-DD')
}
export function formatTime (time) {
return moment(time).fromNow()
}
export function parseToMoney (money) {
return new Intl.NumberFormat().format(money)
}
export function parseToHanZiMoney (money) {
return Nzh.cn.encodeB(money)
}
export function parseToM (v) {
if (v === '-') {
return v
} else {
return parseToMoney(v)
}
}
export function parseToPercent (v, n = 2) {
return (v * 100).toFixed(n) + '%'
}<file_sep>/src/router/mlms/index.js
import Layout from '@/page/index/index'
import { noKeepAlive } from '../config'
export default [
{
path: '/mlms_spa',
component: Layout,
redirect: '/mlms_spa/summary/:id',
children: [
{
path: 'summary/detail/:id',
name: '查看纪要',
component: () => import(/* webpackChunkName: "mlms" */'@/views/mlms/material/summary/detail.vue'),
meta: noKeepAlive,
},
{
path: 'summary/create',
name: '新增纪要',
component: () => import(/* webpackChunkName: "mlms" */'@/views/mlms/material/summary/mainDialog.vue'),
meta: noKeepAlive,
},
{
path: 'summary/update/:id',
name: '修改纪要',
component: () => import(/* webpackChunkName: "mlms" */'@/views/mlms/material/summary/mainDialog.vue'),
meta: noKeepAlive,
},
{
path: 'material/create',
name: '新建文档',
component: () => import(/* webpackChunkName: "mlms" */'@/views/mlms/material/datum/material/newlyDialog.vue'),
meta: noKeepAlive,
},
{
path: 'material/detail/:id',
name: '查看文档',
component: () => import(/* webpackChunkName: "mlms" */'@/views/mlms/material/datum/material/detail.vue'),
meta: noKeepAlive,
},
{
path: 'aptitude/detail/:id',
name: '查看荣誉资质',
component: () => import(/* webpackChunkName: "mlms" */'@/views/mlms/material/datum/aptitude/detail.vue'),
meta: noKeepAlive,
},
{
path: 'contract/detail/:id',
name: '查看合同',
component: () => import(/* webpackChunkName: "mlms" */'@/views/mlms/material/datum/contract/detail.vue'),
meta: noKeepAlive,
},
{
path: 'email/detail/:id',
name: '查看邮件',
component: () => import(/* webpackChunkName: "mlms" */'@/views/mlms/email/detail/index'),
meta: noKeepAlive,
},
{
path: 'thought/detail/:id',
name: '查看说说',
component: () => import(/* webpackChunkName: "mlms" */'@/views/app/thoughtList/thoughtDetail/detail'),
meta: noKeepAlive,
},
{
path: 'subject/detail',
name: '说说话题详情',
component: () => import(/* webpackChunkName: "mlms" */'@/views/thought/admin/subject/detail'),
meta: noKeepAlive,
},
],
},
]
<file_sep>/src/views/fams/wealth/Fee/options.js
// import { checkContactUser } from '@/util/rules'
import { mergeByFirst } from '@/util/util'
import { feeStatus } from '@/const/invoiceConfig.js'
const dictsMap = {
payType: {
'0': '库存现金',
'1': '银行存款',
},
processStatus: {
0: '待核准',
1: '通过',
2: '驳回',
3: '转交',
},
status: feeStatus,
}
function initTableForm () {
return {
type: [],
bank: '',
amount: 0,
}
}
function initFlowForm () {
return {
costId: '',
bankId: '',
companyId: '',
payType: '0',
}
}
function initForm () {
return {
costId: '',
isSubstitute: 0,
orgId: '',
costFile: '',
ccOrgId: '',
orgName: '',
ccOrgName: '',
companyId: '',
ccCompanyId: '',
companyName: '',
ccCompanyName: '',
protocolId: '',
protocolName: '',
projectId: '',
projectName: '',
auditorId: '',
auditorName: '',
auditor: {
id: '',
name: '',
},
creatorName: '',
financeUserName: '',
status: '',
primaryAudit: '',
remarks: '',
financialAudit: 0,
relations: [],
processes: [],
}
}
const formToVo = (row) => {
const newForm = mergeByFirst(initForm(), row)
newForm.auditor = {
id: newForm.auditorId,
name: newForm.auditorName,
}
return newForm
}
const columnsMap = [
{
prop: 'costId',
label: 'ID',
width: 55,
},
{
prop: 'totalAmount',
label: '报销金额',
},
{
prop: 'createTime',
label: '申请日期',
},
{
prop: 'status',
label: '状态',
type: 'dict',
},
{
prop: 'auditorName',
label: '部门核准人',
},
]
const flowRules = {
bankId: [
{ required: true, message: '请选择支出账户', trigger: 'change' },
],
}
const rules = {
referType: [
{ required: true, message: '请选择报销类型', trigger: 'blur' },
],
orgId: [
{ required: true, message: '请选择报销组织', trigger: 'change' },
],
companyId: [
{ required: true, message: '请选择报销公司', trigger: 'change' },
],
ccOrgId: [
{ required: true, message: '请选择代缴组织', trigger: 'change' },
],
ccCompanyId: [
{ required: true, message: '请选择代缴公司', trigger: 'change' },
],
costFile: [
{ required: false, message: '请上传附件', trigger: 'blur' },
],
auditor: [
{ required: false, trigger: 'change' },
],
}
export {
columnsMap,
dictsMap,
rules,
flowRules,
initTableForm,
initForm,
initFlowForm,
formToVo,
}
<file_sep>/src/views/fams/FinancialManagement/SalaryManagement/options.js
// import { mergeByFirst } from '@/util/util'
const dictsMap = {
status: {
A: '已发送',
B: '未发送',
C: '待发送',
X: '回收站',
},
}
const columnsMap = [
{
prop: 'id',
label: 'ID',
width: '55',
},
{
prop: 'title',
label: '标题',
},
{
prop: 'status',
label: '状态',
type: 'dict',
},
{
prop: 'payrollTime',
label: '工资单时间',
},
{
prop: 'createTime',
label: '上传时间',
},
]
const detailColumnsMap = [
{
prop: 'id',
label: 'ID',
},
{
prop: 'staffId',
label: '工号',
},
{
prop: 'realName',
label: '姓名',
},
{
prop: 'postTaxWage',
label: '税后工资',
},
{
prop: 'bankPay',
label: '银行代发',
},
{
prop: 'innerPay',
label: '内网发放',
},
{
prop: 'sendTime',
label: '发送时间',
},
]
const payRollForm = () => {
return {
staffId: '', //工号
realName: '', //姓名
joinTime: '', //入职时间
duties: '',//职务
positional: '',//职称
postTaxWage: '',//税后工资/实发工资
bankPay: '',//银行代发
innerPay: '',//内网发放
cashPay: '',//现金发放
basicPay: '',//基本工资
jobSubsidy: '',//职务补贴
titleSubsidy: '',//职称补贴
manageAllowance: '',//管理津贴
urbanSubsidy: '',//城市补贴
serviceAllowance: '',//工龄补贴
basicPaySubtotal: '',//基本工资小计
thanksgivingFund: '',//浮动工资-感恩基金
computerAid: '',//浮动工资-电脑补助
fullTime: '',//浮动工资-全勤
managerAward: '',//浮动工资-总经理特别奖
floatingWageSubtotal: '',//浮动工资-小计
totalWagePayable: '',//应发工资-总计
leaveDays: '',//扣发事项-事假(天)
leaveAmount: '',//扣发事项-事假(金额)
sickLeaveDays: '',//扣发事项-病假(天)
sickLeaveAmount: '',//扣发事项-病假(金额)
lateLeaveEarly: '',//扣发事项-迟到早退
lateOtherAmount: '',//扣发事项-其他扣/补发事项
preTaxWage: '',//扣发事项-税前工资/应发工资
withHoldingFund: '',//代扣代缴-感恩基金
socialInsurance: '',//代扣代缴-社保
providentFund: '',//代扣代缴-公积金
taxBasicNumber: '',//代扣代缴-个税计提基数
personalIncomeTax: '',//代扣代缴-个人所得税
preTaxSalary: '',//人员成本-人员税前工资
socialInsuranceCompanySection: '',//人员成本-社保公司部分
providentFundCompanySection: '',//人员成本-公积金公司部分
bonus: '',//人员成本-奖金
otherIncome: '',//人员成本-其他收益
totalStaffCosts: '',//人员成本-总计
}
}
export { columnsMap, dictsMap, detailColumnsMap, payRollForm }<file_sep>/src/api/evaluate/management.js
import request from '@/router/axios'
const queryUrl = '/evaluate/evaluateintegratedreview'
//获取指标体系内容
export function getIndexSydtems (query) {
return request({
url: `${queryUrl}/getIndexSydtems`,
method: 'get',
params: query,
})
}
//获取参评单位 /evaluategrouping/select
export function getGroups (query) {
return request({
url: '/evaluate/evaluategrouping/select',
method: 'get',
params: query,
})
}
//根据项目id和部门id和指标id获取单条工单内容
export function getInfo (query) {
return request({
url: `${queryUrl}/getInfo`,
method: 'get',
params: query,
})
}
//更新审核流转
export function updateReviewFlow (data) {
return request({
url: `${queryUrl}/update`,
method: 'post',
data: data,
})
}
//获取同级/evaluateintegratedreview/statistical
export function statistical (query) {
return request({
url: `${queryUrl}/statistical`,
method: 'get',
params: query,
})
}
//获取项目成员
export function getMembers (id) {
return request({
url: `/evaluate/evaluateproject/member/${id}`,
method: 'get',
})
}
//获取工单汇总
export function getSummary (query) {
return request({
url: '/evaluate/evaluatedailyreview/statistic',
method: 'get',
params: query,
})
}
//获取工单汇总 根据参评单位
export function getSummaryByDept (query) {
return request({
url: '/evaluate/evaluatedailyreview/pageByEligibleUnitsId',
method: 'get',
params: query,
})
}
//待我审核
export function getPageByUser (query) {
return request({
url: '/evaluate/evaluatedailyreview/pageByUser',
method: 'get',
params: query,
})
}
//根据工单id单条查看
export function getWorkById (id) {
return request({
url: `/evaluate/evaluatedailyreview/${id}`,
method: 'get',
})
}
//根据项目id获取指标体系
export function getSystemIndex (params) {
return request({
url: '/evaluate/evaluatedailyreview/getIndexSydtems',
method: 'get',
params: params,
})
}
//新建工单
export function saveWork (data) {
return request({
url: '/evaluate/evaluatedailyreview/save',
method: 'post',
data: data,
})
}
//修改工单
export function updateWork (data) {
return request({
url: '/evaluate/evaluatedailyreview/update',
method: 'post',
data: data,
})
}
//获取日常评测列表
export function getDailyList (params) {
return request({
url: '/evaluate/evaluatedailyreview/particularsByProject',
method: 'get',
params: params,
})
}
// 获取综合评测列表
export function getComList (params) {
return request({
url: '/evaluate/evaluateintegratedreview/particularsByProject',
method: 'get',
params: params,
})
}
<file_sep>/src/views/conm/ColumnManagement/options.js
import { mergeByFirst } from '@/util/util'
const dictsMap = {
status: {
0: '停用',
1: '启用',
},
}
const initForm = () => {
return {
parentId: '',
nodeDescribe: '',
// modelId: '',
nodeNumber: '',
nodeName: '',
status: 1,
tagKeyWords: [],
}
}
const toNewParentForm = (row) => {
return mergeByFirst(initForm(), {
parentId: row.id || 0,
parentName: row.name || '无',
})
}
const toDtoForm = (row) => {
const newForm = { ...row }
newForm.type = newForm.type[1]
newForm.parentType = newForm.type[0]
return newForm
}
const initMergeForm = () => {
return {
delete: '',
oldOrNew: '',
}
}
const columnsMap = [
{
prop: 'nodeName',
label: '栏目名称',
},
{
prop: 'nodeNumber',
label: '栏目编码',
},
{
prop: 'status',
label: '状态',
type: 'dict',
},
]
const initSearchForm = () => {
return {
}
}
const rules = {
nodeName: [{
required: true,
message: '请输入栏目名称',
trigger: 'blur',
}],
nodeNumber: [{
required: true,
message: '请输入栏目名称',
trigger: 'blur',
}],
}
export { dictsMap, columnsMap, initForm, initMergeForm, toNewParentForm, toDtoForm, initSearchForm, rules }<file_sep>/src/api/fams/investment.js
import request from '@/router/axios'
const prefixUrl = '/fams/investment'
// @/api/fams/investment
export function getInvestmentPage (query) {
return request({
url: `${prefixUrl}/list/page`,
method: 'get',
params: query,
})
}
export function getJoinInvestmentPage (query) {
return request({
url: `${prefixUrl}/join/page`,
method: 'get',
params: query,
})
}
export function getInvestmentPersonPage (query) {
return request({
url: `${prefixUrl}/relation/page`,
method: 'get',
params: query,
})
}
/**
* 我的统计
*/
export function getMySharesValue () {
return request({
url: `${prefixUrl}/my/shares/value`,
method: 'get',
})
}
export function getInvestmentById (id) {
return request({
url: `${prefixUrl}/detail/${id}`,
method: 'get',
})
}
export function upInvestmentById (id) {
return request({
url: `${prefixUrl}/up/${id}`,
method: 'post',
})
}
export function downInvestmentById (id) {
return request({
url: `${prefixUrl}/down/${id}`,
method: 'post',
})
}
export function rollbackInvestmentById (id) {
return request({
url: `${prefixUrl}/recall/${id}`,
method: 'post',
})
}
export function postInvestment (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function joinInvestment (obj) {
return request({
url: `${prefixUrl}/join`,
method: 'post',
data: obj,
})
}
export function putInvestment (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function deleteInvestmentById (id) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: [id],
})
}
export function deleteInvestmentBatch (ids) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}
export function ReviewInvestmentBatch (obj) {
return request({
url: `${prefixUrl}/pass/batch`,
method: 'post',
data: obj,
})
}
export function PersonInvestmentBatch (obj) {
return request({
url: `${prefixUrl}/join/pass/batch`,
method: 'post',
data: obj,
})
}
export function getShareStatistics (id) {
return request({
url: `${prefixUrl}/share/statistics/${id}`,
method: 'get',
})
}
export function getReleaseRecordPage (query) {
return request({
url: `${prefixUrl}/release/record/page`,
method: 'get',
params: query,
})
}
export function getRelationPage (query) {
return request({
url: `${prefixUrl}/relation/page`,
method: 'get',
params: query,
})
}
export function getReleasePage (query) {
return request({
url: `${prefixUrl}/release/page`,
method: 'get',
params: query,
})
}
export function getShareholderPage (query) {
return request({
url: `${prefixUrl}/shareholder/page`,
method: 'get',
params: query,
})
}
export function getShareList (id) {
return request({
url: `${prefixUrl}/share/list/${id}`,
method: 'get',
})
}
export function changeRelease (obj) {
return request({
url: `${prefixUrl}/change/release`,
method: 'post',
data: obj,
})
}
export function postShareholder (obj) {
return request({
url: `${prefixUrl}/create/shareholder`,
method: 'post',
data: obj,
})
}
export function putShareholder (obj) {
return request({
url: `${prefixUrl}/update/shareholder`,
method: 'post',
data: obj,
})
}
export function delShareholder (id) {
return request({
url: `${prefixUrl}/delete/shareholder/${id}`,
method: 'post',
})
}
//财务报表
export function getStatements (query) {
return request({
url: `${prefixUrl}/org/statements`,
method: 'get',
params: query,
})
}
//图表数据
export function getChartData (query) {
return request({
url: `${prefixUrl}/stock/price/list`,
method: 'get',
params: query,
})
}
//项目新增请求接口
export function getProjectAnnouncement (obj) {
return request({
url: `${prefixUrl}/notification/create`,
method: 'post',
data: obj,
})
}
/**
* 我的持仓分页
* @param {*} query
*/
export function getMyPositionPage (query) {
return request({
url: `${prefixUrl}/my/page`,
method: 'get',
params: query,
})
}
/**
* 我的交易记录分页
* @param {*} query
*/
export function getMyTransactionPage (query) {
return request({
url: `${prefixUrl}/my/transaction`,
method: 'get',
params: query,
})
}
/**
* 我的退股记录分页
* @param {*} query
*/
export function getWithdrawPage (query) {
return request({
url: `${prefixUrl}/withdraw/page`,
method: 'get',
params: query,
})
}
/**
* 我的股权书
* @param {} query
*/
export function getMyBookPage (query) {
return request({
url: `${prefixUrl}/my/book/page`,
method: 'get',
params: query,
})
}
/**
* 退股
* @param {*} id
*/
export function getWithdrawById (id) {
return request({
url: `${prefixUrl}/withdraw/share/${id}`,
method: 'get',
})
}
export function notificationCreate (obj) {
return request({
url: `${prefixUrl}/notification/create`,
method: 'post',
data: obj,
})
}
//公告分页
export function getNotificationPage (query) {
return request({
url: `${prefixUrl}/notification/page`,
method: 'get',
params: query,
})
}<file_sep>/src/api/mlms/email/material.js
import request from '@/router/axios'
const materialUrl = '/mlms/material'
// 材料
export function getReceiverList (params) {
return request({
url: `${materialUrl}/page`,
method: 'get',
params: params,
})
}
// 项目-全部
export function getProjectAll (params) {
return request({
url: '/fams/iepProjectInformation/getList',
method: 'get',
params: params,
})
}
// 项目-分页
export function getProjectList (obj) {
return request({
url: '/fams/iepProjectInformation/page',
method: 'get',
params: obj,
})
}
<file_sep>/src/views/mlms/material/datum/material/option.js
export const dictsMap = {
type: {
'1': '类型1',
'2': '类型2',
},
isYes: [
{ value: 0, lable: '否' },
{ value: 1, label: '是' },
],
isOpen: [
{ value: 0, lable: '开放' },
{ value: 1, label: '关闭' },
],
secrecyLevel: [
{ value: 0, lable: '不保密' },
{ value: 1, label: '保密' },
],
}
export const tableOption = [
{
label: '创建时间',
prop: 'createTime',
width: '250',
}, {
label: '浏览次数',
prop: 'views',
width: '150',
},
]
export function initSearchForm () {
return {
name: '',
materialClsFirstClass: '',
materialClsSecondClass: '',
materialType: '',
format: '',
downloadCost: '',
creatorRealName: '',
}
}
// 本地上传
export const initLocalForm = () => {
return {
uploader: '',
type: 0,
id: '',
materialName: '',
intro: '',
content: '',
firstClass: '',
secondClass: '',
materialType: '',
tagKeyWords: [],
isContri: 0,
attachFileList: [],
attachFile: '',
isOpen: 0,
secrecyLevel: 0,
}
}
// 新建文档
export const initFormData = () => {
return {
uploader: '',
type: 1,
id: '',
materialName: '',
intro: '',
content: '',
firstClass: '',
secondClass: '',
materialType: '',
downloadCost: '',
tagKeyWords: [],
attachFileList: [],
isOpen: 2,
secrecyLevel: 0,
}
}
export const initForm = () => {
return {
uploader: '',
id: '',
materialName: '',
intro: '',
content: '',
firstClass: '',
secondClass: '',
materialType: '',
downloadCost: '',
tagKeyWords: [],
isContri: 0,
attachFileList: [],
attachFile: '',
isOpen: 2,
secrecyLevel: 0,
}
}
var tagKeyWords = (rule, value, callback) => {
if (value.length < 3) {
callback(new Error())
} else {
callback()
}
}
export const rules = {
materialName: [
{ required: true, message: '请输入材料名称', trigger: 'blur' },
],
intro: [
{ required: true, message: '请输入材料介绍', trigger: 'blur' },
],
content: [
{ required: true, message: '请输入正文内容', trigger: 'blur' },
],
firstClass: [
{ required: true, message: '请选择分类', trigger: 'change' },
],
secondClass: [
{ required: true, message: '请选择二级分类', trigger: 'change' },
],
materialType: [
{ required: true, message: '请选择类型', trigger: 'change' },
],
tagKeyWords: [
{ required: true, message: '请输入至少3个标签', trigger: 'change' },
{ validator: tagKeyWords, message: '请输入至少3个标签', trigger: 'change' },
],
isContri: [
{ required: true, message: '必填', trigger: 'change' },
],
downloadCost: [
{ required: true, message: '必填', trigger: 'change' },
],
uploader: [
{ required: true, message: '必填', trigger: 'change' },
],
isOpen: [
{ required: true, message: '必填', trigger: 'change' },
],
secrecyLevel: [
{ required: true, message: '必填', trigger: 'change' },
],
attachFileList: [
{ required: true, message: '必填', trigger: 'change' },
],
}
export const tipContent = {
materialName: '日期+项目名称/发文部门(单位)+材料主题+文件阶段标识,例如20190101资产管理与投融资委员会内网国脉贝管理办法v1.0',
uploader:'作者为该材料撰写者,系统默认读取上传人为作者,如作者为其他人请做修改',
intro:'1、材料内容主旨说明,如选取文中重要的段落;<br/>' +
'2、字数控制在200字以内',
content:'1、文章字体为默认字体;<br/>' +
'2、文章标题标注使用规范:<br/>' +
'①一级标题用一、二、三等标注;<br/>' +
'②二级标题用(一)、(二)、(三)等标注;<br/>' +
'③三级标题用1、2、3等标注;<br/>' +
'④四级标题用(1)、(2)、(3)等标注;<br/>',
firstClass:'根据材料主题准确选择分类,确保分类的准确性!',
materialType:'根据材料实际性质进行选择,如方案,报告,清单等',
downloadCost:'全体或多数国脉人需知晓的公司制度、文件、新生必读、分享培训等材料均不设定下载贝额,其余材料可自行设定,如材料质量与价格不符被纠错/差评/投诉将影响个人信用分。',
tagKeyWords:'标签要突出材料主题且按照重要性排序,其中提及的合作项目简称,合作产品,客户简称等必须作为标签;',
attachFileList:'附件仅支持DOC、PPT、TXT、PDF、XLS等形式的一个文件,大小限制在200M以内',
}
export const tipContent2 = {
materialName:'1、文件主题+类型:如浙江省政府数字化转型的几点思考;(名称中切勿出现特殊符号)',
intro:'1、材料内容主旨说明;<br/>' +
'2、字数在50字以上',
content:'1、文章字体为默认字体;<br/>' +
'2、文章标题标注使用规范:<br/>' +
'①一级标题用一、二、三等标注;<br/>' +
'②二级标题用(一)、(二)、(三)等标注;<br/>' +
'③三级标题用1、2、3等标注;<br/>' +
'④四级标题用(1)、(2)、(3)等标注;<br/>',
firstClass:'根据材料主题准确选择分类,确保分类的准确性!',
materialType:'根据材料实际性质进行选择,如方案,报告,清单等',
tagKeyWords:'标签要突出材料主题且按照重要性排序,其中提及的合作项目简称,合作产品,客户简称等必须作为标签;',
}<file_sep>/src/api/mlms/material/report/daily.js
import request from '@/router/axios'
const prefixUrl = '/mlms/dailyreport'
export function getTableData (params) {
return request({
url: `${prefixUrl}/list`,
method: 'post',
data: params,
})
}
export function createData (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function updateData (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
<file_sep>/src/views/fams/RuleConfiguration/PersonalAccountManagement/options.js
// org config options
const dictsMap = {
accountStatus: {
0: '正常',
1: '冻结',
},
}
const columnsMap = [
{
prop: 'staffNo',
label: '工号',
},
{
prop: 'realName',
label: '姓名',
},
{
prop: 'orgName',
label: '所属组织',
width: '200',
type: 'detail',
},
{
prop: 'balance',
label: '国脉贝',
},
{
prop: 'frozenAmount',
label: '冻结金额',
},
{
prop: 'availableAmount',
label: '发票可用额度',
width: '120',
},
{
prop: 'investmentAmount',
label: '投资',
},
{
prop: 'accountStatus',
label: '状态',
type: 'dict',
},
]
const initSearchForm = () => {
return {
orgName: '',
accountStatus: '',
}
}
export { dictsMap, columnsMap, initSearchForm }<file_sep>/src/router/app/policyRoute.js
export default [
{
path: 'general',
name: '通用政策',
icon: 'icon-dangan',
component: () => import('@/views/app/policyCenter/general/'),
children: [
{
path: 'general_detail/:id',
name: '通用政策详情',
component: () => import('@/views/app/policyCenter/detail'),
},
],
},
{
path: 'declare',
name: '申报政策',
icon: 'icon-dangan',
component: () => import('@/views/app/policyCenter/declare/'),
children: [
{
path: 'declare_detail/:id',
name: '申报政策详情',
component: () => import('@/views/app/policyCenter/detail'),
},
],
},
{
path: 'analysis',
name: '政策解读',
icon: 'icon-dangan',
component: () => import('@/views/app/policyCenter/analysis/'),
children: [
{
path: 'analysis_detail/:id',
name: '政策解读详情',
component: () => import('@/views/app/policyCenter/detail'),
},
],
},
{
path: 'information',
name: '政策资讯',
icon: 'icon-dangan',
component: () => import('@/views/app/policyCenter/information/'),
children: [
{
path: 'information_detail/:id',
name: '政策资讯详情',
component: () => import('@/views/app/policyCenter/detail'),
},
],
},
]<file_sep>/src/api/gpms/fas.js
import request from '@/router/axios'
const prefixUrl = '/fams/payment'
const InformationUrl = '/fams/iepProjectInformation'
// @/api/gpms/fas
export function getPaymentPlanPage (obj) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: obj,
})
}
export function getOrgPaymentPlanPage (obj) {
return request({
url: `${prefixUrl}/org/page`,
method: 'get',
params: obj,
})
}
export function getOrgPaymentPlanPageByOrgId (orgId) {
return function (query) {
return request({
url: `${prefixUrl}/org/page/${orgId}`,
method: 'get',
params: query,
})
}
}
export function getUnionBudgetList (year) {
return request({
url: `/fams/income/group/${year}`,
method: 'get',
})
}
export function getOrgBudgetList (query) {
return request({
url: '/fams/income/org',
method: 'get',
params: query,
})
}
export function getOrgMonthBudgetList (query) {
return request({
url: '/fams/income/org/month',
method: 'get',
params: query,
})
}
export function getProjectPaymentPlanList (id) {
return request({
url: `${InformationUrl}/getPaymentList/${id}`,
method: 'get',
})
}
export function getProjectInvoiceingList (id) {
return request({
url: `/fams/statistics/project/invoiceing/${id}`,
method: 'get',
})
}
export function getIssuedList (id) {
return request({
url: `${InformationUrl}/getAmount/${id}`,
method: 'get',
})
}
export function updatePayment (obj) {
return request({
url: `${InformationUrl}/updateAmount`,
method: 'post',
data: obj,
})
}
export function updateIssued (obj) {
return request({
url: `${InformationUrl}/updateAmount`,
method: 'post',
data: obj,
})
}
// 项目公海
export function getProjectPage (parmas) {
return request({
url: `${InformationUrl}/page`,
method: 'get',
params: parmas,
})
}
// 公海取消认领
export function statusCancel (list) {
return request({
url: `${InformationUrl}/status/cancel`,
method: 'post',
data: { ids: list },
})
}
// 公海确定认领
export function statusDefine (list) {
return request({
url: `${InformationUrl}/status/define`,
method: 'post',
data: { ids: list },
})
}<file_sep>/src/router/fams/index.js
import Layout from '@/page/index/index'
export default [
{
path: '/fams_spa',
component: Layout,
redirect: '/fams_spa/withdraw_detail',
children: [
{
path: 'withdraw_detail/:id',
name: '提现详情',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/wealth/Withdraw/Detail.vue'),
},
{
path: 'salary_detail/:id',
name: '工资管理详情',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/FinancialManagement/SalaryManagement/Detail.vue'),
},
{
path: 'salary_person_detail/:id',
name: '工资管理个人详情',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/FinancialManagement/SalaryManagement/PersonDetail.vue'),
},
// WARNING: 字典项不要删除
{
path: 'payroll_detail/:id',
name: '工资条',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/FinancialManagement/SalaryManagement/PayrollDetail.vue'),
},
{
path: 'invoice_detail/:id',
name: '报销详情',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/wealth/Invoice/Detail.vue'),
},
{
path: 'invoice_edit/:id',
name: '报销编辑',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/wealth/Invoice/Edit.vue'),
},
{
path: 'fee_detail/:id',
name: '费用详情',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/wealth/Fee/Detail.vue'),
},
{
path: 'fee_edit/:id',
name: '费用编辑',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/wealth/Fee/Edit.vue'),
},
{
path: 'billing_edit/:id',
name: '开票编辑',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/wealth/BillingNotice/Edit.vue'),
},
{
path: 'billing_detail/:id',
name: '开票详情',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/wealth/BillingNotice/Detail.vue'),
},
{
path: 'fund_transfer_edit/:id',
name: '新增资金调拨',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/GroupFinance/FundTransfer/Edit.vue'),
},
{
path: 'fund_transfer_detail/:id',
name: '资金调拨详情',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/GroupFinance/FundTransfer/Detail.vue'),
},
{
path: 'org_borrow_detail/:id',
name: '组织拆借详情',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/OrgBorrow/Components/OrgBorrowDetail/index.vue'),
},
{
path: 'management_edit/:id',
name: '新增投资管理',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/Investment/Management/Edit.vue'),
},
{
path: 'change_shareholder/:id',
name: '变更股东',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/Investment/Management/ChangeShareholder/index.vue'),
},
{
path: 'union_borrow_detail/:id',
name: '集团拆借详情',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/OrgBorrow/Components/UnionBorrowDetail/index.vue'),
},
{
path: 'accounts_receivable',
name: '合同应收账款',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/FinancialManagement/WorkBench/AccountsReceivableDetail/index.vue'),
},
{
path: 'other_receivables',
name: '其他应收款',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/FinancialManagement/WorkBench/OtherReceivablesDetail/index.vue'),
},
{
path: 'project_accounting/:id',
name: '项目核算详情',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/OrgAssets/ProjectAccounting/Detail.vue'),
},
{
path: 'organization_transfer',
name: '组织转账',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/OrgAssets/OrganizationTransfer/index.vue'),
},
{
path: 'organization_reward',
name: '组织打赏/扣减',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/OrgAssets/OrganizationReward/index.vue'),
},
{
path: 'group_reward',
name: '集团打赏/扣减(组织)',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/GroupFinance/GroupReward/index.vue'),
},
{
path: 'group_reward_user',
name: '集团打赏/扣减(个人)',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/GroupFinance/GroupRewardUser/index.vue'),
},
{
path: 'wealth_flow/:id',
name: '提现申请(个人)',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/wealth/WealthFlow/index.vue'),
},
{
path: 'project/:id',
name: '项目核算',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/OrgAssets/ProjectAccounting/index.vue'),
},
{
path: 'org_payment_plan/:id',
name: '组织回款计划',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/OrgAssets/PaymentPlan/index.vue'),
},
{
path: 'union_payment_plan',
name: '集团回款计划',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/GroupFinance/PaymentPlan/index.vue'),
},
{
path: 'business_indicator',
name: '本组织业务指标',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/OrgAssets/BusinessIndicator/index.vue'),
},
{
path: 'union_month_lf',
name: '集团月份盈亏',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/GroupFinance/UnionProfitAndLoss/MonthDetail/index.vue'),
},
{
path: 'iep_fee',
name: '内网使用费',
component: () => import(/* webpackChunkName: "fams" */'@/views/fams/GroupFinance/IepFee/index.vue'),
},
],
},
]
<file_sep>/src/api/hrms/cover.js
import request from '@/router/axios'
const prefixUrl = '/hrms/cover'
const detailsUrl = '/hrms/details'
const kpiUrl = '/hrms/kpi'
export function getAssessmentPage (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
export function createEvaluatio (obj) {
return request({
url: `${detailsUrl}/create`,
method: 'post',
data: obj,
})
}
export function deleteEvaluation (id) {
return request({
url: `${prefixUrl}/delete/${id}`,
method: 'post',
})
}
// 查询创建考核所需内容
export function getEvaluationCreateKpi (id) {
return request({
url: `${prefixUrl}/create_kpi/${id}`,
method: 'get',
})
}
// 待考核分页
export function getEvaluationKpiPage (params) {
return request({
url: `${prefixUrl}/kpi_page`,
method: 'get',
params: params,
})
}
// 自评分页
export function getEvaluationSelfPage (params) {
return request({
url: `${prefixUrl}/self_page`,
method: 'get',
params: params,
})
}
// 考核
export function createKpi (obj) {
return request({
url: `${kpiUrl}/create`,
method: 'post',
data: obj,
})
}
// 获取考核详情
export function getCoverDetail (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
<file_sep>/src/views/fams/wealth/Withdraw/options.js
import { mergeByFirst } from '@/util/util'
const dictsMap = {
status: {
'0': '待审',
'1': '待发放',
'2': '已发放',
'3': '提现失败',
'4': '提现失败',
},
}
const columnsMap = [
{
prop: 'amount',
label: '提现金额',
},
{
prop: 'deductionInvoice',
label: '发票抵扣金额',
},
{
prop: 'taxation',
label: '税费',
},
{
prop: 'status',
label: '状态',
type: 'dict',
},
{
prop: 'auditorName',
label: '核准人',
},
{
prop: 'createTime',
label: '申请日期',
},
{
prop: 'auditingTime',
label: '核准日期',
},
{
prop: 'grantTime',
label: '发放日期',
},
{
prop: 'remarks',
label: '备注',
type: 'detail',
},
]
const initForm = () => {
return {
'amount': 0,
'deductionInvoice': 0,
}
}
const formToDto = (form) => {
const newForm = mergeByFirst(initForm(), form)
newForm.positionId = form.position[form.position.length - 1]
return newForm
}
const initSearchForm = () => {
return {
}
}
const rules = {
amount: [
{ required: true, message: '账户余额1000以上且输入100以上数字', trigger: 'blur', type: 'number', min: 100 },
],
deductionInvoice: [
{ required: true, message: '在用户发票额度范围内', trigger: 'blur', type: 'number', min: 0 },
],
}
export { columnsMap, dictsMap, initForm, initSearchForm, formToDto, rules }<file_sep>/src/views/fams/FinancialManagement/BillingNotice/options.js
// import { mergeByFirst } from '@/util/util'
const dictsMap = {
status: {
0: '待提交',
1: '待确认',
2: '已确认',
3: '拒绝',
},
}
const columnsMap = [
{
prop: 'creatorName',
label: '申请人',
},
{
prop: 'buyerName',
label: '购买方',
},
{
prop: 'companyName',
label: '销售方',
type: 'detail',
},
{
prop: 'amount',
label: '开票金额',
},
{
prop: 'createTime',
label: '申请日期',
width: '150',
},
{
prop: 'status',
label: '状态',
type: 'dict',
},
{
prop: 'auditorName',
label: '核准人',
},
{
prop: 'auditingTime',
label: '核准日期',
width: '150',
},
]
export { dictsMap, columnsMap }<file_sep>/src/plugins/ant-design.js
/* eslint-disable */
/**
* 该文件是为了按需加载,剔除掉了一些不需要的框架组件。
* 减少了编译支持库包大小
*
* 当需要更多组件依赖时,在该文件加入即可
*/
import Vue from 'vue'
import {
LocaleProvider,
// Layout,
Input,
// InputNumber,
Button,
Switch,
// Radio,
// Checkbox,
Select,
Card,
// Form,
Row,
Col,
Modal,
// Table,
// Tabs,
Icon,
// Badge,
// Popover,
Dropdown,
List,
Avatar,
// Breadcrumb,
Steps,
Spin,
Menu,
Drawer,
Tooltip,
// Alert,
Tag,
Divider,
// DatePicker,
// TimePicker,
Timeline,
// Upload,
// Progress,
Skeleton,
Popconfirm,
// message,
// notification,
// AutoComplete,
} from 'ant-design-vue'
// import VueCropper from 'vue-cropper'
Vue.use(LocaleProvider)
// Vue.use(Layout)
Vue.use(Input)
// Vue.use(AutoComplete)
// Vue.use(InputNumber)
Vue.use(Button)
Vue.use(Switch)
// Vue.use(Radio)
// Vue.use(Checkbox)
Vue.use(Select)
Vue.use(Card)
// Vue.use(Form)
Vue.use(Row)
Vue.use(Col)
Vue.use(Modal)
// Vue.use(Table)
// Vue.use(Tabs)
Vue.use(Icon)
// Vue.use(Badge)
// Vue.use(Popover)
Vue.use(Dropdown)
Vue.use(List)
Vue.use(Avatar)
// Vue.use(Breadcrumb)
Vue.use(Steps)
Vue.use(Spin)
Vue.use(Menu)
Vue.use(Drawer)
Vue.use(Tooltip)
// Vue.use(Alert)
Vue.use(Tag)
Vue.use(Divider)
// Vue.use(DatePicker)
// Vue.use(TimePicker)
Vue.use(Timeline)
// Vue.use(Upload)
// Vue.use(Progress)
Vue.use(Skeleton)
Vue.use(Popconfirm)
// Vue.use(VueCropper)
// Vue.use(notification)
Vue.prototype.$antConfirm = Modal.confirm
// Vue.prototype.$message = message
// Vue.prototype.$notification = notification
// Vue.prototype.$info = Modal.info
// Vue.prototype.$success = Modal.success
// Vue.prototype.$error = Modal.error
// Vue.prototype.$warning = Modal.warning<file_sep>/src/api/tms/index.js
import request from '@/router/axios'
const prefixUrl = '/tms/tag'
// @/api/tms/index
export function getTagList (query) {
return request({
url: `${prefixUrl}/list`,
method: 'get',
params: query,
})
}<file_sep>/src/api/mlms/material/summary.js
import request from '@/router/axios'
const prefixUrl = '/mlms/meeting'
const catalogueUrl = '/mlms/catalogue'
export function getTableData (obj) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: obj,
})
}
// 根据客户id获取拜访纪要分页
export function getVisitListData (obj) {
return request({
url: `${prefixUrl}/page/visitList`,
method: 'get',
params: obj,
})
}
// 我发布的
export function getTablePersonal (obj) {
return request({
url: `${prefixUrl}/page/personal`,
method: 'get',
params: obj,
})
}
// 我参与的
export function getTableMyInvolved (obj) {
return request({
url: '/mlms/meeting/MyInvolved/page',
method: 'get',
params: obj,
})
}
// 我收到的
export function getTableMyReceived (obj) {
return request({
url: '/mlms/meeting/MyReceived/page',
method: 'get',
params: obj,
})
}
export function getDataById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function createData (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function updateData (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function deleteData (ids) {
if (typeof ids == 'number') {
ids = [ids]
}
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}
// 收藏
export function createCollect (obj) {
return request({
url: '/mlms/farelation/create',
method: 'post',
data: obj,
})
}
// 收藏的列表
export function collectList () {
return request({
url: `${catalogueUrl}/tree`,
method: 'get',
})
}
// 收藏列表新增
export function createCollectList (obj) {
return request({
url: `${catalogueUrl}/create`,
method: 'post',
data: obj,
})
}
// 复制
export function copyData (id) {
return request({
url: `${prefixUrl}/copy/${id}`,
method: 'get',
})
}
// 发送
export function meetingSend (id) {
return request({
url: `${prefixUrl}/send/${id}`,
method: 'post',
})
}
// 获取本周统计数据
export function getCount (obj) {
return request({
url: `${prefixUrl}/getCount`,
method: 'post',
data: obj,
})
}
//删除关联客户拜访日志
export function deleteVisitLog (id) {
return request({
url: `${prefixUrl}/deleteRelation/batch`,
method: 'post',
data: [id],
})
}<file_sep>/src/views/fams/GroupFinance/CurrencyFund/Company/options.js
const columnsMap = [
{
prop: 'name',
label: '公司',
},
{
prop: 'cashBalance',
label: '现金余额',
width:'150',
},
{
prop: 'bankBalance',
label: '银行余额',
width:'150',
},
]
export { columnsMap }<file_sep>/src/views/BlockChain/Issued/options.js
import { checkContactUser } from '@/util/rules'
const columnsMap = [
{
prop: 'id',
label: 'ID',
width: '55',
},
{
prop: 'hash',
label: '哈希值',
minWidth: '200',
type: 'detail',
},
{
prop: 'sender',
label: '发送者',
width: '100',
},
{
prop: 'receiver',
label: '接收者',
width: '100',
},
{
prop: 'amount',
label: '金额',
width: '80',
},
{
prop: 'createTime',
label: '创建时间',
},
]
const initForm = () => {
return {
amount: 0,
user: {
id: '',
name: '',
},
}
}
const initUserForm = () => {
return {
user: {
id: '',
name: '',
},
}
}
const toDtoFrom = (row) => {
const newForm = { ...row }
newForm.userId = newForm.user.id
delete newForm.user
return newForm
}
const rules = {
user: [
{ required: true, validator: checkContactUser('接收人'), trigger: 'blur' },
],
amount: [
{ required: true, message: '请输入交易金额', trigger: 'blur', type: 'number' },
],
}
const userRules = {
user: [
{ required: true, validator: checkContactUser('查询人'), trigger: 'blur' },
],
}
export {
columnsMap,
initForm,
rules,
initUserForm,
userRules,
toDtoFrom,
}
<file_sep>/src/api/tms/description.js
import request from '@/router/axios'
const prefixUrl = '/tms'
// @/api/tms/tag
export function getTagDescriptionPageByTagId (id, params) {
return request({
url: `${prefixUrl}/description/page/${id}`,
method: 'get',
params: params,
})
}
export function putTagDesc (obj) {
return request({
url: `${prefixUrl}/description/update`,
method: 'post',
data: obj,
})
}
// 添加标签描述
export function postTagDesc (obj) {
return request({
url: `${prefixUrl}/description/create`,
method: 'post',
data: obj,
})
}
// 添加标签描述
export function getTagDesc (params) {
return request({
url: `${prefixUrl}/description/page/${params.id}`,
method: 'get',
params: params,
})
}
export function deleteTagDescById (id) {
return request({
url: `${prefixUrl}/description/delete/${id}`,
method: 'post',
})
}
<file_sep>/src/api/fams/block_chain.js
import request from '@/router/axios'
const prefixUrl = '/fams/block_chain'
// @/api/fams/block_chain
export function getAmountByUserId (userId) {
return request({
url: `${prefixUrl}/account/${userId}`,
method: 'get',
})
}
export function getAmount () {
return request({
url: `${prefixUrl}/account`,
method: 'get',
})
}
export function getPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function getCoinPage (query) {
return request({
url: `${prefixUrl}/coin/page`,
method: 'get',
params: query,
})
}
export function sendAmount (obj) {
return request({
url: `${prefixUrl}/send`,
method: 'post',
data: obj,
})
}
export function issuedAmount (obj) {
return request({
url: `${prefixUrl}/coin/making`,
method: 'post',
data: obj,
})
}
export function getAccountInfo () {
return request({
url: `${prefixUrl}/account/info`,
method: 'get',
})
}
export function getCoinIssuePage (query) {
return request({
url: `${prefixUrl}/making/page`,
method: 'get',
params: query,
})
}
export function getPlatformPage (query) {
return request({
url: `${prefixUrl}/platform/page`,
method: 'get',
params: query,
})
}
export function getOrgPage (query) {
return request({
url: `${prefixUrl}/org/page`,
method: 'get',
params: query,
})
}
export function getMyPage (query) {
return request({
url: `${prefixUrl}/my/page`,
method: 'get',
params: query,
})
}
export function getPlatformAccount () {
return request({
url: `${prefixUrl}/platform/account`,
method: 'get',
})
}
export function getOrgAccount () {
return request({
url: `${prefixUrl}/org/account`,
method: 'get',
})
}
<file_sep>/src/api/tms/record.js
import request from '@/router/axios'
const prefixUrl = '/tms'
// @/api/tms/tag
export function getRecordMap (id) {
return request({
url: `${prefixUrl}/record/map/${id}`,
method: 'get',
})
}
export function getRecordList (id, limit = 5) {
return request({
url: `${prefixUrl}/record/list/${id}`,
method: 'get',
params: {limit},
})
}
<file_sep>/src/views/fams/GroupFinance/UnionProfitAndLoss/MonthDetail/options.js
const columnsMap = [
{
prop: 'month',
label: '月度',
width:'80',
},
{
prop: 'orgName',
label: '组织名称',
width:'300',
},
{
prop: 'contractAmount',
label: '合同金额',
},
{
prop: 'projectIncome',
label: '项目收入',
},
{
prop: 'cost',
label: '费用',
},
{
prop: 'operatingProfit',
label: '营业利润',
},
{
prop: 'netProfit',
label: '净利润',
},
]
export { columnsMap }<file_sep>/src/api/app/crms/index.js
import request from '@/router/axios'
const prefixUrl = '/crm/channel_client'
// 本周新增
export const getNewClientList = (params) => {
return request({
url: `${prefixUrl}/getThisWeekClient`,
method: 'get',
params: params,
})
}
// 合作次数最多
export const getCoopClientList = (params) => {
return request({
url: `${prefixUrl}/getMostCoopClient`,
method: 'get',
params: params,
})
}
// 客户库列表
export const getCustomList = (params) => {
return request({
url: `${prefixUrl}/getIndexPage`,
method: 'get',
params: params,
})
}
export const getLatestList = (params) => {
return request({
url: `${prefixUrl}/latest`,
method: 'get',
params: params,
})
}
export const getPopularList = (params) => {
return request({
url: `${prefixUrl}/popular`,
method: 'get',
params: params,
})
}
export const getBusinessPage = (params) => {
return request({
url: `${prefixUrl}/getPage`,
method: 'get',
params: params,
})
}
// 组织客户集合
export const getClientList = (id) => {
return request({
url: `${prefixUrl}/client_list/${id}`,
method: 'get',
})
}
// 客户库首页分页查询(包括模糊搜索)
export const getPersonPage = (params) => {
return request({
url: `${prefixUrl}/getPersonPage`,
method: 'get',
params: params,
})
}
<file_sep>/src/views/cpms/products/options.js
import { checkContactUsers } from '@/util/rules'
const dictsMap = {
status: {
0: '待审核',
1: '通过',
2: '未通过',
},
}
const columnsMap = [
{
label: '上线时间',
prop: 'onlineTime',
type: 'date',
formatString: 'YYYY-MM-DD',
},
{
label: '状态',
prop: 'status',
type: 'dict',
},
]
const Column = {
id: '',
name: '', // 名字
imageUrl: '', // logo
synopsis: '', // 简介
userList: [], // 负责人
onlineTime: '', // 上线时间
}
const initForm = () => {
return {
id: '', // ID
type: '',
imageUrl: '', // logo
number: '', // 编号
name: '', // 名称
website: '', // 网址
onlineTime: '',//上线时间
tagKeywords: [], // 标签
tapeLibrary: 0, // 是否带库
isCase: 1, // 是否带库
isOpen: 3, // 开放范围
valuation: 0, // 产品估值
instructions: '', // 估值说明
synopsis: '', // 产品简介
description: '', // 产品介绍
versions: [],//版本集合
moduleRelations: [],//模块关联集合
materialRelations: [],//材料关联集合
userRelationCharges: [],//负责人集合
userRelationDemands: [],//需求方集合
userRelationTechnologys: [],//技术经理集合
userRelationProducts: [],//产品经理集合
userRelationTeams: [],//团队成员集合
exam_address: '',
}
}
const toDtoForm = (row) => {
const newForm = { ...row }
newForm.userCharges = row.userRelationCharges.map(m => m.id)
newForm.userDemands = row.userRelationDemands.map(m => m.id)
newForm.userTechnologys = row.userRelationTechnologys.map(m => m.id)
newForm.userProducts = row.userRelationProducts.map(m => m.id)
newForm.userTeams = row.userRelationTeams.map(m => m.id)
newForm.modules = row.moduleRelations.map(m => m.id)
newForm.materials = row.materialRelations.map(m => m.id)
delete newForm.userRelationCharges
delete newForm.userRelationDemands
delete newForm.userRelationTechnologys
delete newForm.userRelationProducts
delete newForm.userRelationTeams
delete newForm.moduleRelations
delete newForm.materialRelations
return newForm
}
const initSearchForm = () => {
return {
theme: '',
teacher: '',
type: '',
date: '',
}
}
const rules = {
imageUrl: [
{ required: true, message: '请上传图片', trigger: 'change' },
],
number: [
{ required: true, message: '请填写产品编号', trigger: 'blur' },
],
name: [
{ required: true, message: '请填写产品名称', trigger: 'blur' },
],
website: [
{ required: true, message: '请填写产品网址', trigger: 'blur' },
],
onlineTime: [
{ required: true, message: '请填写上线时间', trigger: 'blur' },
],
tagKeywords: [
{ type: 'array', min: 3, message: '标签至少 3 个', trigger: 'blur' },
{ type: 'array', required: true, message: '请填写标签', trigger: 'blur' },
],
valuation: [
{ required: true, message: '请填写产品估值', trigger: 'blur' },
],
instructions: [
{ required: true, message: '请填写估值说明', trigger: 'blur' },
],
synopsis: [
{ required: true, message: '请填写产品简介', trigger: 'blur' },
],
description: [
{ required: true, message: '请填写产品介绍', trigger: 'blur' },
],
userRelationCharges: [
{ required: true, validator: checkContactUsers('负责人'), trigger: 'blur' },
],
}
export { columnsMap, Column, initForm, toDtoForm, initSearchForm, rules, dictsMap }
<file_sep>/src/api/app/ims/index.js
import request from '@/router/axios'
const prefixUrl = '/ims/channel_notification'
export const getNotificationList = (params) => {
return request({
url: `${prefixUrl}/notification_list`,
method: 'get',
params: params,
})
}<file_sep>/src/api/exam/examLibrary/examInation/examInation.js
/**
* 新增考试库管理API请求接口
*/
import request from '@/router/axios'
/**
* 获取试题列表
* @param {Object} params 参数
*/
export function getExamInationList (params) {
return request({
url: '/exms/iepexamination/page',
method: 'get',
params: params,
})
}
/**
* 提交试题ID
*/
export function postExamById (params) {
return request({
url: '/exms/iepentryform/getIepEntryFormPage',
method: 'get',
data: params,
})
}
/**
* post禁用考试
*/
export function postExamForbidById (params) {
return request({
url: 'exms/iepexamination/prohibit',
method: 'post',
params: params,
})
}
/**
* post启用考试
*/
export function postExamPassById (params) {
return request({
url: 'exms/iepexamination/enable',
method: 'post',
params: params,
})
}
/**
* 删除
*/
export function deleteById (params) {
return request({
url: 'exms/iepexamination/remove',
method: 'post',
data: params,
})
}
<file_sep>/src/store/getters.js
const getters = {
// tags
tag: state => state.tags.tag,
tagList: state => state.tags.tagList,
tagWel: state => state.tags.tagWel,
// common
website: state => state.common.website,
isCollapse: state => state.common.isCollapse,
screen: state => state.common.screen,
isLock: state => state.common.isLock,
lockPasswd: state => state.common.lockPasswd,
showMoney: state => state.common.showMoney,
windowSize: state => state.common.windowSize,
// user
userInfo: state => state.user.userInfo,
noOrg: state => !state.user.userInfo.orgId,
access_token: state => state.user.access_token,
refresh_token: state => state.user.refresh_token,
expires_in: state => state.user.expires_in,
roles: state => state.user.roles,
permissions: state => state.user.permissions,
keep_login_token: state => state.user.keep_login_token,
keyCollapse: (state, getters) => getters.screen > 1 ? getters.isCollapse : false,
// menu
menu: state => state.menu.menu,
mainMenu: state => state.menu.mainMenu,
otherMenus: state => state.menu.otherMenus,
menusMap: state => state.menu.menusMap,
menuPathList: state => state.menu.menuPathList,
// cache
dictGroup: state => state.cache.dictGroup,
contactsPyGroup: state => state.cache.contactsPyGroup,
famsConfig: state => state.cache.famsConfig,
// notify 通知消息
notify: state => key => state.notify[key],
// im 即时聊天
imMessage: state => key => state.im.messageMap[key],
imMessageMore: state => key => state.im.messageMore[key],
imUserTree: state => state.im.userTree,
imChatList: state => state.im.chatList,
imCurrentChatList: state => state.im.currentChatList,
imChatShow: state => state.im.chatShow,
imCurrentChat: state => state.im.currentChat,
imUnread: state => key => state.im.unreadMap[key],
imUnreadTotal: state => state.im.unreadTotal,
imGroups: state => state.im.groups,
imGroupMember: state => key => state.im.groupMemberMap[key],
imGroupMemberAll: state => state.im.groupMemberMap,
imCustomGroups: state => state.im.customGroups,
}
export default getters
<file_sep>/src/api/hrms/publish_recruitment.js
import request from '@/router/axios'
const prefixUrl = '/hrms/publish_recruitment'
// @/api/hrms/publish_recruitment
export function getPublishRecruitmentPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function getPublishRecruitmentById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function postPublishRecruitment (obj, publish) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
params: {
publish,
},
data: obj,
})
}
export function putPublishRecruitment (obj, publish) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
params: {
publish,
},
data: obj,
})
}
export function deletePublishRecruitmentById (id) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: [id],
})
}
export function deletePublishRecruitment (ids) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}
export function shelfPublishRecruitmentById (id) {
return statusPublishRecruitment([id], 2)
}
export function obtainedPublishRecruitmentById (id) {
return statusPublishRecruitment([id], 3)
}
export function shelfPublishRecruitmentBatch (ids) {
return statusPublishRecruitment(ids, 2)
}
export function obtainedPublishRecruitmentBatch (ids) {
return statusPublishRecruitment(ids, 3)
}
function statusPublishRecruitment (ids, status) {
return request({
url: `${prefixUrl}/status/batch`,
method: 'post',
data: {
ids: ids,
status: status,
},
})
}
<file_sep>/src/views/wenjuan/components/govLayout/README.md
## 数据基因 通用布局
### 基础用法
> 基础布局
``` html
<!-- -->
<gov-layout-body></gov-layout-body>
<!-- -->
<gov-layout-header></gov-layout-header>
<!-- -->
<gov-layout-form></gov-layout-form>
<!-- -->
<gov-layout-dialog></gov-layout-dialog>
<!-- -->
<gov-layout-button-group></gov-layout-button-group>
<!-- -->
<gov-layout-main></gov-layout-main>
```<file_sep>/src/views/admin/log/options.js
// org config options
const columnsMap = [
{
width: 50,
prop: 'id',
label: '序号',
},
{
label: '标题',
prop: 'title',
},
{
label: '操作人',
prop: 'createBy',
},
{
label: 'IP地址',
prop: 'remoteAddr',
},
{
label: '请求方式',
prop: 'method',
},
{
label: '客户端',
prop: 'serviceId',
},
{
width: 80,
label: '请求时间',
prop: 'time',
},
{
width: 150,
label: '创建时间',
prop: 'createTime',
type: 'datetime',
format: 'yyyy-MM-dd HH:mm',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
},
]
const initMemberForm = () => {
return {
title: '',
createBy: '',
remoteAddr: '',
method: '',
serviceId: '',
time: '',
createTime:'2019-05-28 15:31',
}
}
export { columnsMap, initMemberForm }<file_sep>/src/api/tms/tag-level.js
import request from '@/router/axios'
const prefixUrl = '/tms'
// @/api/tms/tag-level
export function getTagLevelList () {
return request({
url: `${prefixUrl}/tag_level/list`,
method: 'get',
})
}
export function getTagLevelPage (opts) {
return request({
url: `${prefixUrl}/tag_level/page`,
method: 'get',
params: opts,
})
}
export function postTagLevel (obj) {
return request({
url: `${prefixUrl}/tag_level/create`,
method: 'post',
data: obj,
})
}
export function putTagLevel (obj) {
return request({
url: `${prefixUrl}/tag_level/update`,
method: 'post',
data: obj,
})
}
export function deleteTagLevelById (id) {
return request({
url: `${prefixUrl}/tag_level/delete/${id}`,
method: 'post',
})
}
<file_sep>/src/views/hrms/TrainingAssessment/AssessmentManagement/AssessManagement/options.js
const dictsMap = {
status: {
0: '考核中',
1: '考核完成',
2: '已过期',
},
scoringMethod: {
1: '平均分',
2: '去掉最高最低平均分',
},
}
const columnsMap = [
{
prop: 'userName',
label: '被考核人',
},
{
prop: 'kpiName',
label: '考核名称',
},
{
prop: 'startTime',
label: '考核时间',
width:'150',
},
{
prop: 'status',
label: '考核状态',
type: 'dict',
},
{
prop: 'score',
label: '考核分值',
},
]
const initFormData = () => {
return {
kpiName: '', // 考核名称
startTime: '', // 开始时间
endTime: '', // 结束时间
timeList: [],
templateId: '', // 考核模板
templateName: '',
selfWeight: '', // 自评权重
assessorWeight: '', // 考核人权重
scoringMethod: 1, // 考核人评分方式
covers: [], // 被考核人集合
coversList: {
orgs: [],
users: [],
unions: [],
},
assessors: [], // 考核人集合
assessorsList: {
orgs: [],
users: [],
unions: [],
},
}
}
const validateSelfWeight = (rule, value, callback) => {
if (/^[1-9]*[1-9][0-9]*$/.test(value) && value >= 0 && value <= 100) {
callback()
} else {
callback(new Error())
}
}
const validateAssessorWeight = (rule, value, callback) => {
if (/^[1-9]*[1-9][0-9]*$/.test(value) && value >= 0 && value <= 100) {
callback()
} else {
callback(new Error())
}
}
const validateZero = (rule, value, callback) => {
if (value.users.length == 0) {
callback(new Error())
} else {
callback()
}
}
const validateCovers = (rule, value, callback) => {
if (value.users.length > 5) {
callback(new Error())
} else {
callback()
}
}
const validateAssessors = (rule, value, callback) => {
if (value.users.length > 3) {
callback(new Error())
} else {
callback()
}
}
const rules = {
kpiName: [
{ required: true, message: '必填', trigger: 'blur' },
],
timeList: [
{ required: true, message: '必填', trigger: 'blur' },
],
templateId: [
{ required: true, message: '必填', trigger: 'change' },
],
coversList: [
{ required: true, message: '必填', trigger: 'change' },
{ validator: validateZero, message: '请至少选择一名被考核人', trigger: 'change' },
{ validator: validateCovers, message: '最多只可选择五名被考核人', trigger: 'change' },
],
assessorsList: [
{ required: true, message: '必填', trigger: 'change' },
{ validator: validateZero, message: '请至少选择一名被考核人', trigger: 'change' },
{ validator: validateAssessors, message: '最多只可选择三名考核人', trigger: 'change' },
],
selfWeight: [
{ required: true, message: '必填', trigger: 'blur' },
{ validator: validateSelfWeight, message: '请输入0-100的正整数', trigger: 'change' },
],
assessorWeight: [
{ required: true, message: '必填', trigger: 'blur' },
{ validator: validateAssessorWeight, message: '请输入1-100的正整数', trigger: 'change' },
],
scoringMethod: [
{ required: true, message: '必填', trigger: 'blur' },
],
}
const initSearchForm = () => {
return {
name: '',
assessName: '',
}
}
export { dictsMap, columnsMap, initFormData, initSearchForm, rules }<file_sep>/src/store/modules/gpms.js
const gpms = {
state: {
dataList: [
],
projectPkDialogShow:false,
customerDialogShow: false,
},
mutations: {
SET_PROJECT_JOIN_PK: (state, joinObject) => {
state.dataList.push(joinObject)
},
SET_PROJECT_PK_DIALOG_SHOW: (state, projectPkDialogShow) => {
state.projectPkDialogShow = projectPkDialogShow
},
SET_PROJECT_REMOVE_PK: (state, id) => {
// state.dataList.remove(joinObject)
if (id==-1) {
state.dataList=[]
}
for (var i = state.dataList.length-1; i>-1; i--)
if (state.dataList[i].id==id)
state.dataList.splice(i,1)
},
SET_CUSTOMER_DIALOG_SHOW: (state, customerDialogShow) => {
state.customerDialogShow = customerDialogShow
},
},
}
export default gpms<file_sep>/src/api/admin/name_list.js
import request from '@/router/axios'
const prefixUrl = '/admin/person'
export function pageList (params) {
return request({
url: `${prefixUrl}/page_search`,
method: 'post',
data: params,
})
}
export function pageRecycleList (params) {
return request({
url: `${prefixUrl}/page_recycle`,
method: 'post',
data: params,
})
}
export function deletePageById (id) {
return request({
url: `${prefixUrl}/deletePerson/${id}`,
method: 'get',
})
}
export function deleteRealPageById (id) {
return request({
url: `${prefixUrl}/realDelete/${id}`,
method: 'get',
})
}
export function recoveryById (id) {
return request({
url: `${prefixUrl}/recovery/${id}`,
method: 'get',
})
}
export function deleteMorePage (params) {
return request({
url: `${prefixUrl}/batchDelete`,
method: 'post',
data: params,
})
}
export function deleteMoreRealPage (params) {
return request({
url: `${prefixUrl}/batchRealDelete`,
method: 'post',
data: params,
})
}
export function insertOrUpdate (data) {
return request({
url: `${prefixUrl}/insertOrUpdate`,
method: 'post',
data: data,
})
}
export function getDetailPageById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function getReLockById (id) {
return request({
url: `${prefixUrl}/removeLock/${id}`,
method: 'get',
})
}
export function getLockById (id) {
return request({
url: `${prefixUrl}/lockPerson/${id}`,
method: 'get',
})
}
export function getLock (data) {
return request({
url: `${prefixUrl}/batchLock`,
method: 'post',
data: data,
})
}
export function getReLock (data) {
return request({
url: `${prefixUrl}/batchRemoveLock`,
method: 'post',
data: data,
})
}
const prefixUrl2 = '/admin'
// @/api/tms/excel
function getDownload (path, fileName) {
return request({
url: `${prefixUrl2}${path}`,
method: 'post',
headers: {
'Content-Type': 'application/json',
},
responseType: 'arraybuffer',
}).then(response => {
// 处理返回的文件流
const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' })
const link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = `${fileName}.xls`
link.click()
})
}
// export function getTagExcelExport () {
// return getDownload('/import', '标签导出信息')
// }
// 提交
export function getModelExcel () {
return getDownload('/person/exportExcel', '导入模板')
}<file_sep>/src/views/wel/approval/cc/options.js
// org config options
const dictsMap = {
approveResult: {
0: '未审核',
1: '通过',
2: '拒绝',
},
}
const columnsMap = [
{
prop: 'applyType',
label: '申请类型',
},
{
prop: 'applyStartTime',
label: '发起时间',
width:'170',
},
{
prop: 'applyEndTime',
label: '审批时间',
width:'170',
},
{
prop: 'approverName',
label: '审核人',
width:'100',
},
{
prop: 'approveResult',
label: '审批结果',
type: 'dict',
width:'100',
},
]
const initForm = () => {
return {
name: '',
isOpen: false,
intro: '',
}
}
const initSearchForm = () => {
return {
theme: '',
teacher: '',
type: '',
date: '',
}
}
export { dictsMap, columnsMap, initForm, initSearchForm }
<file_sep>/src/api/hrms/suggestion.js
import request from '@/router/axios'
const prefixUrl = '/cpms/suggestion'
// @/api/hrms/suggestion
export function getSuggestionIssuePage (query) {
return request({
url: `${prefixUrl}/pageIssue`,
method: 'get',
params: query,
})
}
export function getSuggestionReceivedPage (query) {
return request({
url: `${prefixUrl}/pageReceived`,
method: 'get',
params: query,
})
}
export function getUnionSuggestionPage (query) {
return request({
url: `${prefixUrl}/union/received/page`,
method: 'get',
params: query,
})
}
export function getSuggestionById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function postSuggestion (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function putSuggestion (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function putfeedback (obj) {
return request({
url: `${prefixUrl}/feedback`,
method: 'post',
data: obj,
})
}
export function deleteSuggestionById (id) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: [id],
})
}
export function deleteSuggestionBatch (ids) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}<file_sep>/src/api/fams/salary.js
import request from '@/router/axios'
const prefixUrl = '/fams/salary'
// @/api/fams/salary
export function getSalaryPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function getSalaryByIdPage (id) {
return function (query) {
return request({
url: `${prefixUrl}/page/${id}`,
method: 'get',
params: query,
})
}
}
export function getSalaryById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function getPayrollById (id) {
return request({
url: `${prefixUrl}/payroll/${id}`,
method: 'get',
})
}
export function grantSalaryById (id) {
return request({
url: `${prefixUrl}/payroll/grant/${id}`,
method: 'post',
})
}
export function addSalary (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function deleteSalaryById (id) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: [id],
})
}<file_sep>/src/views/hrms/Recruitment/TalentPool/TalentPool/options.js
import { mergeByFirst } from '@/util/util'
const dictsMap = {
status: {
1: '待处理',
2: '已邀约',
3: '邀约未面试',
4: '面试未录用',
5: '已录用',
},
}
const columnsMap = [
{
prop: 'sex',
label: '性别',
width: 55,
},
{
prop: 'age',
label: '年龄',
width: 55,
},
{
prop: 'education',
label: '学历',
type: 'dictGroup',
dictName: 'hrms_highest_educational',
width: '100',
},
{
prop: 'applyPosition',
label: '应聘岗位',
},
{
prop: 'receptionTime',
label: '简历接受时间',
width: '170',
},
{
prop: 'source',
label: '来源',
type: 'dictGroup',
dictName: 'hrms_resume_source',
width: '100',
},
]
const initForm = () => {
return {
'id': '',
'name': '',
'sex': 1,
'sexName': '',
'avatar': '',
'birthday': '',
'title': '',
'phone': '',
'age': '',
'email': '',
'height': '',
'weight': '',
'nation': '',
'address': '',
'politics': '',
'health': '',
'marriage': '',
'bear': 1,
'university': '',
'education': 2,
'relation': '',
'referrer': '',
'appWay': 9,
'source': 4,
'hobbies': '',
'advantage': '',
'honor': '',
'result': '',
'position': [],
'positionId': 3,
'positionName': '',
'arrive': '',
'salary': '',
'workPlace': '',
'attach': [],
'workExperience': [],
'trainingSituation': [],
'eduSituation': [],
'userCert': [],
'blacklistArea': '',
'blacklistReasons': '',
'cities': [],
}
}
const initDtoForm = () => {
return {
'id': '',
'name': '',
'sex': 1,
'avatar': '',
'birthday': '',
'title': '',
'phone': '',
'age': '',
'email': '',
'height': '',
'weight': '',
'nation': '',
'address': '',
'politics': '',
'health': '',
'marriage': '',
'bear': 1,
'university': '',
'education': 2,
'relation': '',
'referrer': '',
'appWay': 9,
'source': 4,
'hobbies': '',
'advantage': '',
'honor': '',
'result': '',
'position': [],
'positionId': 3,
'arrive': '',
'salary': '',
'workPlace': '',
'attach': '',
'workExperience': [],
'trainingSituation': [],
'eduSituation': [],
'userCert': [],
'blacklistArea': '',
'blacklistReasons': '',
'cities': [],
}
}
const formToDto = (form) => {
const newForm = mergeByFirst(initForm(), form)
newForm.positionId = form.position[form.position.length - 1]
newForm.attach = form.attach[0] || ''
return newForm
}
const formToVo = (form) => {
const newForm = mergeByFirst(initDtoForm(), form)
newForm.attach = []
return newForm
}
const initSearchForm = () => {
return {
name: '', // 姓名
marriageStatus: '',
positionName: '', // 岗位名称
position: [], // 岗位id
educationId: null, // 最高学历字典ID
sex: 0, // 性别id
rangeTime: null, // 开始时间
status: null, // 简历状态id
rangeAge: [0, 100], // 年龄
}
}
const initDtoSearchForm = () => {
return {
name: '', // 姓名
marriageStatus: '',
positionName: '', // 岗位名称
positionId: null, // 岗位id
educationId: null, // 最高学历字典ID
sex: 0, // 性别id
startTime: null, // 简历接收时间(开始时间)
endTime: null, // 简历接收时间(结束时间)
status: null, // 简历状态
minAge: null, // 最小年龄
maxAge: null, // 最大年龄
}
}
// positionId: 1, // 岗位id
// deptId: 1, // 部门ID
// sex: 1, // 性别id
// status: 1, // 招聘状态id
// startTime: initNow(), // 开始时间
// endTime: initNow(), // 结束时间
const toDtoSearchForm = (row) => {
const newForm = mergeByFirst(initDtoSearchForm(), row)
newForm.sex = row.sex ? row.sex : null
newForm.positionId = row.position.length && row.position[row.position.length - 1]
if (row.rangeTime) {
newForm.startTime = row.rangeTime[0]
newForm.endTime = row.rangeTime[1]
}
if (row.rangeAge) {
newForm.minAge = row.rangeAge[0]
newForm.maxAge = row.rangeAge[1]
}
return newForm
}
const initToResumeForm = () => {
return {
ids: [],
reason: '',
}
}
const initToBlacklistForm = () => {
return {
ids: [],
area: '',
reason: '',
}
}
const initrejectedForm = () => {
return {
msg: '',
}
}
export { dictsMap, columnsMap, initForm, initrejectedForm, formToDto, formToVo, initToResumeForm, initToBlacklistForm, initSearchForm, toDtoSearchForm }<file_sep>/src/api/app/crms/customer.js
import request from '@/router/axios'
const prefixUrl = '/crm/customer'
export const getCustomList = (params) => {
return request({
url: `${prefixUrl}/getIndexPage`,
method: 'get',
params: params,
})
}
export const getNewClientList = (params) => {
return request({
url: `${prefixUrl}/getThisWeekClient`,
method: 'get',
params: params,
})
}
export const getCoopClientList = (params) => {
return request({
url: `${prefixUrl}/getMostCoopClient`,
method: 'get',
params: params,
})
}
<file_sep>/src/api/exam/personalCenter/submissionRecord/submissionRecord.js
/**
* 新增出题记录API请求接口
*/
import request from '@/router/axios'
/**
* 获取出题列表页
* @param {Object} params 参数
*/
export function getSubmissionRecordList (params) {
return request({
url: '/exms/iepitembank/page',
method: 'get',
params: params,
})
}
/**
* 获取试题选项
* @param {Object} params 参数
*/
export function getTestOption (params) {
return request({
url: 'exms/dict/map',
method: 'get',
params: params,
})
}
/**
* 修改试题
* @param {Object} params 参数
*/
export function postModify (params) {
return request({
headers: {
'Content-Type': 'application/json',
},
url: 'exms/iepitembank/update',
method: 'post',
data: params,
})
}<file_sep>/src/api/gpms/index.js
import request from '@/router/axios'
const prefixUrl = '/fams/iepProjectInformation'
export function getTableData (obj) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: obj,
})
}
// 供给邮件关联使用,与上面的链接一模一样
export function getProjectList (obj) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: obj,
})
}
export function createData (obj) {
return request({
url: `${prefixUrl}`,
method: 'post',
data: obj,
})
}
// 编辑 -- 立项申请、审批
export function updateData (obj) {
return request({
url: `${prefixUrl}/edit`,
method: 'post',
data: obj,
})
}
// 详情
export function getDataDetail (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function deleteData (id) {
let ids = typeof id === 'object' ? id : [id]
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}
// 审批列表
export function getApprovalList (obj) {
return request({
url: `${prefixUrl}/projectApproval`,
method: 'get',
params: obj,
})
}
// 推荐项目名字
export function getRecommendedProjectList (obj) {
return request({
url: `${prefixUrl}/recommendProjectName`,
method: 'post',
data: obj,
})
}
// 推荐项目督导
export function getRecommendedMentortList (obj) {
return request({
url: `${prefixUrl}/recommendMentorByTag`,
method: 'post',
data: obj,
})
}
// 推荐项目经理
export function getRecommendedHandlesList (obj) {
return request({
url: `${prefixUrl}/recommendManagerByTag`,
method: 'post',
data: obj,
})
}
// 推荐市场经理
export function getRecommendedMktManagerList (obj) {
return request({
url: `${prefixUrl}/recommendMarketByTag`,
method: 'post',
data: obj,
})
}
// 推荐项目成员
export function getRecommendedMemberList (obj) {
return request({
url: `${prefixUrl}/recommendMemberByTag`,
method: 'post',
data: obj,
})
}
// 项目平均耗时
export function getTimePerRequest (obj) {
return request({
url: `${prefixUrl}/timePerRequest `,
method: 'post',
data: obj,
})
}
// 平均成本预算
export function getAverageCostBudget (obj) {
return request({
url: `${prefixUrl}/averageCostBudget `,
method: 'post',
data: obj,
})
}
// 平均合同金额
export function getAverageContractAmount (obj) {
return request({
url: `${prefixUrl}/averageContractAmount `,
method: 'post',
data: obj,
})
}
// //变更
export function transferManagerList (obj) {
return request({
url: `${prefixUrl}/change/handle`,
method: 'post',
data: obj,
})
}
//审核
export function approvalById (obj) {
return request({
url: `${prefixUrl}/updateApproval`,
method: 'post',
data: obj,
})
}
//撤回
export function withdrawById (obj) {
return request({
url: `${prefixUrl}/batch/withdrawal`,
method: 'post',
data: obj,
})
}
//统计页面
export function getMyPosition (obj) {
return request({
url: 'fams/iep-project-myposition/getDetail',
method: 'get',
params: obj,
})
}
//自动生成项目名称
export function generationProject (obj) {
return request({
url: `${prefixUrl}/generationProject`,
method: 'post',
data: obj,
})
}
//取外部项目分页
export const getExternalProjectPage = (params) => {
return request({
url: `${prefixUrl}/getProjectTypePage`,
method: 'get',
params: params,
})
}
// 推荐项目成员
export function checkProjectName (obj) {
return request({
url: `${prefixUrl}/verifyName`,
method: 'post',
data: obj,
})
}<file_sep>/src/views/goms/UnionManagement/UnionInformation/Memorabilia/options.js
const dictsMap = {
status: {
0: '待审核',
1: '正常',
},
}
const columnsMap = [
{
prop: 'title',
label: '标题',
width: 400,
},
{
prop: 'creatorName',
label: '发布人',
},
{
prop: 'happenTime',
label: '事件时间',
type: 'date',
formatString: 'YYYY-MM-DD',
},
{
prop: 'createTime',
label: '发布时间',
type: 'date',
formatString: 'YYYY-MM-DD',
},
{
prop: 'status',
label: '状态',
type: 'dict',
},
]
const initForm = () => {
return {
id: '',
title: '',
creatorName: '',
happenTime: '',
status: '',
content: '',
}
}
const toDtoForm = (row) => {
const newForm = { ...row }
delete newForm.creatorName
return newForm
}
export { dictsMap, columnsMap, initForm, toDtoForm }
<file_sep>/src/views/wel/desktop/OriganazeReport/options.js
const columnsMap = [
{
prop: 'realName',
label: '发布人',
},
{
prop: 'orgName',
label: '所属部门',
},
]
export {
columnsMap,
}
<file_sep>/src/views/wel/approval/Components/New/mixins.js
import { mapGetters } from 'vuex'
import { postApproval, putApproval } from '@/api/hrms/wel'
import { formToDto, initForm, formToVo, selfToVo } from './options'
import { getEmployeeProfileSelf } from '@/api/hrms/employee_profile'
import { getAdministrativeApprovalById } from '@/api/hrms/administrative_approval'
export default {
props: {
type: {
type: String,
default: '1',
},
},
data () {
return {
form: initForm(),
rules: {
reason: [
{ required: true, message: '请输入原因', trigger: 'change' },
],
approver: [
{ required: true, message: '请选择审批人', trigger: 'change' },
],
cc: [
{ required: true, message: '请选择抄送人', trigger: 'change' },
],
},
fnSelf: getEmployeeProfileSelf,
selfToVo,
}
},
computed: {
...mapGetters([
'userInfo',
]),
id () {
return +this.$route.params.id
},
filterUserList () {
return [this.userInfo.userId, ...this.form.cc.map(m => m.id), ...this.form.approver.map(m => m.id)]
},
},
created () {
this.loadPage()
},
methods: {
loadPage () {
if (this.id) {
getAdministrativeApprovalById(this.id).then(({ data }) => {
this.form = formToVo(data.data)
getEmployeeProfileSelf().then(({ data }) => {
this.form.dept = data.data.dept
})
})
} else {
this.loadSelf()
}
},
async handleSubmit () {
const submitFunction = this.id ? putApproval : postApproval
try {
const valid = await this.$refs['form'].validate()
if (valid) {
const { data } = await submitFunction(formToDto(this.form, this.type, this.userInfo.userId))
if (!data.data) {
this.$message(data.msg)
} else {
this.$router.history.go(-1)
}
}
} catch (error) {
console.log(error)
}
},
// 处理时间段
dealTime (val1, val2) {
function parseDate (date) {
return new Date(date)
}
const newDate1 = parseDate(val1)
const newDate2 = parseDate(val2)
const between = (Number(newDate2) - Number(newDate1)) / 1000
if (between < 0) {
this.$message.error('开始时间不能大于结束时间!!!')
return
}
const hours = parseInt(between / 3600)
const minutes = parseInt((between - 3600 * hours) / 60)
this.form.duration = hours + '小时' + minutes + '分钟'
},
startChange (val) {
if (this.form.endTime) {
this.form.startTime = val
this.dealTime(val, this.form.endTime)
}
},
endChange (val) {
this.form.endTime = val
this.dealTime(this.form.startTime, val)
},
},
}<file_sep>/src/views/crms/count/AllCustom/MoneyColumn/options.js
const searchForm = () => {
return {
business: [],
deptId: {},
district: '',
managerId: {
id: '',
name: '',
},
}
}
export { searchForm }
<file_sep>/src/views/goms/UnionManagement/UnionInformation/BasicInformation/options.js
// org config options
const dictsMap = {
status: {
0: '正常',
1: '待审核',
2: '锁定',
3: '待配置',
},
}
const optionMap = [{
label: '锁定',
value: 2,
}, {
label: '解锁',
value: 0,
}]
const columnsMap = [
{
prop: 'realName',
label: '真实姓名',
},
{
prop: 'phone',
label: '手机',
},
{
prop: 'assetOrg',
label: '资产所属',
},
{
prop: 'status',
label: '员工状态',
type: 'dict',
},
]
const initForm = () => {
return {
abilityTag: [],
abrName: '',
adminList: [],
contactMethod: '',
coreAdvantage: '',
createTime: '',
creator: { name: '', id: '', avatar: '' },
establishTime: '',
intro: '',
learningTag: [],
logo: '',
memberNum: '',
name: '',
orgId: '',
orgNum: '',
projectTag: [],
status: '',
structure: '',
unionId: '',
unionCulture: '',
updateTime: '',
userId: '',
creatorName: '',
}
}
const initSearchForm = () => {
return {
name: '',
}
}
export { dictsMap, columnsMap, optionMap, initSearchForm, initForm }<file_sep>/src/views/conm/FLinkManagement/options.js
const dictsMap = {
recommend: {
0: '是',
1: '否',
},
status: {
0: '已审核',
1: '未审核',
},
}
const initForm = () => {
return {
friendlinkId: '',
typeId: '', //分类管理
name: '',// 网站名称
url: '',//网站地址
logo: '',//图片logo
email: '', //站长email
description: '', //网站描述,
recommend: 0,//是否推荐
status: 0,
}
}
const initTypeForm = () => {
return {
friendlinktypeId: '',
typeName: '', //分类名称
typeNumber: '',// 分类编码
}
}
const columnTypeMap = [
{
prop: 'friendlinktypeId',
label: 'ID',
},
{
prop: 'typeName',
label: '分类名称',
},
{
prop: 'typeNumber',
label: '分类编码',
},
]
const columnsMap = [
{
prop: 'typeId',
label: '分类管理',
},
{
prop: 'name',
label: '网站名称',
},
{
prop: 'url',
label: '网站地址',
},
{
prop: 'withLogo',
label: '图片logo',
},
{
prop: 'recommend',
label: '推荐',
type: 'dict',
},
{
prop: 'status',
label: '状态',
type: 'dict',
},
]
const initSearchForm = () => {
return {
}
}
const rules = {
name: [{
required: true,
message: '请输入',
trigger: 'blur',
}],
typeId: [{
required: true,
message: '请输入',
trigger: 'blur',
}],
typeName: [{
required: true,
message: '请输入',
trigger: 'blur',
}],
typeNumber: [{
required: true,
message: '请输入',
trigger: 'blur',
}],
}
const selfRules = {
...rules,
}
export { dictsMap, columnsMap, initForm, initSearchForm, rules, selfRules, columnTypeMap, initTypeForm }<file_sep>/src/views/fams/FinancialManagement/CashJournal/options.js
import { initNow, getYear, getMonth } from '@/util/date'
const columnsMap = [
{
prop: 'id',
label: '序号',
},
{
prop: 'inputTime',
label: '录入日期',
type: 'date',
formatString: 'YYYY-MM-DD',
},
{
prop: 'createTime',
label: '系统生成日期',
},
{
prop: 'summary',
label: '摘要',
},
]
const initSearchForm = () => {
return {
year: new Date().getFullYear(),
companyId: '0',
month: new Date().getMonth() + 1,
}
}
export { columnsMap, initSearchForm, initNow, getYear, getMonth }<file_sep>/src/api/exam/setting/setting.js
/**
* 新增新试题API请求接口
*/
import request from '@/router/axios'
/**
* 获取试题选项
* @param {Object} params 参数
*/
export function getOptionList (params) {
return request({
url: 'exms/dict/map',
method: 'get',
params: params,
})
}
/**
* 获取列表
*/
export function dictList (params) {
return request({
url: '/exms/dict/page',
method: 'get',
params: params,
})
}
/**
* 添加
* @param {*} obj
*/
export function addObj (obj) {
return request({
url: '/exms/dict/',
method: 'post',
data: obj,
})
}
/**
* 删除
* @param {*} obj
*/
export function delObj (id) {
return request({
url: '/exms/dict/' + id,
method: 'delete',
})
}
/**
* 修改
* @param {*} obj
*/
export function putObj (obj) {
return request({
url: '/exms/dict/',
method: 'put',
data: obj,
})
}
/**
* 获取子项列表
* @param {*} id
*/
export function getChild (id) {
return request({
url: '/exms/dict/child/' + id,
method: 'get',
})
}
/**
* 新增子项
* @param {*} params
*/
export function postChild (obj) {
return request({
url: '/exms/dict/child/create',
method: 'post',
data: obj,
})
}
/**
* 修改子项
* @param {*} obj
*/
export function putChild (obj) {
return request({
url: '/exms/dict/child/update',
method: 'post',
data: obj,
})
}
/**
* 删除子项
* @param {*} params
*/
export function deleteChildById (id) {
return request({
url: `/exms/dict/child/delete/${id}`,
method: 'post',
})
}<file_sep>/src/api/app/cpms/product.js
import request from '@/router/axios'
import { prefixUrl } from '../../cpms/product'
export function getProductList () {
return request({
url: `${prefixUrl}/list`,
method: 'get',
})
}
<file_sep>/src/api/crms/visiting_record.js
import request from '@/router/axios'
const visitUrl = '/crm/visitingRecord'
const visitLog = '/crm/meeting'
const prefixUrl = '/mlms/meeting'
// 联系记录查询
export function fetchVisitList (params) {
return request({
url: `${visitUrl}/page`,
method: 'get',
params: params,
})
}
// 联系记录-编辑
export function updateVisit (obj) {
return request({
url: `${visitUrl}/update`,
method: 'post',
data: obj,
})
}
// 联系记录-新增
export function createVisit (obj) {
return request({
url: `${visitUrl}/create`,
method: 'post',
data: obj,
})
}
// 联系记录-删除
export function deleteVisit (contactId) {
return request({
url: `${visitUrl}/delete/batch/${contactId}`,
method: 'post',
data: contactId,
})
}
//联系记录通过id查询
export function contactById (contactId) {
return request({
url: `${visitUrl}/delete/batch/${contactId}`,
method: 'post',
data: [contactId],
})
}
// 删除
export function contactBatchById (ids) {
return request({
url: `${visitUrl}delete/batch/${ids}`,
method: 'post',
data: [ids],
})
}
// 拜访日志-查询
export function fetchVisitLog (params) {
return request({
url: '/mlms/meeting/page/visitList',
method: 'get',
params: params,
})
}
// 拜访日志-通过id查询
export function fetchVisitLogById (id) {
return request({
url: `${visitLog}/page`,
method: 'get',
params: id,
})
}
// 拜访日志-新增
export function createVisitLog (obj) {
return request({
url: `${visitLog}/create`,
method: 'post',
data: obj,
})
}
// 拜访日志-编辑
export function updateVisitLog (obj) {
return request({
url: `${visitLog}/update`,
method: 'post',
data: obj,
})
}
//拜访日志-删除
export function deleteVisitLog (id) {
return request({
url: `${visitLog}/delete/batch`,
method: 'post',
data: [id],
})
}
//批量删除关联客户拜访日志
export function deleteAllVisitLog (id) {
return request({
url: `${prefixUrl}/deleteRelation/batch`,
method: 'post',
data: id,
})
}
//拜访日志发送
export function visitSend (id) {
return request({
url: `/mlms/meeting/send/${id}`,
method: 'post',
})
}
<file_sep>/src/store/index.js
import Vue from 'vue'
import Vuex from 'vuex'
import user from './modules/user'
import menu from './modules/menu'
import cache from './modules/cache'
import common from './modules/common'
import app from './modules/app'
import tags from './modules/tags'
import gpms from './modules/gpms'
import fams from './modules/fams'
import hrms from './modules/hrms'
import notify from './modules/notify'
import im from './modules/im'
import cpms from './modules/cpms'
import ican from './modules/ican'
import ics from './modules/ics'
import getters from './getters'
Vue.use(Vuex)
const store = new Vuex.Store({
modules: {
app,
user,
menu,
cache,
common,
tags,
fams,
gpms,
hrms,
notify,
im,
cpms,
ican,
ics,
},
getters,
})
export default store
<file_sep>/src/api/app/cpms/technology.js
import request from '@/router/axios'
import { prefixUrl, getTechnologyById } from '../../cpms/technology'
const getTechnologyList = (params) => {
return request({
url: `${prefixUrl}/list`,
method: 'get',
params: params,
})
}
export { getTechnologyById, getTechnologyList }<file_sep>/src/api/fams/expenditure.js
import request from '@/router/axios'
const prefixUrl = '/fams/expenditure'
// @/api/fams/expenditure
export function getExpenditurePage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function postExpenditure (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function putExpenditure (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function getExpenditureById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function genFlow (obj) {
return request({
url: `${prefixUrl}/create/fee`,
method: 'post',
data: obj,
})
}<file_sep>/src/store/modules/hrms.js
const hrms = {
state: {
approvalDialogShow: false,
},
mutations: {
SET_APPROVAL_DIALOG_SHOW: (state, approvalDialogShow) => {
state.approvalDialogShow = approvalDialogShow
},
},
}
export default hrms<file_sep>/src/views/wel/RelationshipManage/options.js
// import { mergeByFirst } from '@/util/util'
const dictsMap = {
}
const columnsMap = [
{
prop: 'name',
label: '姓名',
width: '120',
},
{
prop: 'phone',
label: '联系方式',
},
// {
// prop: 'deptName',
// label: '部门',
// },
{
prop: 'orgName',
label: '所属组织',
},
// {
// prop: 'gender',
// label: '性别',
// },
{
prop: 'staffNo',
label: '用户工号',
},
// {
// prop: 'qq',
// label: 'qq',
// },
// {
// prop: 'wechat',
// label: '微信',
// },
{
prop: 'positionName',
label: '岗位名称',
},
{
prop: 'jobName',
label: '职务名称',
},
// {
// prop: 'professionalTitle',
// label: '职称',
// },
// {
// prop: 'idMarks',
// label: '身份标识',
// },
]
const initForm = () => {
return {
name:'',
isOpen:1,
}
}
const initGroupForm = () => {
return {
customId:0,
userId:[],
}
}
const formToDto = (row) => {
const newForm = {...row}
return newForm
}
const initSearchForm = () => {
return {
name: '',
}
}
const rules = {
name: [
{ required: true, message: '请输入自定义分组名', trigger: 'blur' },
],
}
export { dictsMap, columnsMap, initForm, initSearchForm, rules, formToDto, initGroupForm }
<file_sep>/src/api/exam/createExam/newTest/newTest.js
/**
* 新增新试题API请求接口
*/
import request from '@/router/axios'
/**
* 获取试题选项
* @param {Object} params 参数
*/
export function getTestOption (params) {
return request({
url: 'exms/dict/map',
method: 'get',
params: params,
})
}
/**
* 提交申请数据库选项
* @param {Object} params 对象
*/
export function postNewTest (params) {
return request({
url: '/exms/iepitembank/save',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json',
},
})
}
/**
* 获取试题列表
* @param {Object} params 参数
*/
export function getTestList (params) {
return request({
url: 'exms/iepitembank/pages',
method: 'get',
params: params,
})
}
/**
* 删除列表
*/
export function deleteApprovalById (params) {
return request({
url: '/exms/iepitembank/removeById',
method: 'post',
data: params,
})
}
/**
* 审核通过
* @param {Object} params 参数
*/
export function postExaminePass (params) {
return request({
url: 'exms/iepitembank/examine',
method: 'post',
data: params,
})
}
/**
* 审核不通过
* @param {Object} params 参数
*/
export function postExamineFalse (params) {
return request({
headers: {
'Content-Type': 'application/json',
},
url: 'exms/iepitembank/notpass',
method: 'post',
data: params,
})
}
/**
* 修改试题
* @param {Object} params 参数
*/
export function postModify (params) {
return request({
headers: {
'Content-Type': 'application/json',
},
url: 'exms/iepitembank/update',
method: 'post',
data: params,
})
}
/**
* 保存考试
*/
export function save (params) {
return request({
headers: {
'Content-Type': 'application/json',
},
url: '/exms/iepexamination/save',
method: 'post',
data: params,
})
}
/**
* 发布考试
*/
export function release (params) {
return request({
headers: {
'Content-Type': 'application/json',
},
url: '/exms/iepexamination/release',
method: 'post',
data: params,
})
}
/**
* 查看考试
*/
export function getExam (params) {
return request({
headers: {
'Content-Type': 'application/json',
},
url: '/exms/iepexamination/get',
method: 'get',
params: params,
})
}
/**
* 保存的修改
*/
export function updateSave (params) {
return request({
headers: {
'Content-Type': 'application/json',
},
url: '/exms/iepexamination/update',
method: 'post',
data: params,
})
}
/**
* 点击修改按钮
*/
export function getExamMsg (params) {
return request({
url: 'exms/iepitembank/getById',
method: 'get',
params: params,
})
}
/**
* 发布的修改
*/
export function updateRelease (params) {
return request({
headers: {
'Content-Type': 'application/json',
},
url: '/exms/iepexamination/updaterelease',
method: 'post',
data: params,
})
}
/**
* 批量导入试题
*/
export function postBatchIteamBank (params) {
return request({
url: '/exms/iepitembank/batchIteamBank',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json',
},
})
}
<file_sep>/src/views/crms/Customer/Page/Information/options.js
const columnsMap = [
{ label: '方案名称', prop: 'programName' },
{ label: '附件', prop: 'downLoadUrl' },
]
const initForm = () => {
return {
title: '',
cotext: '',
createTime: '',
tags: [],
}
}
export { columnsMap, initForm }
<file_sep>/src/api/hrms/daily_management.js
import request from '@/router/axios'
const prefixUrl = '/hrms'
// @/api/hrms/daily_management
export function getLaborContractPage (query) {
return request({
url: `${prefixUrl}/relation/labor_contract/maturity/page`,
method: 'get',
params: query,
})
}
export function sendLaborContractEmail (ids) {
return request({
url: `${prefixUrl}/relation/labor_contract/email`,
method: 'post',
data: ids,
})
}
export function getPersonnelDynamicsPage (query) {
return request({
url: `${prefixUrl}/administrative_approval/personnel/page`,
method: 'get',
params: query,
})
}
<file_sep>/src/views/fams/OrgAssets/Income/Monthly/options.js
import { initNow, getYear, getMonth } from '@/util/date'
const columnsMap = [
{
prop: 'id',
label: '编号',
},
{
prop: 'typeName',
label: '类别',
},
]
const initSearchForm = () => {
return {
year: new Date().getFullYear(),
companyId: '0',
bankId: '0',
month: new Date().getMonth()+1,
}
}
export { columnsMap, initSearchForm, initNow, getYear, getMonth }<file_sep>/src/api/admin/friend.js
import request from '@/router/axios'
const prefixUrl = '/admin/friend'
// @/api/admin/friend
export function getFriendPage (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
export function getFriendById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function getFriendAgreeReject (id, status) {
return request({
url: `${prefixUrl}/agree/reject/${id}?status=${status}`,
method: 'get',
})
}
<file_sep>/src/api/app/cpms/channel.js
import request from '@/router/axios'
const prefixUrl = '/cpms/channel_product'
export const getDetailsPage = (params) => {
return request({
url: `${prefixUrl}/details_page`,
method: 'get',
params: params,
})
}
export const getModulePage = (params) => {
return request({
url: `${prefixUrl}/module_page`,
method: 'get',
params: params,
})
}
// 组织详情产品集合
export const getDetailsList = (id) => {
return request({
url: `${prefixUrl}/details_list/${id}`,
method: 'get',
})
}
// 资源库资源统计
export const getResourceCount = () => {
return request({
url: `${prefixUrl}/resource_count`,
method: 'get',
})
}
// 频道页员工感想列表
export function getThoughtsList () {
return request({
url: `${prefixUrl}/thoughts_list`,
method: 'get',
})
}
// 频道页个人感想
export function getPersonalThoughts (id) {
return request({
url: `${prefixUrl}/personal_thoughts/${id}`,
method: 'get',
})
}
// 搜索结果统计
export function getSearchCount (params) {
return request({
url: `${prefixUrl}/search_count`,
method: 'get',
params: params,
})
}
// 频道分页首页产品列表
export function getDetailsIndex () {
return request({
url: `${prefixUrl}/details_index`,
method: 'get',
})
}
// 频道页意见反馈
export function getProposeList () {
return request({
url: `${prefixUrl}/propose_list`,
method: 'get',
})
}
// 频道页意见反馈
export function getproductCountList () {
return request({
url: `${prefixUrl}/product_count`,
method: 'get',
})
}
// 个人风采页师徒
export function getproductMentors (id) {
return request({
url: `${prefixUrl}/get_mentors/${id}`,
method: 'get',
})
}
<file_sep>/src/api/mlms/material/datum/configure.js
import request from '@/router/axios'
const prefixUrl = '/mlms/materiallevel'
export function getTableData (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
export function getConfigureTree () {
return request({
url: `${prefixUrl}/tree`,
method: 'get',
})
}
export function createData (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function updateData (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function deleteDate (id) {
let ids = typeof id === 'object' ? id : [id]
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}
// 重名验证
export function validateName (name) {
return request({
url: `${prefixUrl}/get/name/${name}`,
method: 'post',
})
}
<file_sep>/src/api/admin/mobile.js
import request from '@/router/axios'
export function getMobileCode (mobile) {
return request({
url: `/admin/mobile/${mobile}`,
method: 'get',
})
}<file_sep>/src/api/cpms/technology.js
import request from '@/router/axios'
export const prefixUrl = '/cpms/technology'
export function getTechnologyPage (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
export function postTechnology (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function putTechnology (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function getTechnologyById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function deleteTechnologyById (id) {
return request({
url: `${prefixUrl}/delete/${id}`,
method: 'post',
})
}
<file_sep>/src/api/hrms/post_library.js
import request from '@/router/axios'
const prefixUrl = '/hrms/post_library'
// @/api/hrms/post_library
export function getPostLibraryPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function getLibraryPage (query) {
return request({
url: 'hrms/channel_recruit/job/bank',
method: 'get',
params: query,
})
}
export function postPostLibrary (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function putPostLibrary (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function deletePostLibraryById (id) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: [id],
})
}
export function deletePostLibraryBatch (ids) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}<file_sep>/src/views/cpms/technologys/options.js
// org config options
const dictsMap = {
status: {
0: '待开发', 1: '开发中', 2: '已完成',
},
}
const columnsMap = []
const Column = {
id: '',
name: '', // 名字
imageUrl: '', // logo
synopsis: '', // 简介
userRelationCharges: [], // 负责人s
}
const initForm = () => {
return {
id: '', // ID
imageUrl: '', // logo
number: '', // 编号
name: '', // 名称
englishName: '', // 英文名称
status: '', // 状态(0-待开发,1-开发中,2-已完成)
type: '', // 类别
synopsis: '', // 简介
description: '', // 介绍
moduleRelations: [],//模块关联集合
materialRelations: [],//材料关联集合
technologyRelations: [],//技术关联集合
userRelationCharges: [],//负责人集合
tagKeywords: [],//关联标签
}
}
const toDtoForm = (row) => {
const newForm = { ...row }
newForm.userCharges = row.userRelationCharges.map(m => m.id)
newForm.technologys = row.technologyRelations.map(m => m.id)
newForm.materials = row.materialRelations.map(m => m.id)
newForm.modules = row.moduleRelations.map(m => m.id)
return newForm
}
const initSearchForm = () => {
return {
type: '',
status: '',
}
}
const rules = {
imageUrl: [
{ required: true, message: '请上传图片', trigger: 'blur' },
],
number: [
{ required: true, message: '请填写技术编号', trigger: 'blur' },
],
name: [
{ required: true, message: '请填写技术名称', trigger: 'blur' },
],
englishName: [
{ required: true, message: '请填写英文名称', trigger: 'blur' },
],
type: [
{ required: true, message: '请填写技术类型', trigger: 'blur' },
],
status: [
{ required: true, message: '请填写技术状态', trigger: 'blur' },
],
tagKeywords: [
{ type: 'array', min: 3, message: '标签至少 3 个', trigger: 'change' },
{ type: 'array', required: true, message: '请填写标签', trigger: 'change' },
],
userRelationCharges: [
{ required: true, message: '请填写负责人', trigger: 'blur' },
],
synopsis: [
{ required: true, message: '请填写技术简介', trigger: 'blur' },
],
description: [
{ required: true, message: '请填写技术介绍', trigger: 'blur' },
],
}
export { dictsMap, columnsMap, Column, initForm, toDtoForm, initSearchForm, rules }
<file_sep>/src/views/hrms/EmployeeProfile/options.js
import { mergeByFirst } from '@/util/util'
import { initNow } from '@/util/date'
const dictsMap = {
status: {
0: '暂无',
1: '正式员工',
2: '试用期员工',
3: '实习期员工',
4: '兼职员工',
5: '其他',
6: '离职员工',
},
lockOrg: {
0: '正常',
1: '审核中',
2: '锁定',
},
}
const initForm = () => {
return {
id: '', // 用户ID 不可编辑
name: '', // 姓名 不可编辑
userName: '', // 用户名 不可编辑
orgId: '', // 组织ID 不可编辑
orgName: '', // 组织名 不可编辑
orgList: [], // 组织名 不可编辑
staffId: '', // 工号
isStaff: false, // 是否设置了工号
identityMark: [], // 身份标识
identityMarks: [], // 身份标识
avatar: '', // 头像
roleName: [], // 角色
// orgName: '组织', // 资产所属公司 不可编辑
integrity: 0, // 资料完善
position: [], // 岗位
positionName: '', // 岗位
signature: '', // 个性签名
externalTitle: '', // 外部头衔
socialRela: '', // 对外头衔
people: [], // 标签名字
job: '', // 职务
jobId: '', // 职务
title: '', // 职称
titleId: '', // 职称
entryTime: '', // 入职时间
positiveTime: '', // 转正时间
transferTime: '', // 调动时间
status: '', // 员工状态
deptList: [], // 所属部门
deptIds: [], // 所属部门
dept: [], // 所属部门
deptQm: '', // 资产所属组织
birthday: '', // 出生年月
sex: '', // 性别
sexName: '', // 性别
nationality: '', // 民族
politics: '', // 政治面貌字典
marriage: '', // 婚姻状况
bear: '', // 生育状况
language: '', // 外语水平
education: '', // 最高学历
university: '', // 毕业学校
profession: '', // 专业
graduationTime: '', // 毕业时间
referrer: '', // 推荐人
abilityTag: [], // 我能
projectTag: [], // 我要
learningTag: [], // 我想
workExperience: [], // 工作经历
trainingSituation: [], // 培训情况
eduSituation: [], // 学习情况
userCert: [], // 资质证书
accountTypeId: '', // 户口类别
accountTypeName: '', // 户口类别
accountLocation: '', // 户口所在地
residenceCities: [], // (户口)
residenceAddress: '', // 户籍地址
provinceName: '', // 户籍地址
cityName: '', // 户籍地址
currentCities: [], // 现住
currentAddress: '', // 现住地址
IDCard: '', // 身份证
phone: '', // 联系手机
wechat: '', // 微信
qq: '', // QQ
email: '', // 邮箱
home: '', // 邮箱
birthplaceProvince: '', //所属省(户口)
birthplaceCity: '',//所属市(户口)
province: '', //所属省(现住)
city: '', //所属市(现住)
emergencyName: '', // 应急联系人
emergencyPhone: '', // 应急联系方式
signingTime: '', // 劳动合同签订时间
benefitsStartTime: '', // 社保福利起缴时间
benefitsStopTime: '', // 社保福利停缴时间
separationTime: '', // 离职时间
careerPlanning: '',//职业规划
laborContract: [],//劳动合同
welfare: [],//社保福利
transfer: [],//调动情况
dimission: [],//离职信息
}
}
const formToVo = (row) => {
const newForm = mergeByFirst(initForm(), row)
newForm.isStaff = !!newForm.staffId
newForm.identityMark = newForm.identityMarks.map(m => m.value)
return newForm
}
const formToDto = (row) => {
const newForm = mergeByFirst(initForm(), row)
newForm.province = row.currentCities[0]
newForm.city = row.currentCities[1]
newForm.birthplaceProvince = row.residenceCities[0]
newForm.birthplaceCity = row.residenceCities[1]
newForm.positionId = row.position[row.position.length - 1]
newForm.deptIds = row.dept.map(m => m.id)
return newForm
}
// 入职 0,6
// 转正 2,3,4,5
// 调动 1,2,3,4,5
// 离职 1,2,3,4,5
const columnsMap = [
{
prop: 'sex',
label: '性别',
width: 55,
hidden: false,
key: 'sex',
},
{
prop: 'entryTime',
label: '入职时间',
hidden: false,
key: 'employedDate',
type: 'date',
formatString: 'YYYY-MM-DD',
},
{
prop: 'userName',
label: '用户名',
hidden: true,
key: 'userName',
},
{
prop: 'integrity',
label: '资料完善(%)',
hidden: true,
key: 'integrity',
},
{
prop: 'position',
label: '岗位',
hidden: false,
key: 'position',
},
{
prop: 'staffId',
label: '工号',
hidden: true,
key: 'staffNo',
},
{
prop: 'status',
label: '员工状态',
type: 'dict',
hidden: false,
key: 'userStatus',
},
{
prop: 'lockOrg',
label: '锁定状态',
type: 'dict',
hidden: true,
key: 'lockOrg',
},
{
prop: 'IDCard',
label: '身份证',
hidden: false,
key: 'idCard',
},
{
prop: 'socialRela',
label: '对外头衔',
hidden: true,
key: 'socialRela',
},
{
prop: 'externalTitle',
label: '外部头衔',
hidden: true,
key: 'externalTitle',
},
{
prop: 'job',
label: '职务',
hidden: true,
key: 'job',
},
{
prop: 'title',
label: '职称',
hidden: true,
key: 'title',
},
{
prop: 'positiveTime',
label: '转正时间',
hidden: true,
key: 'regDate',
},
{
prop: 'transferTime',
label: '调动时间',
hidden: true,
key: 'transferTime',
},
{
prop: 'birthday',
label: '出生年月',
hidden: true,
key: 'birthDate',
},
{
prop: 'nationality',
label: '民族',
hidden: true,
key: 'nation',
},
{
prop: 'politicsStatus',
label: '政治面貌',
hidden: true,
key: 'politicsName',
type: 'dictGroup',
dictName: 'hrms_politics_face',
},
{
prop: 'marriageStatus',
label: '婚姻状况',
hidden: true,
key: 'marriageName',
type: 'dictGroup',
dictName: 'hrms_marriage_status',
},
{
prop: 'birthStatus',
label: '生育状况',
hidden: true,
key: 'bearName',
type: 'dictGroup',
dictName: 'hrms_birth_status',
},
// {
// prop: 'language',
// label: '外语水平',
// hidden: true,
// },
{
prop: 'education',
label: '最高学历',
hidden: true,
key: 'education',
type: 'dictGroup',
dictName: 'hrms_highest_educational',
},
{
prop: 'university',
label: '毕业学校',
hidden: true,
key: 'university',
},
{
prop: 'profession',
label: '专业',
hidden: true,
key: 'major',
},
{
prop: 'graduationTime',
label: '毕业时间',
hidden: true,
key: 'graduateTime',
},
{
prop: 'referrer',
label: '推荐人',
hidden: true,
key: 'recommend',
},
{
prop: 'residentType',
label: '户口类别',
hidden: true,
key: 'residentType',
type: 'dictGroup',
dictName: 'hrms_resident_type',
},
// {
// prop: 'accountLocation',
// label: '户口所在地',
// hidden: true,
// },
{
prop: 'residenceAddress',
label: '户籍地址',
hidden: true,
key: 'residenceAddress',
},
{
prop: 'currentAddress',
label: '现住地址',
hidden: true,
key: 'currentAddress',
},
{
prop: 'phone',
label: '联系手机',
hidden: true,
key: 'phone',
},
{
prop: 'weChat',
label: '微信',
hidden: true,
key: 'wechat',
},
{
prop: 'qq',
label: 'QQ',
hidden: true,
key: 'qq',
},
{
prop: 'email',
label: '邮箱',
hidden: true,
key: 'email',
},
{
prop: 'emergencyName',
label: '应急联系人',
hidden: true,
key: 'emergencyPerson',
},
{
prop: 'emergencyPhone',
label: '应急联系方式',
hidden: true,
key: 'emergencyContact',
},
{
prop: 'signingTime',
label: '劳动合同签订时间',
hidden: true,
key: 'signingTime',
},
{
prop: 'benefitsStartTime',
label: '社保福利起缴时间',
hidden: true,
key: 'benefitsStartTime',
},
{
prop: 'benefitsStopTime',
label: '社保福利停缴时间',
hidden: true,
key: 'benefitsStopTime',
},
{
prop: 'separationTime',
label: '离职时间',
hidden: true,
key: 'separationTime',
},
{
prop: 'deptList',
label: '所属部门',
hidden: true,
width: 100,
type: 'tag',
key: 'deptList',
},
]
const initSearchForm = () => {
return {
name: '',
sex: '',
dept: [],
position: [],
jobId: '',
titleId: '',
cities: [],
rangeTime: [],
status: '',
lockOrg: '',
}
}
const initDtoSearchForm = () => {
return {
name: '',
sex: '',
deptId: '',
positionId: '',
jobId: '',
titleId: '',
province: '',
city: '',
startTime: '',
endTime: '',
status: '',
lockOrg: '',
}
}
const toDtoSearchForm = (row) => {
const newForm = mergeByFirst(initDtoSearchForm(), row)
newForm.startTime = row.rangeTime[0]
newForm.endTime = row.rangeTime[1]
newForm.province = row.cities[0]
newForm.city = row.cities[1]
newForm.positionId = row.position[row.position.length - 1]
newForm.deptId = row.dept[row.dept.length - 1]
return newForm
}
const initTransferForm = () => {
return {
id: '',
// dept: [],
position: [],
jobId: '',
titleId: '',
transferTime: initNow(),
}
}
const initDtoTransferForm = () => {
return {
id: '',
// deptId: '',
positionId: '',
jobId: '',
titleId: '',
transferTime: '',
}
}
const transferFormToDto = (form) => {
const newForm = mergeByFirst(initDtoTransferForm(), form)
newForm.positionId = form.position[form.position.length - 1]
// newForm.deptId = form.dept[form.dept.length - 1]
return newForm
}
const initDepartureForm = () => {
return {
id: '',
departureTime: initNow(),
reason: '',
}
}
const initInductionForm = () => {
return {
id: '',
status: 2,
inductionTime: initNow(),
}
}
const initPositiveForm = () => {
return {
id: '',
positiveTime: initNow(),
}
}
const rules = {
staffId: [
{ required: true, message: '请填写员工编号', trigger: 'blur' },
],
position: [
{ required: false, message: '请填写岗位', trigger: 'blur' },
],
jobId: [
{ required: false, message: '请填写职务', trigger: 'blur' },
],
titleId: [
{ required: false, message: '请填写职称', trigger: 'blur' },
],
entryTime: [
{ required: true, message: '请填写入职时间', trigger: 'blur' },
],
positiveTime: [
{ required: true, message: '请填写转正时间', trigger: 'blur' },
],
status: [
{ required: true, message: '请填写员工状态', trigger: 'blur' },
],
externalTitle: [
{ min: 2, message: '外部头衔至少 2 个字符以上', trigger: 'blur' },
{ max: 20, message: '外部头衔不得超过 20 个字符', trigger: 'blur' },
],
abilityTag: [
{ type: 'array', max: 20, message: '标签不得超过 20 个', trigger: 'change' },
],
projectTag: [
{ type: 'array', max: 20, message: '标签不得超过 20 个', trigger: 'change' },
// { type: 'array', required: true, message: '请填写我要标签', trigger: 'change' },
],
learningTag: [
{ type: 'array', max: 20, message: '标签不得超过 20 个', trigger: 'change' },
// { type: 'array', required: true, message: '请填写我想标签', trigger: 'change' },
],
careerPlanning: [
{ max: 2000, message: '字符不得超过 2000 个', trigger: 'change' },
],
}
const selfRules = {
...rules,
avatar: [
{ required: true, message: '请上传头像', trigger: 'blur' },
],
dept: [
{ required: true, message: '请填写所属部门', trigger: 'blur' },
],
socialRela: [
{ required: true, message: '请填写外部头衔', trigger: 'blur' },
],
birthday: [
{ required: true, message: '请填写出生年月', trigger: 'blur' },
],
sex: [
{ required: true, message: '请填写性别', trigger: 'blur' },
],
nationality: [
{ required: true, message: '请填写民族', trigger: 'blur' },
],
politics: [
{ required: true, message: '请填写政治面貌', trigger: 'blur' },
],
marriage: [
{ required: true, message: '请填写婚姻状况', trigger: 'blur' },
],
bear: [
{ required: true, message: '请填写生育状况', trigger: 'blur' },
],
language: [
{ required: false, message: '请填写外语水平', trigger: 'blur' },
],
education: [
{ required: true, message: '请填写最高学历', trigger: 'blur' },
],
university: [
{ required: true, message: '请填写毕业学校', trigger: 'blur' },
],
profession: [
{ required: true, message: '请填写专业', trigger: 'blur' },
],
graduationTime: [
{ required: true, message: '请填写毕业时间', trigger: 'blur' },
],
referrer: [
{ required: false, message: '请填写推荐人', trigger: 'blur' },
],
accountTypeId: [
{ required: true, message: '请填写户口类型', trigger: 'blur' },
],
residenceAddress: [
{ required: true, message: '请填写户籍地址', trigger: 'blur' },
],
currentAddress: [
{ required: true, message: '请填写现住地址', trigger: 'blur' },
],
IDCard: [
{ required: true, message: '请填写身份证号码', trigger: 'blur' },
],
phone: [
{ required: true, message: '请填写联系电话', trigger: 'blur' },
],
wechat: [
{ required: true, message: '请填写微信', trigger: 'blur' },
],
qq: [
{ required: true, message: '请填写qq', trigger: 'blur' },
],
email: [
{ required: true, message: '请填写邮箱', trigger: 'blur' },
],
home: [
{ max: 2000, message: '字符不得超过 2000 个', trigger: 'change' },
],
emergencyName: [
{ required: true, message: '请填写应急联系人', trigger: 'blur' },
],
emergencyPhone: [
{ required: true, message: '请填写应急联系人电话', trigger: 'blur' },
],
}
export { dictsMap, columnsMap, initForm, formToVo, formToDto, transferFormToDto, initSearchForm, initTransferForm, initDepartureForm, initInductionForm, initPositiveForm, toDtoSearchForm, rules, selfRules }<file_sep>/src/api/exam/examLibrary/examRegistration/examRegistration.js
/**
* 新增报名管理API请求接口
*/
import request from '@/router/axios'
/**
* 获取试题列表
* @param {Object} params 参数
*/
export function getExamRegistrationList (params) {
return request({
url: '/exms/iepentryform/getIepEntryFormPage',
method: 'get',
params: params,
})
}
/**
* 通过审核
*/
export function passExamerById (params) {
return request({
url: '/exms/iepentryform/batchState',
method: 'post',
data: params,
})
}
/**
* 撤销资格
*/
export function cancelExamerById (params) {
return request({
url: '/exms/iepentryform/changeStat',
method: 'post',
data: params,
})
}
/**
* 删除
*/
export function deleteById (params) {
return request({
url: '/exms/iepentryform/removeByIds',
method: 'post',
data: params,
})
}
<file_sep>/src/views/fams/FinancialManagement/WorkBench/AccountsReceivableDetail/options.js
const columnsMap = [
{
prop: 'projectNum',
label: '项目编号',
},
{
prop: 'projectName',
label: '项目名称',
},
{
prop: 'createTime',
label: '创建时间',
},
{
prop: 'amount',
label: '合同金额',
},
{
prop: 'invoicingAmount',
label: '开票金额',
},
]
const initForm = () => {
return {
projectName: '',
contractAmount: 0,
publisher: '',
serialNo: '',
publisherList: { id: '', name: '' },
projectManagerList: { id: '', name: '' },
mktManagerList: { id: '', name: '' },
projectTime: '',
endTime: '',
}
}
export { columnsMap, initForm }<file_sep>/src/api/evaluate/question.js
import request from '@/router/axios'
const queryUrl = '/question/dna_questionnaire'
export function createData (data) {
return request({
url: `${queryUrl}/create`,
method: 'post',
data: data,
})
}
//更新问卷
export function updateData (data) {
return request({
url: `${queryUrl}/update`,
method: 'post',
data: data,
})
}
//获取列表页面
export function getList (params) {
return request({
url: `${queryUrl}/page`,
method: 'get',
params: params,
})
}
//删除
export function deleteData (id) {
return request({
url: `${queryUrl}/delete/${id}`,
method: 'post',
})
}
//查看详情
export function getDetail (id) {
return request({
url: `${queryUrl}/${id}`,
method: 'get',
})
}
//发布
export function release (data) {
return request({
url: `${queryUrl}/update_status`,
method: 'post',
data: data,
})
}
//答案详情
export function getDetailAnswer (params) {
return request({
url: '/question/dna_answer/page',
method: 'get',
params: params,
})
}
//回答问卷
export function answerQuestion (data) {
return request({
url: '/question/dna_answer/create',
method: 'post',
data: data,
})
}
//获取当前用户id所回答过的问卷
export function getQuestionnaireIdList () {
return request({
url: '/question/dna_answer/getQuestionnaireIdList',
method: 'get',
})
}
//获取项目列表
export function getProject () {
return request({
url: '/evaluate/evaluateproject/getAll',
method: 'get',
})
}
//根据项目id获取参评单位
export function getGroupDept (id) {
return request({
url: `/evaluate/evaluategrouping/select?projectId=${id}`,
method: 'get',
})
}
//获取一道题的统计
export function getStatistic (id) {
return request({
url: `/question/statistic/${id}`,
method: 'get',
})
}
// /statistic/getRePercent/{questionId}
export function getRePercent (id) {
return request({
url: `/question/statistic/getRePercent/${id}`,
method: 'get',
})
}
//根据指标id获取指标信息
export function getIndexById (id) {
return request({
url: `/evaluate/evaluateindexsystemrelation/${id}`,
method: 'get',
})
}
//根据项目Id获取指标体系列表 getIndexList
export function getIndexList (params) {
return request({
url: '/evaluate/evaluateindexsystem/listForIndexSystem',
method: 'get',
params: params,
})
}
// 保存时候新增删除
export function automaticGrading (data) {
return request({
url: '/evaluate/evaluateindexsystemrelation/autoGradingStatus',
method: 'post',
data: data,
})
}
<file_sep>/src/views/wel/dynamic/options.js
import { mergeByFirst } from '@/util/util'
// import { initNow } from '@/util/date'
const dictsMap = {
status: {
},
}
const columnsMap = [
{
prop: 'time',
label: '时间',
width:300,
},
{
prop: 'behavior',
label: '行为',
},
]
const initForm = () => {
return {
}
}
const initDtoForm = () => {
return {
}
}
const formToDto = (row) => {
const newForm = mergeByFirst(initDtoForm(), row)
newForm.positionId = row.position[row.position.length - 1]
newForm.deptId = row.dept[row.dept.length - 1]
return newForm
}
const initSearchForm = () => {
return {
position: [], // 岗位id
dept: [], // 部门ID
sex: 0, // 性别id
status: null, // 招聘状态id
rangeTime: null, // 开始时间
}
}
const initDtoSearchForm = () => {
return {
positionId: null, // 岗位id
deptId: null, // 部门ID
sex: 0, // 性别id
status: null, // 招聘状态id
startTime: null, // 开始时间
endTime: null, // 结束时间
}
}
// positionId: 1, // 岗位id
// deptId: 1, // 部门ID
// sex: 1, // 性别id
// status: 1, // 招聘状态id
// startTime: initNow(), // 开始时间
// endTime: initNow(), // 结束时间
const toDtoSearchForm = (row) => {
const newForm = mergeByFirst(initDtoSearchForm(), row)
newForm.sex = row.sex ? row.sex : null
newForm.positionId = row.position.length && row.position[row.position.length - 1]
newForm.deptId = row.dept && row.dept[row.dept.length - 1]
if (row.rangeTime) {
newForm.startTime = row.rangeTime[0]
newForm.endTime = row.rangeTime[1]
}
return newForm
}
const rules = {
position: [
{ required: true, type: 'array', message: '请填写岗位', trigger: 'blur' },
],
dept: [
{ required: true, message: '请填写部门', trigger: 'blur' },
],
recruitsCount: [
{ required: true, message: '请填写招聘人数', trigger: 'blur' },
],
targetCount: [
{ required: true, message: '请填写目标人数', trigger: 'blur' },
],
academicId: [
{ required: true, message: '请填写学历要求', trigger: 'blur' },
],
jobTypeId: [
{ required: true, message: '请填写工作类型', trigger: 'blur' },
],
years: [
{ required: true, message: '请填写工作年限', trigger: 'blur' },
],
profession: [
{ required: true, message: '请填写专业要求', trigger: 'blur' },
],
place: [
{ required: true, message: '请填写工作地点', trigger: 'blur' },
],
sex: [
{ required: true, message: '请填写性别', trigger: 'blur' },
],
treatment: [
{ required: true, message: '请填写工资待遇', trigger: 'blur' },
],
language: [
{ required: true, message: '请填写外语要求', trigger: 'blur' },
],
term: [
{ required: true, message: '请填写招聘期限', trigger: 'blur' },
],
welfare: [
{ required: true, message: '请填写福利待遇', trigger: 'blur' },
],
duties: [
{ required: true, message: '请填写岗位职责', trigger: 'blur' },
],
claim: [
{ required: true, message: '请填写岗位要求', trigger: 'blur' },
],
}
export { dictsMap, columnsMap, initForm, initSearchForm, formToDto, toDtoSearchForm, rules }<file_sep>/src/views/wel/tasks/NotBegin/options.js
// org config options
const dictsMap = {
taskStatus: {
0: '接收任务',
1: '进行中',
2: '已完成',
},
}
const columnsMap = [
{
prop: 'taskDate',
label: '日期',
width:'150',
},
{
prop: 'taskName',
label: '任务名称',
width:'250',
},
{
prop: 'taskStatus',
label: '状态',
type: 'dict',
},
]
const initForm = () => {
return {
name: '',
isOpen: false,
intro: '',
}
}
const initSearchForm = () => {
return {
name: '',
sex: '',
}
}
export { dictsMap, columnsMap, initForm, initSearchForm }<file_sep>/src/api/ims/announcement.js
import request from '@/router/axios'
const prefixUrl = '/ims/announcement'
// @/api/ims/announcement
export function getAnnouncementPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function getAnnouncementById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function postAnnouncement (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function putAnnouncement (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function publishAnnouncement (id) {
return request({
url: `${prefixUrl}/publish/${id}`,
method: 'get',
})
}
export function readAnnouncementBatch (ids) {
return request({
url: `${prefixUrl}/read_or_set/batch`,
method: 'post',
data: ids,
params: {
type: 8,
},
})
}
export function markAnnouncementBatch (ids) {
return request({
url: `${prefixUrl}/read_or_set/batch`,
method: 'post',
data: ids,
params: {
type: 9,
},
})
}
<file_sep>/src/api/wel/et.js
import request from '@/router/axios'
const prefixUrl = '/admin/wel/et'
// @/api/wel/et
export function getOrgProfile () {
return request({
url: `${prefixUrl}/org/info`,
method: 'get',
})
}
export function getOrgCount () {
return request({
url: `${prefixUrl}/org/count`,
method: 'get',
})
}
export function getPendingList (id) {
return request({
url: `${prefixUrl}/pending/list/${id}`,
method: 'get',
})
}
export function getUserRelationList () {
return request({
url: `${prefixUrl}/user/relation/list`,
method: 'get',
})
}
export function getInstructionsList () {
return request({
url: `${prefixUrl}/instructions/list`,
method: 'get',
})
}
<file_sep>/src/api/exam/personalCenter/myCertificate/myCertificate.js
/**
* 新增模拟练习记录API请求接口
*/
import request from '@/router/axios'
/**
* 获取模拟练习记录列表页
* @param {Object} params 参数
*/
export function getCertificatePage (params) {
return request({
url: '/exms/iepcertificate/selectByUserId',
method: 'get',
params: params,
})
}
<file_sep>/src/views/goms/UnionManagement/RoleManagement/options.js
// org config options
//import { mergeByFirst } from '@/util/util'
const columnsMap = [
{
prop: 'roleCode',
label: '角色标识',
},
{
prop: 'roleDesc',
label: '角色描述',
width: '280px',
},
{
prop: 'creatorName',
label: '创建者',
},
{
prop: 'createTime',
label: '创建时间',
width: '150px',
},
]
const initForm = () => {
return {
roleId: '',
dsType: 3,
roleCode: '',
roleDesc: '',
roleName: '',
}
}
export { columnsMap, initForm }<file_sep>/src/views/goms/BasicConfiguration/OrganizationInformation/BasicInformation/options.js
// org config options
const dictsMap = {
status: {
0: '正常',
1: '待审核',
2: '锁定',
3: '待配置',
},
}
const optionMap = [{
label: '锁定',
value: 2,
}, {
label: '解锁',
value: 0,
}]
const columnsMap = [{
prop: 'realName',
label: '真实姓名',
},
{
prop: 'phone',
label: '手机',
},
{
prop: 'assetOrg',
label: '资产所属',
},
{
prop: 'status',
label: '员工状态',
type: 'dict',
},
]
const initForm = () => {
return {
orgId: '',
logo: '',
name: '',
abrName: '',
address: '',
establishTime: '',
creatorName: '',
contactMethod: '',
intro: '',
structure: '',
coreAdvantage: '',
abilityTag: [],
learningTag: [],
projectTag: [],
}
}
const initSearchForm = () => {
return {
name: '',
}
}
export {
dictsMap,
columnsMap,
optionMap,
initSearchForm,
initForm,
}<file_sep>/src/api/evaluate/indicatorSystem.js
import request from '@/router/axios'
import exportDownload from '@/util/export'
const queryUrl = '/evaluate'
export function getEvaluateindex (query) {
return request({
url: `${queryUrl}/evaluateindexsystem/page`, //列表
method: 'get',
params: query,
})
}
//获取工单列表
export function getEvaluateindexById (id) {
return request({
url: `${queryUrl}/evaluateindexsystem/${id}`, //详情
method: 'get',
})
}
// 删除
export function deleteData (id) {
return request({
url: `${queryUrl}/evaluateindexsystem/${id}`,
method: 'post',
})
}
// 批量删除
// export function deleteDatas (ids) {
// return request({
// url: `${queryUrl}/evaluateindexsystem/ids`,
// method: 'post',
// data: ids,
// })
// }
// 新增
export function postFormData (obj) {
return request({
url: `${queryUrl}/evaluateindexsystem/save`,
method: 'post',
data: obj,
})
}
// 更新
export function putFormData (obj) {
return request({
url: `${queryUrl}/evaluateindexsystem/update`,
method: 'post',
data: obj,
})
}
// 指标库导出
export function getExport (id,title='') {
return exportDownload({
url: `${queryUrl}/excel/export?standardSystemId=${id}`,
method: 'post',
title: title,
})
}
// 根据项目id获取指标体系内容
export function getPageById (params) {
return request({
url: `${queryUrl}/evaluateindexsystem/listByProjectId`,
method: 'get',
params: params,
})
}
//根据项目id为项目阶段获取指标体系内容
export function listForIndexSystem (params) {
return request({
url: `${queryUrl}/evaluateindexsystem/listForIndexSystem`,
method: 'get',
params: params,
})
}
///evaluate/evaluateindexsystem/isOrNotModifier
export function isOrNotModifier (obj) {
return request({
url: '/evaluate/evaluateindexsystem/isOrNotModifier',
method: 'post',
data: obj,
})
}
export function getQuesiotnEvaluateindexById (params) {
return request({
url: '/evaluate/evaluateindexsystem/getIndexSystemByWay', //详情
method: 'get',
params: params,
})
}
<file_sep>/src/api/tms/excel.js
import request from '@/router/axios'
const prefixUrl = '/tms'
// @/api/tms/excel
function getDownload (path, fileName) {
return request({
url: `${prefixUrl}${path}`,
method: 'get',
headers: {
'Content-Type': 'application/json',
},
responseType: 'arraybuffer',
}).then(response => {
// 处理返回的文件流
const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' })
const link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = `${fileName}.xls`
link.click()
})
}
export function getTagExcelExport () {
return getDownload('/excel/export', '标签导出信息')
}
// 提交
export function getModelExcel () {
return getDownload('/excel/model_download', '导入模板')
}<file_sep>/src/api/im/index.js
import request from '@/router/axios'
const prefixUrl = '/ims/im'
export function getTotalHistory () {
return request({
url: `${prefixUrl}/init`,
method: 'get',
})
}
export function getMoreHistory (params) {
return request({
url: `${prefixUrl}/get_history`,
method: 'get',
params,
})
}
export function clearUnread (data) {
return request({
url: `${prefixUrl}/read_all`,
method: 'post',
data,
})
}
export function createGroup (data) {
return request({
url: `${prefixUrl}/creat_group`,
method: 'post',
data,
})
}
export function updateGroupInfo (data) {
return request({
url: `${prefixUrl}/update_group`,
method: 'post',
data,
})
}
export function updateGroupMember (data) {
return request({
url: `${prefixUrl}/update_member`,
method: 'post',
data,
})
}
export function getGroup () {
return request({
url: `${prefixUrl}/get_group`,
method: 'get',
})
}
export function getGroupMembers (params) {
return request({
url: `${prefixUrl}/get_group_members`,
method: 'get',
params,
})
}
export function deleteGroup (data) {
return request({
url: `${prefixUrl}/del_group`,
method: 'post',
data,
})
}
export function getFile (fileName, mimeType) {
return request({
url: `${prefixUrl}/file/${fileName}`,
method: 'get',
responseType: 'arraybuffer',
params: {
mimeType,
},
})
}
export function getFileName (fileName) {
return request({
url: `${prefixUrl}/getfileName/${fileName}`,
method: 'get',
})
}
export function createCustomGroup (data) {
return request({
url: `${prefixUrl}/create_custom_group`,
method: 'post',
data,
})
}
export function moveToCustomGroup (data) {
return request({
url: `${prefixUrl}/add_custom_members`,
method: 'post',
data,
})
}
export function updateCustomGroup (data) {
return request({
url: `${prefixUrl}/update_custom_group`,
method: 'post',
data,
})
}
export function deleteCustomGroup (data) {
return request({
url: `${prefixUrl}/del_custom_group`,
method: 'post',
data,
})
}
export function getCustomGroup () {
return request({
url: `${prefixUrl}/get_custom_group`,
method: 'get',
})
}<file_sep>/src/api/app/mlms/material.js
import request from '@/router/axios'
const prefixUrl = '/mlms/material'
// 优秀材料
export const getExcellentList = (params) => {
return request({
url: `${prefixUrl}/excellent`,
method: 'get',
params: params,
})
}
<file_sep>/src/views/conm/ADManagement/options.js
const dictsMap = {
status: {
0: '禁用',
1: '正常',
},
}
const initForm = () => {
return {
adId: '', //广告id
adslotId: '',
name: '',// 广告名称
beginDate: '',//开始时间
endDate: '',//结束时间
url: '',//广告url
text: '',//广告文字
image: '', //广告图片
seq: '', //排序,
}
}
const columnsMap = [
{
prop: 'adId',
label: '广告id',
},
{
prop: 'name',
label: '广告名称',
},
{
prop: 'url',
label: '广告url',
},
]
const initSearchForm = () => {
return {
}
}
const rules = {
name: [{
required: true,
message: '请输入',
trigger: 'blur',
}],
}
const selfRules = {
...rules,
}
export { dictsMap, columnsMap, initForm, initSearchForm, rules, selfRules }<file_sep>/src/views/fams/RuleConfiguration/OrgAccountManagement/options.js
// org config options
const dictsMap = {
accountStatus: {
0: '正常',
1: '冻结',
},
}
const columnsMap = [
{
prop: 'orgName',
label: '所属组织',
type: 'detail',
},
{
prop: 'balance',
label: '可用金额',
},
{
prop: 'bankAmount',
label: '银行存款',
},
{
prop: 'cash',
label: '库存现金',
},
{
prop: 'groupAmount',
label: '集团往来',
},
{
prop: 'orgAmount',
label: '组织拆借',
},
{
prop: 'accountStatus',
label: '账户状态',
type: 'dict',
},
]
const initSearchForm = () => {
return {
orgName: '',
accountStatus: '',
}
}
export { dictsMap, columnsMap, initSearchForm }
<file_sep>/src/api/hrms/training_record.js
import request from '@/router/axios'
const prefixUrl = '/hrms/training_record'
// @/api/hrms/training_record
export function getTrainingRecordPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function getTrainingRecordPageByUserId (query) {
return request({
url: `${prefixUrl}/user/page`,
method: 'get',
params: query,
})
}
export function postTrainingRecord (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function putTrainingRecord (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function getTrainingRecordById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function deleteTrainingRecordById (id) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: [id],
})
}
export function deleteTrainingRecordBatch (ids) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}<file_sep>/src/views/fams/OrgBorrow/options.js
const dictsMap = {
borrowMoneyType: {
'0': '国脉贝',
'1': '线下支付',
},
status: {
'0': '向集团申请中',
'1': '集团核准通过且发起资金调拨',
'2': '待收款',
'3': '待还款',
'4': '向组织借款申请中',
'5': '被借款组织确认且打款',
'6': '借款组织确认收款',
'7': '已还款',
'8': '已撤回',
'9': '已逾期',
'10': '借款组织还款确认',
'11': '被借款组织确认',
},
}
const formatBorrow = (row) => {
let name = ''
if (row.borrowObjectType === 1) {
name = 'org_borrow_detail'
} else if (row.borrowObjectType === 2) {
name = 'union_borrow_detail'
} else {
return
}
return `/fams_spa/${name}/${row.id}`
}
//【0向集团申请中,1集团核准通过且发起资金调拨,2调拨对象汇款确认,3调入对象收款确认】
//向组织借款状态
//【4,向组织借款申请中,5被借款组织确认且打款,6借款组织确认收款】
//7已还款,8已撤回,9已逾期)
export { dictsMap, formatBorrow }<file_sep>/src/core/custom_use.js
import Vue from 'vue'
import IepDivider from '@/components/IepCustom/Divider.vue'
import IepButton from '@/components/IepCustom/Button'
import IepLink from '@/components/IepCustom/Link'
Vue.component(IepDivider.name, IepDivider)
Vue.component(IepButton.name, IepButton)
Vue.component(IepLink.name, IepLink)<file_sep>/src/views/atms/AllTasks/options.js
// org config options
const dictsMap = {
status: {
1: '未完成',
2: '已完成',
3: '已确认',
},
isOverDue: {
0: '未逾期',
1: '已逾期',
},
}
const columnsMap = [
{
prop: 'name',
label: '任务名称',
width:'250',
},
{
prop: 'status',
label: '状态',
type: 'dict',
},
{
prop: 'isOverDue',
label: '是否逾期',
type: 'dict',
},
{
prop: 'creatorName',
label: '创建人',
},
{
prop: 'principalName',
label: '负责人',
},
]
const initForm = () => {
return {
name: '',
isOpen: false,
intro: '',
}
}
const initSearchForm = () => {
return {
name: '',
sex: '',
}
}
export { dictsMap, columnsMap, initForm, initSearchForm }<file_sep>/src/api/app/mlms/index.js
import request from '@/router/axios'
const prefixUrl = '/mlms/channel_material'
export const getMenuList = (params) => {
return request({
url: `${prefixUrl}/level_tree`,
method: 'get',
params: params,
})
}
export const getMaterialLPage = (params) => {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
export const getTodayCount = (params) => {
return request({
url: `${prefixUrl}/today_count`,
method: 'get',
params: params,
})
}
// 猜你想找
export const getGuessList = (params) => {
return request({
url: `${prefixUrl}/guess`,
method: 'get',
params: params,
})
}
// 贡献榜
export const getContributeList = (params) => {
return request({
url: `${prefixUrl}/contribute`,
method: 'get',
params: params,
})
}
// 本周最热
export const getBestList = (params) => {
return request({
url: `${prefixUrl}/best`,
method: 'get',
params: params,
})
}
// 学习资料、制度文件
export const getMaterialList = (params) => {
return request({
url: `${prefixUrl}/list`,
method: 'get',
params: params,
})
}
// 组织详情方案材料集合
export const getOrgMaterialList = (id) => {
return request({
url: `${prefixUrl}/material_list/${id}`,
method: 'get',
})
}
// 分页查询合同
export const getContractPage = (params) => {
return request({
url: `${prefixUrl}/contract_page`,
method: 'get',
params: params,
})
}
// 首页要闻集合
export const getNewsList = (params) => {
return request({
url: `${prefixUrl}/news_list`,
method: 'get',
params: params,
})
}
// 数据-资料统计
export const getRankList = () => {
return request({
url: `${prefixUrl}/material/rankList`,
method: 'get',
})
}
// 数据-会议概况
export const getweek = () => {
return request({
url: `${prefixUrl}/meeting/week`,
method: 'get',
})
}
// 数据-客户拜访
export const getvisit = () => {
return request({
url: `${prefixUrl}/customer/visit`,
method: 'get',
})
}
// achievement
export const getAchievement = (id) => {
return request({
url: `${prefixUrl}/achievement/${id}`,
method: 'get',
})
}
// 投资达人
export const getInvestmentList = () => {
return request({
url: `${prefixUrl}/investment_list`,
method: 'get',
})
}
<file_sep>/src/router/config.js
export const noKeepAlive = {
keepAlive: false,
// isTab: false,
// isAuth: false,
}<file_sep>/src/api/exam/examLibrary/examReading/examReading.js
/**
* 新增阅卷管理API请求接口
*/
import request from '@/router/axios'
/**
* 获取阅卷管理列表页
* @param {Object} params 参数
*/
export function getExamReadingList (params) {
return request({
url: '/exms/grade/page',
method: 'get',
params: params,
})
}
/**
* 删除
*/
export function deleteById (id) {
return request({
url: 'exms',
method: 'post',
data: id,
})
}
/**
* 批量删除
*/
export function deleteIdAll (ids) {
return request({
url: 'exms',
method: 'post',
data: ids,
})
}
/**
*点击笔试阅卷先判断是否可以进行笔试阅卷
*/
export function judgeWrittenById (id) {
return request({
url: '/exms/grade/check',
method: 'post',
data: id,
})
}
/**
*根据id获取笔试阅卷信息
*/
export function passWrittenById (params) {
return request({
url: '/exms/grade/makding',
method: 'post',
data: params,
})
}
/**
* 提交选择题判分表单
*/
export function passChoiceById (params) {
return request({
url: 'exms',
method: 'post',
data: params,
})
}
/**
* 根据id获取面试信息
*/
export function getInterviewById (id) {
return request({
url: `/exms/grade/face/${id}`,
method: 'get',
})
}
/**
* 提交面试表单
*/
export function passInterviewById (params) {
return request({
url: '/exms/grade/face/save',
method: 'post',
data: params,
})
}
/**
* 根据id获取阅卷进度列表信息
*/
export function getPaperProcessById (id) {
return request({
url: `/exms/grade/examiner/${id}`,
method: 'get',
})
}
/**
* 列表里的发放证书
*/
export function sendCertificateById (params) {
return request({
url: 'exms/iepcertificate/grantone',
method: 'post',
params: params,
})
}
/**
* 阅卷进度里的发放证书
*/
export function sendCertificateAllById (params) {
return request({
url: '/exms/iepcertificate/grantall',
method: 'post',
params: params,
})
}
/**
* 一键收卷
*/
export function rollingPaperById (params) {
return request({
url: '/exms/grade/rolling',
method: 'post',
params: params,
})
}
/**
* 完成阅卷
*/
export function overPapersById (params) {
return request({
url: '/exms/grade/done',
method: 'post',
params: params,
})
}
/**
* 发送成绩
*/
export function sendResultById (params) {
return request({
url: 'exms',
method: 'post',
data: params,
})
}
/**
* 一键零分
*/
export function setZeroAll (params) {
return request({
url: '/exms/grade/tozero',
method: 'post',
params: params,
})
}
/**
* 纠正阅卷
*/
export function CorrectMarking (params) {
return request({
url: '/exms/iepcorrqstn/updateCorrQstn',
method: 'post',
params: params,
})
}<file_sep>/src/views/wenjuan/components/govDialogExport/README.md
## 数据基因 导出
> 基础
``` html
<gov-dialog-export
@submit="handleExportSubmit"
:data="data"
:listQuery="listQuery"
ref="exportDialog">
</gov-dialog-export>
```
### 属性/方法/回调
|参数|说明|类型|可选值|默认值|
|:--:|--|--|:--:|:--:|
|checkAll|是否全选中|Boolean||true|
|defaultProps|配置选项,具体见下表|Object|||
|listQuery|||||
|data|数据,配置选项,具体见下表|Object|||
|params|搜索参数|Object|||
|url|下载地址|String|||
|title|下载模板名称|String||模板|
> defaultProps
|参数|说明|类型|可选值|默认值|
|:--:|--|--|:--:|:--:|
|label|指定选项标签为选项对象的某个属性值|string|||
|value|指定选项的值为选项对象的某个属性值|string|||
>data
|参数|说明|类型|可选值|默认值|
|:--:|--|--|:--:|:--:|
|prop|字段名|String|||
|title|标题|String|||
|data|数据, 与defaultProps对应起来|Object||如:\{label:'', value: ''\}|
```javascript
import exportDownload from '@/util/export'
// api接口处写
export function getExport (params) {
return exportDownload({url: `/directory/dirExcel/download_data`, data: params})
}
/**
* 导出并下载流文件
* @param {[type]} url [路径]
* @param {String} method [请求方式]
* @param {Object} data [数据]
* @param {String} title [下载文件名]
* @return {[type]}
*/
exportDownload({url, method = 'post', data = {}, title = ''}){}
```
<file_sep>/src/views/exam/reviewCenter/examLibrary/examRegistration/option.js
export const dictsMap = {
type: {
'1': '类型1',
'2': '类型2',
},
isYes: [
{ value: 0, lable: '否' },
{ value: 1, label: '是' },
],
isOpen: [
{ value: 0, lable: '开放' },
{ value: 1, label: '关闭' },
],
secrecyLevel: [
{ value: 0, lable: '不保密' },
{ value: 1, label: '保密' },
],
}
export const tableOption = [
{
label: '科目',
prop: 'createTime',
width: '250',
},
{
label: '总分',
prop: 'views',
width: '100',
},
{
label: '开始时间',
prop: 'createTime',
// width: '250',
},
{
label: '结束时间',
prop: 'createTime',
// width: '250',
},
{
label: '状态',
prop: 'name',
width: '100',
},
{
label: '报名',
prop: 'name',
// width: '250',
},
{
label: '创建人',
prop: 'name',
// width: '250',
},
]
// 本地上传
export const initLocalForm = () => {
return {
uploader: '',
type: 0,
id: '',
materialName: '',
intro: '',
content: '',
firstClass: '',
secondClass: '',
materialType: '',
tagKeyWords: [],
isContri: '',
attachFileList: [],
attachFile: '',
isOpen: 0,
secrecyLevel: 0,
}
}
// 新建文档
export const initFormData = () => {
return {
uploader: '',
type: 1,
id: '',
materialName: '',
intro: '',
content: '',
firstClass: '',
secondClass: '',
materialType: '',
downloadCost: '',
tagKeyWords: [],
attachFileList: [],
isOpen: 0,
secrecyLevel: 0,
}
}
export const rules = {
materialName: [
{ required: true, message: '必填', trigger: 'blur' },
],
intro: [
{ required: true, message: '必填', trigger: 'blur' },
],
content: [
{ required: true, message: '必填', trigger: 'blur' },
],
firstClass: [
{ required: true, message: '必填', trigger: 'change' },
],
secondClass: [
{ required: true, message: '必填', trigger: 'change' },
],
materialType: [
{ required: true, message: '必填', trigger: 'change' },
],
tagKeyWords: [
{ required: true, message: '必填', trigger: 'change' },
],
isContri: [
{ required: true, message: '必填', trigger: 'change' },
],
downloadCost: [
{ required: true, message: '必填', trigger: 'change' },
],
uploader: [
{ required: true, message: '必填', trigger: 'change' },
],
isOpen: [
{ required: true, message: '必填', trigger: 'change' },
],
secrecyLevel: [
{ required: true, message: '必填', trigger: 'change' },
],
attachFileList: [
{ required: true, message: '必填', trigger: 'change' },
],
}
// 纠错
export function initWrongForm () {
return {
attachmentIds: [],
content: '',
emailId: 0,
materialIds: [],
projectIds: [],
receiverIds: [],
receiverList: {
unions: [],
orgs: [],
users: [],
},
reportIds: [],
status: 1,
subject: '',
summaryIds: [],
summaryList: [],
tagKeyWords: [],
type: 3, // 类型为纠错
kind: 0,
}
}
export const wrongRules = {
subject: [
{ required: true, message: '必填', trigger: 'blur' },
],
receiverIds: [
{ required: true, message: '必填', trigger: 'blur' },
],
content: [
{ required: true, message: '必填', trigger: 'blur' },
],
}
export const tipContent = {
materialName: '1、市场项目类文件:日期+项目名称/编号+文件描述+文件阶段标识,例如20190101丽水市信息化项目建设方案编制说明v1.0;<br/>' +
'2、政策规范制度类文件:日期+发布部门/单位+文件主题+文件阶段标识,例如20190101资产管理与投融资委员会发布关于国脉贝管理v1.0;<br/>' +
'3、学习资源类材料:文件主题+类型:如浙江省政府数字化转型的几点思考;<br/>' +
'备注:名称中切记出现特殊符号',
uploader: '1、材料撰写者;<br/>' +
'2、系统默认读取上传人为作者,如代替上传请修改姓名。',
intro: '1、材料内容主旨说明;<br/>' +
'2、字数在200字以上',
firstClass: '根据材料主题准确选择分类,确保分类的准确性!',
materialType: '根据材料实际性质进行选择,如方案,报告,清单等',
downloadCost: '1、全体或多数国脉人知晓的公司制度、文件、新生必读等材料均不设定下载贝额;<br/>' +
'2、线上或线下分享培训类相关材料不可设定下载贝额;<br/>' +
'3、常规材料不高于10(普遍性公共性,比如方案、研究报告模板等),特殊领域应用不高于50贝。',
tagKeyWords: '1、材料标签要突出材料主题,其中提及的合作项目简称,合作产品,客户简称等必须作为标签;<br/>' +
'2、标签次序按照重要性排序;<br/>' +
'3、标签数量必须3个以上。',
attachFileList: '1、附件上传形式多样,如DOC、PPT、TXT、PDF、XLS;<br/>' +
'2、材料只支持1个文件上传,大小限制在200M以内。',
}
export const tipContent2 = {
materialName: '1、文件主题+类型:如浙江省政府数字化转型的几点思考;<br/>' +
'备注:名称中切记出现特殊符号',
intro: '1、材料内容主旨说明;<br/>' +
'2、字数在50字以上',
content: '*正文 1、文章段落要求首行缩进2个字符;<br/>' +
'2、文章字体为默认字体;<br/>' +
'3、文章标题标注使用规范:<br/>' +
'①一级标题用一、二、三等标注;<br/>' +
'②二级标题用(一)、(二)、(三)等标注;<br/>' +
'③三级标题用1、2、3等标注;<br/>' +
'④四级标题用(1)、(2)、(3)等标注;',
firstClass: '根据材料主题准确选择分类,确保分类的准确性!',
materialType: '根据材料实际性质进行选择,如方案,报告,清单等',
tagKeyWords: '1、材料标签要突出材料主题,其中提及的合作项目简称,合作产品,客户简称等必须作为标签;<br/>' +
'2、标签次序按照重要性排序;<br/>' +
'3、标签数量必须3个以上。',
}<file_sep>/src/router/cfms/index.js
import Layout from '@/page/index/'
export default [
{
path: '/meeting/:id',
name: '报名页',
component: () => import('@/page/MeetingDetail/index'),
meta: {
keepAlive: false,
isTab: false,
isAuth: false,
},
},
{
path: '/meeting',
name: '报名页预览',
component: () => import('@/page/MeetingDetail/index'),
meta: {
keepAlive: false,
isTab: false,
isAuth: false,
},
},
{
path: '/myiframe',
component: Layout,
redirect: '/myiframe',
children: [
{
path: ':routerPath',
name: 'iframe',
component: () => import('@/components/iframe/main'),
props: true,
},
],
},
]
<file_sep>/src/api/crms/excell.js
import request from '@/router/axios'
// 客户模板下载
export function downloadModel () {
return request({
url: '/crm/crms/iepclientinfoexcel/download',
method: 'post',
responseType: 'arraybuffer',
}).then(response => {
// 处理返回的文件流
let filename = response.headers['content-disposition'].split(';')[1]
filename = decodeURIComponent(filename.split('=')[1])
// filename = decodeURIComponent(filename.split('"')[1])
const blob = new Blob([response.data])
const link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = filename
document.body.appendChild(link)
link.style.display = 'none'
link.click()
})
}
// 联系人模板下载
export function downloadContactModel () {
return request({
url: '/crm/clientcontactexcel/export',
method: 'post',
responseType: 'arraybuffer',
}).then(response => {
// 处理返回的文件流
let filename = response.headers['content-disposition'].split(';')[1]
filename = decodeURIComponent(filename.split('=')[1])
// filename = decodeURIComponent(filename.split('"')[1])
const blob = new Blob([response.data])
const link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = filename
document.body.appendChild(link)
link.style.display = 'none'
link.click()
})
}<file_sep>/src/api/admin/orgEvents.js
import request from '@/router/axios'
const prefixUrl = '/admin/org_events'
// 组织大事记列表
export function getOrgEventsPage (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
// 组织大事记列表
export function getOrgEventsById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
// 新增
export function orgEventsCreate (data) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: data,
})
}
// 修改
export function orgEventsUpdate (data) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: data,
})
}
// 删除
export function orgEventsDelete (id) {
return request({
url: `${prefixUrl}/delete/${id}`,
method: 'post',
})
}
// 根据组织id获取大事记集合
export function getOrgEventsByOrgId (id) {
return request({
url: `${prefixUrl}/list_events/${id}`,
method: 'get',
})
}
<file_sep>/src/router/hrms/index.js
import Layout from '@/page/index/index'
import { noKeepAlive } from '../config'
export default [
{
path: '/hrms_spa',
component: Layout,
redirect: '/hrms_spa/growth_file/:id',
children: [
{
path: 'employee_profile_edit/:id',
name: '员工信息编辑',
component: () => import(/* webpackChunkName: "hrms" */'@/views/hrms/EmployeeProfile/Page/Edit.vue'),
meta: noKeepAlive,
},
{
path: 'growth_file/:id',
name: '成长档案',
component: () => import(/* webpackChunkName: "hrms" */'@/views/hrms/GrowthFile/index.vue'),
meta: noKeepAlive,
},
{
path: 'approval/:id',
name: '新增审批',
component: () => import(/* webpackChunkName: "hrms" */'@/views/wel/approval/Components/New/index.vue'),
meta: noKeepAlive,
},
{
path: 'approval_detail/:id',
name: '审批详情',
component: () => import(/* webpackChunkName: "hrms" */'@/views/wel/approval/Components/Detail/index.vue'),
meta: noKeepAlive,
},
{
path: 'recruitment_publish/:id',
name: '发布招聘表单',
component: () => import(/* webpackChunkName: "hrms" */'@/views/hrms/Recruitment/Publish/Page/Edit.vue'),
meta: noKeepAlive,
},
{
path: 'suggestion_new',
name: '新增建议',
component: () => import(/* webpackChunkName: "hrms" */'@/views/hrms/Suggestion/New.vue'),
meta: noKeepAlive,
},
{
path: 'suggestion_edit/:id',
name: '修改建议',
component: () => import(/* webpackChunkName: "hrms" */'@/views/hrms/Suggestion/New.vue'),
meta: noKeepAlive,
},
{
path: 'suggestion_list',
name: '发布的建议列表',
component: () => import(/* webpackChunkName: "hrms" */'@/views/hrms/Suggestion/List.vue'),
meta: noKeepAlive,
},
{
path: 'suggestion_detail/:id',
name: '建议详情',
component: () => import(/* webpackChunkName: "hrms" */'@/views/hrms/Suggestion/Detail.vue'),
meta: noKeepAlive,
},
],
},
]
<file_sep>/src/views/wel/account-settings/options.js
const initForm = (username = null) => {
return {
username,
password: '',
newPassword1: '',
newPassword2: '',
}
}
export { initForm }<file_sep>/src/views/conm/DocumentManagement/options.js
const dictsMap = {
status: {
0: '禁用',
1: '正常',
},
}
const initForm = () => {
return {
id: '',
title: '',
createTime: '',//发布时间
status: 1,//状态
infoDescribe: '',//信息描述
tagKeyWords: [],
content: '',
image: '',
priority: 1, //优先级
attributeId: '',
keyWords: '',
}
}
const columnsMap = [
{
prop: 'status',
label: '状态',
type: 'dict',
},
]
const initSearchForm = () => {
return {
}
}
const rules = {
title: [{
required: true,
message: '请输入标题',
trigger: 'blur',
}],
}
export { dictsMap, columnsMap, initForm, initSearchForm, rules }<file_sep>/src/router/cpms/index.js
import Layout from '@/page/index/index'
export default [
{
path: '/cpms_spa',
component: Layout,
redirect: '/cpms_spa/product_detail',
children: [
{
path: 'product_edit/:id',
name: '产品编辑',
component: () => import('@/views/cpms/products/Page/Edit.vue'),
},
{
path: 'module_edit/:id',
name: '模块编辑',
component: () => import('@/views/cpms/modules/Page/Edit.vue'),
},
{
path: 'technology_edit/:id',
name: '技术编辑',
component: () => import('@/views/cpms/technologys/Page/Edit.vue'),
},
{
path: 'custom_management_detail/:id',
name: '定制管理详情',
component: () => import('@/views/cpms/CustomManagement/Detail.vue'),
},
{
path: 'my_custom_detail/:id',
name: '我的定制管理',
component: () => import('@/views/cpms/MyCustom/Detail.vue'),
},
],
},
]
<file_sep>/src/main.js
import Vue from 'vue'
import './permission' // 权限
import './error' // 日志
import router from './router/router'
import App from './App'
import store from './store'
import './plugins/element'
import './plugins/ant-design'
import './core/use'
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App),
}).$mount('#app')
<file_sep>/src/api/admin/guide.js
// org guide drivers
import request from '@/router/axios'
// @/api/admin/guide
const prefixUrl = '/admin/guide'
export function getOrgGuideDrivers () {
return request({
url: `${prefixUrl}/drivers`,
method: 'get',
})
}
export function getOrgGuideStep (step) {
return request({
url: `${prefixUrl}/step/${step}`,
method: 'get',
})
}
<file_sep>/src/views/cpms/ProductCustomization/options.js
// org config options
//import { mergeByFirst } from '@/util/util'
const columnsMap = [
{
prop: 'moduleName',
label: '模块名称',
},
{
prop: 'guidePrice',
label: '指导价格',
},
{
prop: 'preferentialPrice',
label: '优惠价格',
},
]
const initSearchForm = () => {
return {
customName: '',
synopsis: '',
}
}
const rules = {
customName: [
{ required: true, message: '请输入', trigger: 'blur' },
],
}
const initForm = () => {
return {
}
}
export { columnsMap, initForm, initSearchForm, rules }<file_sep>/src/views/wel/message/Announcement/options.js
import { mergeByFirst } from '@/util/util'
const columnsMap = [
{
prop: 'typeName',
label: '类型',
},
{
prop: 'time',
label: '时间',
width: 200,
},
]
const initForm = () => {
return {
id: 0, // 通知公告id
name: '', // 通知公告Title
time: '', // 通知公告时间
status: '',
sender: {
id: 0,
name: '',
}, // 发布人
receivers: {
unions: [],
orgs: [],
users: [],
}, // 接收人
content: '', // 发布人
type: '', // 邀请联盟,会议纪要
isMark: '', // 是否标记
}
}
const initDtoForm = () => {
return {
id: 0, // 通知公告id
name: '', // 通知公告Title
time: '', // 通知公告时间
status: '',
receivers: {
unionIds: [],
orgIds: [],
userIds: [],
}, // 接收人
content: '', // 发布人
type: '', // 邀请联盟,会议纪要
isMark: '', // 是否标记
}
}
const formToDto = (row) => {
const newForm = mergeByFirst(initDtoForm(), row)
newForm.title = row.name
newForm.text = row.content
newForm.receivers.unionIds = row.receivers.unions.map(m => m.id)
newForm.receivers.orgIds = row.receivers.orgs.map(m => m.id)
newForm.receivers.userIds = row.receivers.users.map(m => m.id)
return newForm
}
const formToVo = (row) => {
const newForm = mergeByFirst(initDtoForm(), row)
newForm.title = row.name
newForm.text = row.content
newForm.receivers.unions = row.receivers.unions || []
newForm.receivers.orgs = row.receivers.orgs || []
newForm.receivers.users = row.receivers.users || []
return newForm
}
export {
columnsMap,
initForm,
formToDto,
formToVo,
}
<file_sep>/src/views/wenjuan/config/avueBase.js
export let tableOptions = {
addBtn: false,
editBtn: false,
delBtn: false,
header: false,
selection: false,
menuBtn: false,
menuWidth: '180px',
index: false,
align: 'center',
column: [],
}<file_sep>/master.sh
#!/bin/bash
echo "Start Build New Master Branch!"
git reset --hard origin/develop \
&& git merge origin/feature/mcms/dev \
&& git merge origin/feature/tms/dev
echo "Success!"<file_sep>/src/views/goms/UnionManagement/WorkBench/options.js
const initAddAdminForm = () => {
return {
user: {
id: null,
name: null,
},
}
}
export { initAddAdminForm }<file_sep>/src/views/admin/org/options.js
// org config options
const dictsMap = {
isOpen: {
0: '开',
1: '关',
},
status: {
0: '审核通过',
1: '待审核',
2: '审核驳回',
},
}
const columnsMap = [
{
prop: 'name',
label: '组织名称',
type: 'detail',
},
{
prop: 'orgType',
label: '组织类别',
type: 'dictGroup',
dictName: 'GOMS_ORG_TYPE',
},
{
prop: 'intro',
label: '组织描述',
type: 'detail',
},
{
prop: 'isOpen',
label: '允许加入',
type: 'dict',
},
{
prop: 'createTime',
label: '创建时间',
minWidth: 120,
},
{
prop: 'creator',
label: '创建人',
width: 80,
},
{
prop: 'status',
label: '状态',
type: 'dict',
},
]
const initForm = () => {
return {
orgId: '',
logo: '',
name: '',
orgType: '',
isOpen: 0,
orgSort: 0,
abrName: '',
moduleIds: [],
establishTime: '',
creatorName: '',
contactMethod: '',
intro: '',
structure: '',
coreAdvantage: '',
}
}
const initOrgSearchForm = () => {
return {
name: '',
}
}
export { dictsMap, columnsMap, initForm, initOrgSearchForm }<file_sep>/src/views/mlms/material/datum/aptitude/option.js
export const dictsMap = {
type: {
1: '类型1',
2: '类型2',
},
}
export const tableOption = [
{
label: '浏览次数',
prop: 'views',
width: '150',
},
]
export const initFormData = () => {
return {
honorQualName: '',
intro: '',
type: '',
number: '',
acquireTime: '',
downloadCost: '',
tagKeyWords: [],
attachFileList: [],
attachFile: '',
image: '',
relationOrgId: '',
}
}
export function initSearchForm () {
return {
name: '',
honorQualType: '',
downloadCost: '',
creatorRealName: '',
orgName: '',
}
}
export const rules = {
honorQualName: [
{ required: true, message: '请输入荣誉资质的名称', trigger: 'blur' },
],
intro: [
{ required: true, message: '请输入介绍', trigger: 'blur' },
],
type: [
{ required: true, message: '请选择分类', trigger: 'change' },
],
number: [
{ required: true, message: '请输入专利号/证书号', trigger: 'blur' },
],
acquireTime: [
{ required: true, message: '请输入获得时间', trigger: 'blur' },
],
downloadCost: [
{ required: true, message: '请输入下载贝额', trigger: 'change' },
],
tagKeyWords: [
{ required: true, message: '请输入至少3个标签', trigger: 'change' },
],
image: [
{ required: true, message: '请上传专利/证书图片', trigger: 'change' },
],
}
export const tipContent = {
honorQualName:'1、日期+单位简称/产品+荣誉资质名称+类型:20190101数据基因发明专利审查合格通知书;<br/>' +
'备注:名称中切记出现特殊符号',
intro:'1、荣誉资质用途和发放单位等相关信息',
type:'1、专利2、软著3、认证 4、商标 5、评选奖项 6、软件评测',
number:'根据证书/通知书上信息填写',
acquireTime:'根据证书/通知书上日期正确填写',
downloadCost:'1、全体或多数国脉人知晓的公司制度、文件、新生必读等材料均不设定下载贝额;<br/>' +
'2、线上或线下分享培训类相关材料不可设定下载贝额;<br/>' +
'3、常规材料不高于10(普遍性公共性,比如方案、研究报告模板等),特殊领域应用不高于50贝。',
tagKeyWords:'1、标签必须三个以上;<br/>' +
'2、标签必须与荣誉资质材料内容密切相关;',
attachFileList:'支持jpg、png等格式',
image: '支持jpg、png等格式',
}<file_sep>/src/api/mlms/material/datum/contract.js
import request from '@/router/axios'
const prefixUrl = '/mlms/contract'
export function getTableData (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
export function getTableDataOnlyMe (obj) {
return request({
url: `${prefixUrl}/page/personal`,
method: 'get',
params: obj,
})
}
export function createData (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function updateData (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function deleteData (id) {
let ids = typeof id === 'object' ? id : [id]
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}
export function getDataById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
// 根据客户id查询市场经理
export function getManeger (obj) {
return request({
url: `${prefixUrl}/getManeger`,
method: 'get',
params: obj,
})
}
export function getContractListByName (query) {
return request({
url: `${prefixUrl}/all/contract/name/list`,
method: 'get',
params: query,
})
}
// 项目中关联的合同,联盟下的合同
export function getContractPageAll (query) {
return request({
url: `${prefixUrl}/page_all`,
method: 'get',
params: query,
})
}
// 复核
export function contractReview (obj) {
return request({
url: `${prefixUrl}/review`,
method: 'post',
data: obj,
})
}
// 移交
export function contractTransfer (obj) {
return request({
url: `${prefixUrl}/transfer`,
method: 'post',
data: obj.contractIds,
params: { userId: obj.userId },
})
}
<file_sep>/src/page/MeetingDetail/option.js
const initForm = () => {
return [
{
companyName: '', // 公司
position: '', // 职位
name: '', // 姓名
phoneNumber: '', // 联系电话
email: '', // 电子邮箱
},
]
}
var checkPhone = (rule, value, callback) => {
if (!value) {
return callback(new Error('手机号不能为空'))
} else {
const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
console.log(reg.test(value))
if (reg.test(value)) {
callback()
} else {
return callback(new Error('请输入正确的手机号'))
}
}
}
const rules = {
companyName: [{ required: true, message: '请输入公司名称', trigger: 'blur' }],
position: [{ required: true, message: '请输入职位', trigger: 'blur' }],
name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
phoneNumber: [{ required: true, validator: checkPhone, trigger: 'blur' }],
email: [{ message: '请输入电子邮箱', trigger: 'blur' }, { type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }],
note: [{ max: 80, message: '长度不超过80个字符', trigger: 'blur' }],
}
export { initForm, rules }<file_sep>/src/api/fams/personal_account_management.js
import request from '@/router/axios'
const prefixUrl = '/fams/personal_account_management'
// @/api/fams/rule_configuration
export function getPersonalAccountManagementPage (obj) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
data: obj,
})
}<file_sep>/src/store/modules/ics.js
const hrms = {
state: {
questionDialogShow: false,
},
mutations: {
SET_QUESTION_DIALOG_SHOW: (state, status) => {
state.questionDialogShow = status
},
},
actions: {
QuestionAndAnswer ({ commit }, status) {
commit('SET_QUESTION_DIALOG_SHOW', status)
},
},
}
export default hrms<file_sep>/src/views/hrms/Components/InlineFormTable/inline.js
import request from '@/router/axios'
const prefixUrl = '/hrms/relation'
// @/api/hrms/employee_profile
export function post (obj, relationName, type, rid) {
return request({
url: `${prefixUrl}/${relationName}/create`,
method: 'post',
params: {
type,
id: rid,
},
data: obj,
})
}
export function put (obj, relationName) {
return request({
url: `${prefixUrl}/${relationName}/update`,
method: 'post',
data: obj,
})
}
export function del (id, relationName) {
return request({
url: `${prefixUrl}/${relationName}/delete/${id}`,
method: 'post',
})
}<file_sep>/config/utils.js
const fs = require('fs')
const package = require('../package.json')
exports.getProject = function () {
return package.repository.name.toString().trim()
}
exports.getProjectTeam = function () {
return package.repository.team.toString().trim()
}
exports.getProjectName = function () {
return package.name.toString().trim()
}
exports.getCurrentTag = function () {
return package.version.toString().trim()
}
exports.getGitHash = function () {
const rev = fs.readFileSync('.git/HEAD').toString().trim();
if (rev.indexOf(':') === -1) {
return rev;
} else {
return fs.readFileSync('.git/' + rev.substring(5)).toString().trim();
}
}
exports.getProjectDesc = function () {
const desc = `更新日志为<a href="${package.repository.changelogurl}">${package.repository.changelogurl}</a>`
return desc.toString().trim()
}
<file_sep>/src/api/cpms/iepuserfollow.js
import request from '@/router/axios'
const prefixUrl = '/cpms/iepuserfollow'
// 关注用户
export function followById (id) {
return request({
url: `${prefixUrl}/follow/${id}`,
method: 'post',
})
}
// 取关用户
export function unfollowById (id) {
return request({
url: `${prefixUrl}/unfollow/${id}`,
method: 'post',
})
}
// 分页查询关注的用户
export function getFollowPage (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
<file_sep>/src/views/hrms/GrowthFile/options.js
const simpleEmployeeStatus = {
0: '暂无',
1: '在职',
2: '在职',
3: '在职',
4: '兼职',
5: '其他',
6: '离职',
}
const initForm = () => {
return {
avatar: '',
createTime: '',
id: '',
idCard: '',
isExpert: '',
job: '',
jobId: '',
name: '',
position: '',
positionId: '',
professionalTitleId: '',
sex: '',
staffNo: '',
status: '',
timeLineList: [],
abilityTag: [],
projectTag: [],
learningTag: [],
title: '',
updateTime: '',
}
}
export { simpleEmployeeStatus, initForm }<file_sep>/src/router/page/index.js
/**
* 基础路由
* @type { *[] }
*/
export default [
{
path: '/',
name: '主页',
redirect: '/wel/index',
},
{
path: '/login',
name: '登录页',
component: () => import('@/page/LoginRegister/login'),
meta: {
keepAlive: false,
isTab: false,
isAuth: false,
},
},
{
path: '/register',
name: '注册页',
component: () => import('@/page/LoginRegister/register'),
meta: {
keepAlive: false,
isTab: false,
isAuth: false,
},
},
{
path: '/authredirect',
name: '授权',
component: () => import('@/page/authredirect/index'),
meta: {
keepAlive: false,
isTab: false,
isAuth: false,
},
},
]
<file_sep>/README.md
# IEP-UI 国脉内网
## 注意
凡是以这个模板开发的项目, 都需要从这个项目的 `master` 分支分发出去, 改动文件规则请看规则
如果安装 `yarn` or `npm i` 缓慢, 请先更换为中国镜像. 这里推荐用自带 `CMD` or `PowerShell` 否则有权限问题
```
npm set registry https://registry.npm.taobao.org
npm set disturl https://npm.taobao.org/dist
npm i -g mirror-config-china --registry=https://registry.npm.taobao.org
```
`Mac OS` 系统等 `Linux` 系统需要加 `sudo` 前缀以提高权限
## 上手开发
> 推荐使用 `git bash`
- 克隆项目代码
- 预装好 `node.js 12+` 安装包
- 如果使用 `vscode` 开发,可使用我们推荐的 `vscode` 配置 你也可以选择自定义配置(命令: `cp vscode.config/ .vscode/ -rf`)
- 安装项目的依赖 `npm i` 或使用 `yarn` (需要预装,命令:`npm i -g yarn`)
- 拷贝 `cp .env .env.local`
- 修改开发环境代理 ip 配置 文件在 `.env.local`
- 确认安装依赖无错,即可运行 `yarn serve` 或 `npm run serve`
- 提交使用 `yarn cz` 尽量使用命令提交, 冲突等等可不用
## 内网部署说明
- 确认 gitlab-ci 有正常运行
- 部署正式站,切换到 master 分支 运行 ./master 进行合并分支,不需要 git pull, 然后 git push -f
- 测试没问题后,切换到 deploy-master 运行 git reset --hard origin/master 以进行部署,git push -f 完成部署
- 测试站与我能同理
## 内网前端任务分配(组件以及负责人变更需这里修改)
| 组件 | 组件路径 | 组件所属父组件 | 负责人 | 负责人 | 负责人 | 负责人 |
| ---------------- | ----------------------- | -------------- | ----------- | ----------- | ------ | ------ |
| Top/NavBar | 顶部导航 | Top | 张超 | 重庆-谭建林 | | |
| Top/ | 顶部元素 | ElHeader | 张超 | | | |
| SideBar/MainItem | 主菜单 | ELAside | 张超 | | | |
| Wel/WelAside | 工作台(4000)/右侧操作栏 | Wel | 张超 | 重庆-谭建林 | | |
| Wel/WelConTent | 工作台(4000)/中间赋能台 | Wel | 张超 | 重庆-谭建林 | | |
| Hrms | 人力(5000) | Views | 张超 | | | |
| Crms | 客户(6000) | Views | 胡争伟 | 张渝松 | | |
| Core | 核心(10000) | Views | 张超 | | | |
| Goms | 组织(7000) | Views | 张超 | | | |
| Mlms | 资源(4000) | Views | 胡争伟 | | | |
| Fams | 财务(8000) | Views | 张超 | | | |
| Gpms | 项目(9000) | Views | 北京-马青杰 | | | |
| App | 游客展示页 | Views | Undefined | | | |
## 内网公用组件说明(公用组件以及路径、功能说明)
| 组件 | 组件路径 | 组件使用页面参考 | 功能说明 |
| ------------- | ------------------------------------ | ------------------------------------------- | ------------------------ |
| Button | @/components/IepCommon/Button | 批量审核弹窗页面 | 通用的按钮 |
| ReviewConfirm | @/components/IepCommon/ReviewConfirm | 组织的成员管理页面 | 批量审核页面 |
| Tabs | @/components/IepCommon/Tabs | 人力资源下的人才库 | tabs |
| IepDialog | @/components/IepDialog | 成员管理的成员编辑弹窗页面 | 通用弹窗 |
| IepEditor | @/components/IepEditor | 详见各个编辑页 | 富文本 |
| IepTable | @/components/IepTable | views\hrms\AdministrativeApproval\index.vue | table |
| IepTableLink | @/components/IepTable/Link | 详见各个表格页 | 用来点击详情 |
| FooterToolbar | @/components/FooterToolbar/ | 详见各个编辑页 | 用来复杂表单提交按钮存放 |
| Container | @/components/Operation/Container | views\hrms\AdministrativeApproval\index.vue | 头部按钮的操作框 |
| Search | @/components/Operation/Search | 组织的成员管理页面 | 头部右侧搜索栏 |
| Wrapper | @/components/Operation/Wrapper | 组织的成员管理页面 | 列表页操作栏 |
| Header | @/components/Page/Header | 组织的成员管理页面 | 头部标题栏 |
## 样式 ZIndex 层次管理
| 顶部 TOP | 550 |
| ---------------------------------------------------------- | ----- |
| Footer | 500 |
| BasicAsideContainer | 102 |
| .el-slider\_\_button-wrapper | 102 |
| D:\code\iep-ui\src\views\wel\index\WelAside\MyTreasure.vue | 98 |
| iep-drawer | 600 |
| iep-dialog | 2000+ |
| .iep-contact-dropdown | 3000+ |
## v-charts 图表组件
详见 https://v-charts.js.org/#/data
## Git 管理必读
https://juejin.im/post/5aa7e8a6f265da239f070d82
## Git 提交必须
https://zhuanlan.zhihu.com/p/51894196
## 产品设计图获取
https://www.yuque.com/zsr/iep
私有画板图
## 菜单规范
| 节点 ID | 菜单名称 | 类型 | 前端组件 | 前端地址 | 图标 | 权限标识 |
| ------- | -------------- | ---- | -------------------------------- | ----------------- | ---- | ------------ |
| 10000 | 核心管理(模块) | 菜单 | Layout(模块) | /core(注意有斜杠) | | |
| 11000 | 权限管理 | 菜单 | Layout(顶级菜单) | upms | | |
| 11100 | 用户管理 | 菜单 | views/admin/user/index(页面菜单) | user | | |
| 11101 | 用户新增 | 按钮 | | | | sys_user_add |
模块以 1000 为单位
模块下页面以 100 为单位,子页面以 10 为单位,权限按钮以 1 为单位
以下只列出模块节点 ID
| 节点 ID | 菜单名称 | 类型 | 前端组件 | 前端地址 | 图标 | 权限标识 |
| ------- | ---------- | ---- | -------- | -------- | ---- | -------- |
| 11000 | 权限管理 | 菜单 | Layout | /upms | | |
| 12000 | 系统管理 | 菜单 | Layout | /admin | | |
| 13000 | 系统监控 | 菜单 | Layout | /daemon | | |
| 14000 | 协同管理 | 菜单 | Layout | /activti | | |
| 5000 | 人力(模块) | 菜单 | Layout | /hrms | | |
| 6000 | 客户(模块) | 菜单 | Layout | /crms | | |
| 7000 | 组织(模块) | 菜单 | Layout | /goms | | |
| 10000 | 核心(模块) | 菜单 | Layout | /crms | | |
## 具体见 Wiki
<file_sep>/src/views/crms/Customer/Page/Contacts/options.js
const columnsMap = [
{ label: '联系人职务', prop: 'contactPosition' },
{ label: '电话', prop: 'telephoneNo' },
]
const initForm = () => {
return {
contactName: '', //联系人姓名
contactPosition: '', //联系人职务
telephoneNo: '', //电话
fax: '', //传真
qq: '', //QQ
wechat: '', //微信
email: '', //邮箱
cellphone: '', //手机
address: '', //地址
clientConcern: '', //客户关注
other: '', //其他
clientContactId: '',
clientIds: [0],
}
}
// const cellPhone = (rules, value, callback) => {
// if (value !== '') {
// var reg = /^1[3456789]\d{9}$/
// if (!reg.test(value)) {
// callback(new Error('请输入有效的手机号码'))
// }
// }
// callback()
// }
// const telPhone = (rules, value, callback) => {
// if (value === '') {
// callback(new Error('电话不可为空'))
// } else {
// if (value !== '') {
// var reg = /(^[0-9]{3,4}-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)/
// if (!reg.test(value)) {
// callback(new Error('请输入有效的电话号码'))
// }
// }
// callback()
// }
// }
// const fax = (rules, value, callback) => {
// if (value !== '') {
// var reg = /^(\d{3,4}-)?\d{7,8}$/
// if (!reg.test(value)) {
// callback(new Error('请输入有效的传真'))
// }
// }
// callback()
// }
const rules = {
contactName: [{
required: true,
message: '请输入联系人姓名',
trigger: 'blur',
},
{
max: 20,
message: '长度不可超过20个字符',
trigger: 'blur',
},
],
contactPosition: [{
required: true,
message: '请输入联系人职务',
trigger: 'blur',
},
{
max: 255,
message: '长度不可超过255个字符',
trigger: 'blur',
},
],
// telephoneNo: [
// {
// required: true,
// validator: telPhone,
// trigger: 'blur',
// },
// ],
telephoneNo: [{
trigger: 'blur',
},
{
max: 50,
message: '长度不可超过50个字符',
trigger: 'blur',
},
],
address: [{
message: '请填写地址',
trigger: 'blur',
},
{
max: 255,
message: '长度不可超过255个字符',
trigger: 'blur',
},
],
clientIds: [{
required: true,
message: '请选择对应客户',
trigger: 'blur',
}],
// cellphone: [{ validator: cellPhone, trigger: 'blur' }],
cellphone: [{
trigger: 'blur',
},
{
max: 50,
message: '长度不可超过50个字符',
trigger: 'blur',
},
],
fax: [{
max: 255,
message: '长度不可超过255个字符',
trigger: 'blur',
}],
qq: [{
min: 5,
max: 11,
message: '长度为5-11位数字',
trigger: 'blur',
}],
wechat: [{
max: 20,
message: '长度不可超过20个字符',
trigger: 'blur',
}],
email: [{
message: '请输入邮箱地址',
trigger: 'blur',
},
{
type: 'email',
message: '请输入正确的邮箱地址',
trigger: ['blur', 'change'],
},
],
clientConcern: [{
max: 255,
message: '长度不可超过255个字符',
trigger: 'blur',
}],
other: [{
max: 255,
message: '长度不可超过255个字符',
trigger: 'blur',
}],
}
export { columnsMap, initForm, rules }
<file_sep>/src/views/thought/mine/util.js
// 根据传入的时间,返回YYYY-MM-DD
export function formatYear (mill){
var y = new Date(mill)
let raws = [
y.getFullYear(),
formatDig(y.getMonth() + 1),
formatDig(y.getDate()),
// y.getDay() || 7,
]
let format = ['-','-','-']
return String.raw({raw:raws}, ...format)
}
// 月份日期前一位补0
export function formatDig (num) {
return num>9?''+num:'0'+num
}
<file_sep>/src/views/ics/library/form/options.js
export const dictsMap = {
}
export const initFormData = () => {
return {
id: '',
replyStr: '',
tags: [],
isUsed: 1,
types: [],
questionList: [{key: '', id: ''}],
}
}
export const rules = {
question: [
{ required: true, message: '必填', trigger: 'blur' },
],
replyStr: [
{ required: true, message: '必填', trigger: 'blur' },
],
tags: [
{ required: true, message: '必填', trigger: 'blur' },
],
types: [
{ required: true, message: '必填', trigger: 'blur' },
],
isUsed: [
{ required: true, message: '必填', trigger: 'blur' },
],
}
<file_sep>/src/api/hrms/event_selection.js
import request from '@/router/axios'
const prefixUrl = '/hrms/iephrsplendormanage'
// @/api/hrms/iephrsplendormanage
export function getGloriousPeoplePage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function postGloriousPeopleCreate (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function deleteGloriousPeople (id) {
return request({
url: `${prefixUrl}/delete/${id}`,
method: 'post',
})
}
export function updateGloriousPeople (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function getGloriousById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
//指标list
export function getTargetlist (query) {
return request({
url: '/hrms/iephrsplendortarget/list',
method: 'get',
params: query,
})
}
//排行榜
export function getRankinglist (query) {
return request({
url: '/hrms/iephrsplendortarget/getRankinglist',
method: 'get',
params: query,
})
}<file_sep>/src/views/thought/admin/subject/option.js
export const tableOption = [
{
label: '话题主题',
prop: 'content',
}, {
label: '话题分类',
prop: 'topicType',
type: 'dict',
}, {
label: '创建时间',
prop: 'createTime',
}, {
label: '创建人',
prop: 'creatorName',
}, {
label: '讨论',
prop: 'hot',
},
]
export const dictsMap = {
topicType: {
'1': '普通话题',
'2': '专项话题',
},
}<file_sep>/src/views/wenjuan/components/govButton/README.md
## 数据基因 通用按钮
### 基础用法
> 基础按钮
``` html
<!-- 新增 -->
<gov-button type="add" @click="handleClick"></gov-button>
<!-- 搜索 -->
<gov-button type="search" @click="handleClick"></gov-button>
<!-- 重置 -->
<gov-button type="reset" @click="handleClick"></gov-button>
<!-- 导入 -->
<gov-button type="import" @click="handleClick"></gov-button>
<!-- 导出 -->
<gov-button type="export" @click="handleClick"></gov-button>
```
> 自定义按钮
``` html
<gov-button
size="small"
:plain="false"
:round="false"
type="primary"
:circle="false"
:loading="false"
:disabled="false"
:icon="el-icon-plus"
text="自定义按钮"
@click="handleClick"
>插槽部分</gov-button>
```
### 属性/方法/回调
> Attributes 属性
|参数|说明|类型|可选值|默认值|
|:--:|--|--|:--:|:--:|
|icon|图标|String|-|-|
|size|尺寸|String|medium / small / mini|small|
|type|类型|String|add/search/reset/import/export/primary/success/warning/danger/info/text|primary|
|plain|是否朴素按钮|Boolean|-|false|
|round|是否圆角按钮|Boolean|-|false|
|circle|是否圆形按钮|Boolean|-|false|
|loading|是否加载中|Boolean|-|false|
|disabled|是否禁用|Boolean|-|false|
> event 回调
|事件名称|说明|回调参数|
|--|--|--|
|click|按钮点击时触发|-|
### 使用外部图标 iconfont
``` html
<gov-button type="info" text="'取消'" :icon="['iconfont', 'icon-cancel']"></gov-button>
```<file_sep>/src/router/atms/index.js
import Layout from '@/page/index'
export default [
{
path: '/atms',
component: Layout,
redirect: '/atms/add',
children: [
{
path: 'add',
name: '添加任务',
component: () => import('@/views/atms/add'),
},
{
path: 'edit/:id',
name: '编辑任务',
component: () => import('@/views/atms/add'),
},
{
path: 'details/:id',
name: '任务详情',
component: () => import('@/views/atms/details'),
},
],
},
]<file_sep>/src/views/cfms/ReleaseMeeting/option.js
const initForm = () => {
return {
id: '', // ID
meetingTitle: '', // 会议标题
meetingScale: '', // 会议规模
meetingType: '',// 会议类型
meetingTimeStart: '',//开始时间
meetingTimeEnd: '',//结束时间
cityAdrss: [], //省市地址
provinceName: '',//省名称
cityName: '',//城市名称
meetingAddress: '', //详细地址
meetingClasses1: [], //会议分类
meetingClasses2: [],//会议子分类
tags: [], // 会议标签
meetingHighlights: '', //会议亮点
content: '', //会议详情
attachs: '', //会议海报
meetingUrl: '',//链接地址
meetingFlag: 6, //会议状态
sendDraft: 2, //发送/草稿
}
}
const rules = {
meetingTitle: [{ required: true, message: '请输入会议标题', trigger: 'blur' }, { max: 35, message: '标题不超过35个字符', trigger: 'blur' }],
meetingType: [{ required: true, message: '请选择会议类型', trigger: 'change' }],
meetingScale: [{ required: true, message: '请输入会议规模', trigger: 'blur' }],
meetingTimeStart: [{ required: true, message: '请选择开始时间', trigger: 'blur' }],
meetingTimeEnd: [{ required: true, message: '请选择结束时间', trigger: 'blur' }],
cityAdrss: [{ required: true, message: '请选择地址', trigger: 'change' }],
meetingClasses1: [{ required: true, message: '请选择会议分类', trigger: 'change' }],
tags: [{ required: true, message: '请添加标签', trigger: 'blur' }],
meetingHighlights: [{ required: true, message: '请输入会议亮点', trigger: 'blur' }],
content: [{ required: true, message: '请输入会议详情', trigger: 'blur' }],
attachs: [{ required: true, message: '请上传海报', trigger: 'change' }],
}
export { initForm, rules }<file_sep>/src/api/admin/sys-social-details.js
import request from '@/router/axios'
const prefixUrl = '/admin/social'
export function fetchList (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function addObj (obj) {
return request({
url: `${prefixUrl}/`,
method: 'post',
data: obj,
})
}
export function getObj (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function delObj (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'delete',
})
}
export function putObj (obj) {
return request({
url: `${prefixUrl}/`,
method: 'put',
data: obj,
})
}
export function bindAccount (obj) {
return request({
url: `${prefixUrl}/bind`,
method: 'get',
params: obj,
})
}
export function getBindUserInfoList () {
return request({
url: `${prefixUrl}/user/info/list`,
method: 'get',
})
}
export function getBindCheck (obj) {
return request({
url: `${prefixUrl}/check`,
method: 'get',
params: obj,
})
}
export function unBindAccount (obj) {
return request({
url: `${prefixUrl}/unbind`,
method: 'get',
params: obj,
})
}
export function newUserLogin (obj) {
return request({
url: `${prefixUrl}/new/user`,
method: 'get',
params: obj,
})
}
export function changeMobile (obj) {
return request({
url: `${prefixUrl}/change`,
method: 'get',
params: obj,
})
}
<file_sep>/src/views/tms/MechanismList/options.js
import { mergeByFirst } from '@/util/util'
const dictsMap = {
isForbidden: {
0: '启用',
1: '禁用',
},
claimStatus: {
0: '未认证',
1: '认证',
},
type: {
1: '政府',
2: '园区',
3: '协会',
4: '企业',
5: '学术机构',
6: '培训机构',
7: '会议场所',
8: '非政府组织',
9: '媒体',
10: '其它',
},
level: {
1: '国家级',
2: '省级',
3: '市级',
4: '区级(县级)',
},
}
const initForm = () => {
return {
current: '',
address: '',
applyTime: '',
applyUserId: 0,
city: '',
claimStatus: '',
createTime: '',
creditCode: '',
delFlag: '',
email: '',
establishedTime: '',
fax: '',
firstSpell: '',
introduction: '',
isForbidden: '',
level: '',
licence: '',
line: '',
link: '',
logo: '',
orgAbrName: '',
orgId: 0,
orgName: '',
orgUrl: '',
phone: '',
province: '',
type: '',
updateTime: '',
}
}
const columnsMap = [
{
prop: 'provinceName',
label: '所属省',
},
{
prop: 'isForbidden',
label: '状态',
type: 'dict',
},
]
const columnsPendingMap = [
{
prop: 'provinceName',
label: '所属省',
},
]
const formToDto = (row) => {
const newForm = mergeByFirst(initForm(), row)
newForm.province = row.current[0]
newForm.city = row.current[1]
return newForm
}
const initSearchForm = () => {
return {
type: '',
province: '',
city: '',
line: '',
claimStatus: '',
isForbidden: '',
applyUserId: '',
currentParmas: '',
}
}
const rules = {
orgName: [{
required: true,
message: '请输入机构名称',
trigger: 'blur',
}],
type: [{
required: true,
message: '请输入机构分类',
trigger: 'blur',
}],
}
export { dictsMap, formToDto, columnsPendingMap, columnsMap, initForm, initSearchForm, rules }<file_sep>/src/api/ics/question.js
import request from '@/router/axios'
const prefixUrl = '/ics/question'
export function getQuestionPage (query) {
return request({
url: `${prefixUrl}/getPage`,
method: 'get',
params: query,
})
}
export function saveOrUpdateOne (data) {
return request({
url: `${prefixUrl}/saveOrUpdateOne`,
method: 'post',
data: data,
})
}
export function getQuestionById (params) {
return request({
url: `${prefixUrl}/getOne`,
method: 'get',
params: params,
})
}
export function deleteQuestion (data) {
return request({
url: `${prefixUrl}/deleteOne`,
method: 'post',
params: data,
})
}
<file_sep>/src/api/mlms/leader_report/index.js
import request from '@/router/axios'
const prefixUrl = '/mlms/leader_report'
export function getTableData (query) {
return request({
url: `${prefixUrl}/personal/report`,
method: 'get',
params: query,
})
}
export function getProjectPage (query) {
return request({
url: `${prefixUrl}/project/page`,
method: 'get',
params: query,
})
}
export function getVisitPage (query) {
return request({
url: `${prefixUrl}/visit/page`,
method: 'get',
params: query,
})
}
export function getProjectReportById (projectWeekReportId) {
return request({
url: `/mlms/projectreport/${projectWeekReportId}`,
method: 'get',
})
}
export function putProjectReport (obj) {
return request({
url: '/mlms/projectreport/report/time',
method: 'post',
data: obj,
})
}
export function getMeeting (id) {
return request({
url: `/mlms//meeting/${id}`,
method: 'get',
})
}
export function getOrgTableData (query) {
return request({
url: `${prefixUrl}/org/report`,
method: 'get',
params: query,
})
}
export function getCount () {
return request({
url: `${prefixUrl}/getCount`,
method: 'get',
})
}
export function getStaffReport (id) {
return request({
url: `/mlms/weekmonthreport/${id}`,
method: 'get',
})
}
export function getOgrReport (id) {
return request({
url: `/mlms/orgreport/${id}`,
method: 'get',
})
}
export function putStaffReport (obj) {
return request({
url: '/mlms/weekmonthreport/report/time',
method: 'post',
data: obj,
})
}
export function putOrgReport (obj) {
return request({
url: '/mlms/orgreport/report/time',
method: 'post',
data: obj,
})
}<file_sep>/src/views/wenjuan/management/const/util.js
import { getDic } from '@/views/wenjuan/util/dic'
export function getDicValue (value,dic) {
let dicArr = getDic(dic)
for(let item of dicArr){
if(item.value == value){
return item.label
}
}
}<file_sep>/src/api/file.js
import request from '@/router/axios'
const prefixUrl = '/admin/file'
export const uploadIdCard = (data, config) => {
return request({
url: `${prefixUrl}/upload/avatar`,
method: 'post',
data: data,
}, config)
}
<file_sep>/src/api/conm/node_controller.js
import request from '@/router/axios'
const prefixUrl = '/cms/info_node'
// @/api/conm/index
//栏目管理控制器
export function getPageById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
//添加栏目
export function addObj (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
//栏目分页
export function getPage (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
//删除
export function deleteNodeById (id) {
return request({
url: `${prefixUrl}/delete/${id}`,
method: 'post',
})
}
export function updateObj (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}<file_sep>/src/views/admin/client/options.js
// org config options
const dictsMap = {
status: {
},
}
const columnsMap = [
{
prop: 'clientId',
label: '编号',
},
{
prop: 'clientSecret',
label: '密钥',
},
{
prop: 'scope',
label: '域',
},
{
prop: 'authorizedGrantTypes',
label: '授权模式',
},
{
prop: 'autoapprove',
label: '自动放行',
},
{
prop: 'accessTokenValidity',
label: '令牌时效',
},
{
prop: 'refreshTokenValidity',
label: '刷新时效',
},
]
const rules = {
clientId: [
{ required: true, message: '请输入', trigger: 'blur' },
],
clientSecret: [
{ required: true, message: '请输入', trigger: 'blur' },
],
scope: [
{ required: true, message: '请输入', trigger: 'blur' },
],
authorizedGrantTypes: [
{ required: true, message: '请输入', trigger: 'blur' },
],
autoapprove: [
{ required: true, message: '请输入', trigger: 'blur' },
],
webServerRedirectUri: [
{ message: '请输入', trigger: 'blur' },
],
authorities: [
{ message: '请输入', trigger: 'blur' },
],
accessTokenValidity: [
{ message: '请输入', trigger: 'blur' },
],
refreshTokenValidity: [
{ message: '请输入', trigger: 'blur' },
],
additionalInformation: [
{ message: '请输入', trigger: 'blur' },
],
resourceIds: [
{ message: '请输入', trigger: 'blur' },
],
}
const initForm = () => {
return {
additionalInformation: '',
authorities: '',
authorizedGrantTypes: '',
autoapprove: '',
clientId: '',
clientSecret: '',
resourceIds: '',
scope: '',
webServerRedirectUri: '',
}
}
export { dictsMap, columnsMap, initForm, rules }<file_sep>/src/api/tms/management.js
import request from '@/router/axios'
const prefixUrl = '/tms'
// @/api/tms/
export function getResultCenterPage (opts) {
return request({
url: `${prefixUrl}/result/center/page`,
method: 'get',
params: opts,
})
}
export function getResultPageByTagId (id) {
return function (opts) {
return request({
url: `${prefixUrl}/result/satellite/page/${id}`,
method: 'get',
params: opts,
})
}
}
export function getResultById (id) {
return request({
url: `${prefixUrl}/tag/${id}`,
method: 'get',
})
}
//联想获取游离标签集
export function getResultList (query) {
return request({
url: `${prefixUrl}/result/list`,
method: 'get',
params: query,
})
}
export function getResultFreePage (opts) {
return request({
url: `${prefixUrl}/result/free/page`,
method: 'get',
params: opts,
})
}
//新增
export function addCenterWord (centerId,obj) {
return request({
url: `${prefixUrl}/result/add/center/${centerId}`,
method: 'post',
data: obj,
})
}
//释放中心词
export function releaseCenterById (id) {
return request({
url: `${prefixUrl}/result/release/${id}`,
method: 'get',
})
}
//释放卫星词
export function releaseSatelliteById (opts) {
return request({
url: `${prefixUrl}/result/release/satellite`,
method: 'get',
params: opts,
})
}
//新增
export function editCenterWord (id,obj) {
return request({
url: `${prefixUrl}/result/add/satellite/${id}`,
method: 'post',
data: obj,
})
}
//更替中心词
export function releaseTransById (opts) {
return request({
url: `${prefixUrl}/result/trans`,
method: 'get',
params: opts,
})
}
//人工管理分页
export function getManageRecordPage (opts) {
return request({
url: `${prefixUrl}/record/page`,
method: 'get',
params: opts,
})
}
//人工管理分页
export function getResultStatistics () {
return request({
url: `${prefixUrl}/result/statistics`,
method: 'get',
})
}
//归类记录分页
export function getClassificationPage (opts) {
return request({
url: `${prefixUrl}/sort/page`,
method: 'get',
params: opts,
})
}
//游离归类
export function getFreeCluster () {
return request({
url: `${prefixUrl}/sort/free_Cluster`,
method: 'get',
})
}
export function getSortPageByTagId (id) {
return function (opts) {
return request({
url: `${prefixUrl}/sort/page/value/${id}`,
method: 'get',
params: opts,
})
}
}
export function getSortById (id) {
return request({
url: `${prefixUrl}/sort/${id}`,
method: 'get',
})
}<file_sep>/src/api/fams/config.js
import request from '@/router/axios'
const prefixUrl = '/fams/config'
// @/api/fams/config
export function getOneConfig () {
return request({
url: `${prefixUrl}/1`,
method: 'get',
})
}<file_sep>/src/views/admin/module/options.js
const dictsMap = {
status: {
1: '正常',
2: '试用',
},
}
const columnsMap = [
{
prop: 'status',
label: '状态',
type: 'dict',
},
{
prop: 'createTime',
label: '创建时间',
},
]
const initForm = () => {
return {
id: '',
name: '',
description: '',
menuId: '',
status: 1,
}
}
export {
dictsMap,
columnsMap,
initForm,
}
<file_sep>/src/api/fams/wealth_flow.js
import request from '@/router/axios'
const prefixUrl = '/fams/wealth_flow'
// @/api/fams/wealth_flow
export function getWealthFlowPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
// 频道页获取奖惩记录
export function getWealthFlowListById (id) {
return request({
url: `${prefixUrl}/list/${id}`,
method: 'get',
})
}
// 频道页获取奖惩记录
export function getWealthFlowPageByUserId (query) {
return request({
url: `${prefixUrl}/hr/page`,
method: 'get',
params: query,
})
}
<file_sep>/src/views/gpms/approve/option.js
import { getStore } from '@/util/store'
const dicData = getStore({ name: 'dictGroup' })
function changeDict (list) {
let data = {}
for (let item of list) {
data[item.value] = item.label
}
return data
}
export const dictsMap = {
projectStatus: {
'1': '待提交',
'2': '待审核',
'3': '已立项',
'4': '审核未通过',
'5': '锁定',
},
projectStage: changeDict(dicData.prms_project_stage),
}
export const columnsMap = [
{
prop: 'projectStatus',
label: '审批状态',
type: 'dict',
},
]
export const initSearchForm = () => {
return {
projectName: '',//项目名称
projectStatus:'',//审批状态
}
}
<file_sep>/src/views/thought/org/thoughtList/library/util.js
const subjectLength = 30 // 话题的长度
const nameLength = 10 // 人名的长度
/**
* 单个话题
* type: 是否存在话题
* first: 话题起始的位置
* second: 话题终止的位置
* data: 话题
*/
export const getSubject = (data) => {
let first = data.indexOf('#')
// 不存在起始符号
if (first === -1) return {
type: false,
}
let second = data.slice(first + 1).indexOf('#')
if (second === -1 // 不存在终止符号
|| second > subjectLength // 字符长度
) {
return {
type: false,
}
} else {
return {
type: true,
first,
second: first + second + 2,
data: data.slice(first + 1, first + second + 1),
}
}
}
/**
* 多个话题
* type: 是否存在人名
* list: 人名出现的起始和终结集合
* first: 起始
* second: 终止
* name: 人名
*/
export const getSubjectList = (val) => {
let arr = [] // 话题数组
let string = val // 当前的字符串
let code = 0 // 当前话题在原始字符串中的位置s
// let reg = /[~!@#$%^&*/|,.,。!¥<>?";:_=[\]{}]/ // 人名中不允许出现符号,即提高人名判断的准确性
let fn = (value) => {
let first = value.indexOf('#') + 1 // 从 # 开始
let second = value.slice(first).indexOf('#') // 到下一个 # 为止
if (first === 0) { // 不存在起始符号 - 结束
string = ''
} else if (second === -1) { // 不存在终止符号 - 结束
string = ''
} else if (second > subjectLength) { // 字符长度超过限定
// 直接跳转到下一个 # 开始的地方
let next = value.slice(first).indexOf('#')
if (next > -1) {
code = code + first + next
string = value.slice(code)
} else { // 若无 - 结束
string = ''
}
} else {
let name = {
first: code + first - 1,
second: code + first + second + 1,
name: string.slice(first, first + second),
}
arr.push(name)
code = code + first + second + 1
string = string.slice(first + second + 1)
}
}
// 判断是否存在多个
let isTransf = (value) => {
fn(value)
if (string.indexOf('#') > -1) {
isTransf(string)
}
}
if (string.indexOf('#') > -1) {
isTransf(string)
if (arr.length > 0) {
return {
type: true,
list: arr,
}
} else {
return {
type: false,
}
}
} else {
return {
type: false,
}
}
}
/**
* type: 是否存在人名
* list: 人名出现的起始和终结集合
* first: 起始
* second: 终止
* name: 人名
*/
export const getName = (val) => {
let arr = [] // 姓名数组
let string = val // 当前的字符串
let code = 0 // 当前姓名在原始字符串中的位置s
let reg = /[~!@#$%^&*/|,.,。!¥<>?";:_=[\]{}]/ // 人名中不允许出现符号,即提高人名判断的准确性
let fn = (value) => {
let first = value.indexOf('@') + 1 // 从@开始
let second = value.slice(first).indexOf(' ') // 到下一个空格为止
if (first === 0) { // 不存在起始符号 - 结束
string = ''
} else if (second === -1) { // 不存在终止符号 - 结束
string = ''
} else if (second > nameLength // 字符长度超过10个
|| reg.test(value.slice(first + 1, first + second)) // 不符合姓名正则
) {
// 直接跳转到下一个@开始的地方
let next = value.slice(first).indexOf('@')
if (next > -1) {
code = code + first + next
string = value.slice(code)
} else { // 若无 - 结束
string = ''
}
} else {
let name = {
first: code + first - 1,
second: code + first + second + 1,
name: string.slice(first, first + second),
}
arr.push(name)
code = code + first + second
string = string.slice(first + second)
}
}
// 判断是否存在多个
let isTransf = (value) => {
fn(value)
if (string.indexOf('@') > -1) {
isTransf(string)
}
}
if (string.indexOf('@') > -1) {
isTransf(string)
if (arr.length > 0) {
return {
type: true,
list: arr,
}
} else {
return {
type: false,
}
}
} else {
return {
type: false,
}
}
}
export const dealImage = (data, index) => {
let list = []
list = data.slice(index).concat(data.slice(0, index))
return list
}
// 话题转换 - 只存在一个
export const transfSubject = (val) => {
let obj = getSubject(val)
if (obj.type) {
return [
{
type: false,
html: val.slice(0, obj.first),
}, {
type: true,
html: `#${obj.data}#`,
}, {
type: false,
html: val.slice(obj.second),
},
]
} else {
return [{
type: false,
html: val,
}]
}
}
// 话题转换 - 可存在多个
export const transfSubjectList = (val) => {
if (getSubjectList(val).type) {
let list = []
let code = 0
for (let item of getSubjectList(val).list) {
list.push({
type: false,
html: val.slice(code, item.first),
})
list.push({
type: true,
html: val.slice(item.first, item.second),
})
code = item.second
}
list.push({
type: false,
html: val.slice(code),
})
return list
} else {
return [
{
type: false,
html: val,
},
]
}
}
// 人名转换 - 可存在多个
export const transfPerson = (val) => {
if (getName(val).type) {
let list = []
let code = 0
for (let item of getName(val).list) {
list.push({
type: false,
html: val.slice(code, item.first),
})
list.push({
type: true,
html: val.slice(item.first, item.second),
})
code = item.second
}
list.push({
type: false,
html: val.slice(code),
})
return list
} else {
return [
{
type: false,
html: val,
},
]
}
}
<file_sep>/src/const/crud/daemon/sys-job.js
export const tableOption = {
border: true,
card: true,
index: true,
indexLabel: '序号',
stripe: true,
menu: true,
menuAlign: 'center',
filterBtn: false,
menuWidth: 300,
align: 'center',
viewBtn: false,
editBtn: false,
delBtn: false,
addBtn: false,
dialogWidth: '85%',
labelWidth: 130,
dialogHeight: '78%',
column: [
{
label: 'jobId',
prop: 'jobId',
hide: true,
addVisdiplay: false,
editVisdiplay: false,
rules:
[{
required: true,
message: '请输入任务类型',
trigger: 'blur',
}],
},
{
label: '任务名称',
prop: 'jobName',
search: true,
placeholder: '任务名称',
rules: [{
required: true,
message: '请输入任务名称',
trigger: 'blur',
}],
editDisabled: true,
},
{
label: '任务组名',
prop: 'jobGroup',
search: true,
rules:
[{
required: true,
message: '请输入任务组名',
trigger: 'blur',
}],
editDisabled: true,
},
{
label: '任务状态',
prop: 'jobStatus',
type: 'select',
dicUrl: '/api/admin/dict/type/job_status',
addVisdiplay: false,
search: true,
slot: true,
},
{
label: '执行状态',
prop: 'jobExecuteStatus',
type: 'select',
dicUrl: '/api/admin/dict/type/job_execute_status',
addVisdiplay: false,
search: true,
slot: true,
},
{
label: '创建者',
prop: 'createBy',
hide: true,
addVisdiplay: false,
editVisdiplay: false,
},
{
label: '创建时间',
prop: 'createTime',
type: 'datetime',
hide: true,
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
width: 120,
addVisdiplay: false,
editVisdiplay: false,
},
{
label: '更新者',
prop: 'updateBy',
hide: true,
addVisdiplay: false,
editVisdiplay: false,
},
{
label: '更新时间',
prop: 'updateTime',
type: 'datetime',
hide: true,
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
width: 160,
addVisdiplay: false,
editVisdiplay: false,
},
{
label: '首次执行时间',
prop: 'startTime',
type: 'datetime',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
width: 160,
addVisdiplay: false,
editDisabled: true,
}, {
label: '上次执行时间',
prop: 'previousTime',
type: 'datetime',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
width: 160,
addVisdiplay: false,
editDisabled: true,
}, {
label: '下次执行时间',
prop: 'nextTime',
type: 'datetime',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
width: 160,
addVisdiplay: false,
editDisabled: true,
},
{
label: '组内顺序',
prop: 'jobOrder',
hide: true,
addDisplay: false,
editDisplay: false,
type: 'silder',
step: 1,
min: 1,
max: 9,
showStops: true,
},
{
label: '类型',
prop: 'jobType',
type: 'select',
dicUrl: '/api/admin/dict/type/job_type',
width: 100,
rules:
[{
required: true,
message: '请输入任务类型',
trigger: 'blur',
}],
},
{
label: '执行路径',
prop: 'executePath',
overHidden: true,
},
{
label: '执行文件',
prop: 'className',
overHidden: true,
},
{
label: '执行方法',
prop: 'methodName',
overHidden: true,
width: 120,
},
{
label: '执行参数值',
prop: 'methodParamsValue',
width: 100,
overHidden: true,
},
{
label: 'cron表达式',
prop: 'cronExpression',
width: 100,
formsolt: true,
rules:
[{
required: true,
max: 200,
message: '请输入cron表达式',
trigger: 'change',
}],
},
{
label: '错失执行策略',
prop: 'misfirePolicy',
type: 'select',
dicUrl: '/api/admin/dict/type/misfire_policy',
width: 120,
rules:
[{
required: true,
message: '请输入任务错失执行策略',
trigger: 'blur',
}],
},
{
label: '租户',
prop: 'tenantId',
hide: true,
addVisdiplay: false,
editVisdiplay: false,
},
{
label: '备注信息',
prop: 'remark',
type: 'textarea',
span: 20,
overHidden: true,
rules:
[{
max: 500,
message: '备注信息不得超过500',
trigger: 'blur',
}],
},
],
}
export const tableLogOption = {
border: true,
index: false,
menu: false,
page: true,
indexLabel: '序号',
stripe: true,
filterBtn: false,
editBtn: false,
delBtn: false,
addBtn: false,
columnBtn: false,
column: [
{
label: 'id',
prop: 'jobLogId',
hide: true,
},
{
label: '任务id',
prop: 'jobId',
hide: true,
},
{
label: '任务名称',
prop: 'jobName',
},
{
label: '任务组名',
prop: 'jobGroup',
},
{
label: '状态',
prop: 'jobLogStatus',
type: 'select',
dicUrl: '/api/admin/dict/type/job_execute_status',
slot: true,
},
{
label: '组内顺序',
prop: 'jobOrder',
hide: true,
},
{
label: '类型',
prop: 'jobType',
type: 'select',
dicUrl: '/api/admin/dict/type/job_type',
width: 100,
},
{
label: '执行路径',
prop: 'executePath',
overHidden: true,
},
{
label: '执行文件',
prop: 'className',
overHidden: true,
},
{
label: '执行方法',
prop: 'methodName',
overHidden: true,
width: 120,
},
{
label: '执行参数值',
prop: 'methodParamsValue',
width: 100,
overHidden: true,
},
{
label: 'cron表达式',
prop: 'cronExpression',
width: 100,
overHidden: true,
},
{
label: '状态描述',
prop: 'jobMessage',
},
{
label: '执行时间(ms)',
prop: 'executeTime',
width: 120,
},
{
label: '异常信息',
prop: 'exceptionInfo',
overHidden: true,
},
{
label: '开始时间',
prop: 'createTime',
type: 'datetime',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
width: 160,
},
],
}
<file_sep>/src/api/fams/invoice.js
import request from '@/router/axios'
const prefixUrl = '/fams/invoice'
// @/api/fams/invoice
export function getMyInvoicePage (query) {
return request({
url: `${prefixUrl}/my/page`,
method: 'get',
params: query,
})
}
// 财务管理
export function getInvoicePage (query) {
return request({
url: `${prefixUrl}/financial_page`,
method: 'get',
params: query,
})
}
// 个人审批发票
export function getMyInvoiceApprovalPage (query) {
return request({
url: `${prefixUrl}/primary_page`,
method: 'get',
params: query,
})
}
export function getInvoiceById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function postInvoice (obj, isPublish = false) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: { isPublish, ...obj },
})
}
export function putInvoiceRelation (obj) {
return request({
url: `${prefixUrl}/financial/update`,
method: 'post',
data: obj,
})
}
export function putInvoice (obj, isPublish = false) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: { isPublish, ...obj },
})
}
export function referInvoiceById (id) {
return request({
url: `${prefixUrl}/refer/${id}`,
method: 'post',
})
}
export function withdrawInvoiceById (id) {
return request({
url: `${prefixUrl}/withdraw/${id}`,
method: 'post',
})
}
export function deleteInvoiceById (id) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: [id],
})
}
export function deleteInvoiceBatch (ids) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}
export function rejectInvoice (obj) {
return request({
url: `${prefixUrl}/financial_refuse`,
method: 'post',
data: obj,
})
}
export function passInvoice (obj) {
return request({
url: `${prefixUrl}/financial_agree`,
method: 'post',
data: obj,
})
}
export function myRejectInvoice (obj) {
return request({
url: `${prefixUrl}/primary_refuse`,
method: 'post',
data: obj,
})
}
export function myPassInvoice (obj) {
return request({
url: `${prefixUrl}/primary_agree`,
method: 'post',
data: obj,
})
}
export function myTransInvoice (obj) {
return request({
url: `${prefixUrl}/primary_transmit`,
method: 'post',
data: obj,
})
}<file_sep>/src/views/fams/Investment/Management/ChangeShareholder/options.js
import { checkContactUser } from '@/util/rules'
const rules = {
holdType: [
{ required: true, message: '请选择持有类型', trigger: 'blur' },
],
user: [
{ required: true, validator: checkContactUser('接收人'), trigger: 'blur' },
],
orgId: [
{ required: true, message: '请选择股东组织', trigger: 'blur' },
],
externalShareholder: [
{ required: true, message: '请填写外部股东', trigger: 'blur' },
],
investmentNumber: [
{ required: true, message: '请填写股份数量', trigger: 'blur', type: 'number', min: 1 },
],
equityType: [
{ required: true, message: '请选择股本类型', trigger: 'blur' },
],
}
const initForm = () => {
return {
id: '',
externalShareholder: '',
user: {
id: '',
name: '',
},
orgId: '',//投资组织
investmentNumber: 1,//股份数量
holdType: '2',//持有类型
equityType: '1',//股本类型
}
}
export {
rules,
initForm,
}<file_sep>/src/views/wel/RelationshipManage/MentorTable/options.js
// import { mergeByFirst } from '@/util/util'
const dictsMap = {
}
const columnsMapMaster = [
{
prop: 'realName',
label: '姓名',
width: '120',
},
{
prop: 'phone',
label: '联系方式',
},
{
prop: 'orgName',
label: '所属组织',
},
{
prop: 'staffNo',
label: '用户工号',
},
{
prop: 'confirmationTime',
label: '拜师时间',
},
]
const columnsMapApprentice = [
{
prop: 'realName',
label: '姓名',
width: '120',
},
{
prop: 'phone',
label: '联系方式',
},
{
prop: 'orgName',
label: '所属组织',
},
{
prop: 'staffNo',
label: '用户工号',
},
{
prop: 'confirmationTime',
label: '收徒时间',
},
]
const columnsMapAttention = [
{
prop: 'name',
label: '姓名',
width: '120',
},
{
prop: 'phone',
label: '联系方式',
},
{
prop: 'orgName',
label: '所属组织',
},
{
prop: 'staffNo',
label: '用户工号',
},
]
const initForm = () => {
return {
name:'',
}
}
const formToDto = (row) => {
const newForm = {...row}
return newForm
}
const initSearchForm = () => {
return {
name: '',
}
}
export { dictsMap, columnsMapMaster,columnsMapApprentice,columnsMapAttention, initForm, initSearchForm, formToDto }
<file_sep>/src/api/cpms/characterrelations.js
import request from '@/router/axios'
export const prefixUrl = '/cpms/iepcommoncharacterrelations'
export function addMasterWorker (obj) {
return request({
url: `${prefixUrl}/addMasterWorker`,
method: 'post',
data: obj,
})
}
export function getPageRecommend (params) {
return request({
url: `${prefixUrl}/pageRecommend`,
method: 'get',
params: params,
})
}
// 根据拜师消息id查询土地info
export function getApprenticeUser (characterId) {
return request({
url: `${prefixUrl}/user/${characterId}`,
method: 'get',
})
}
// 是否确认收徒
export function characterIsDetermine (type, data) {
return request({
url: `${prefixUrl}/isDetermine`,
method: 'post',
params: type,
data: data,
})
}
<file_sep>/src/store/modules/menu.js
import { getStore, setStore } from '@/util/store'
import { getMenu } from '@/api/admin/menu'
import website from '@/const/website'
import { isURL } from '@/util/validate'
import keyBy from 'lodash/keyBy'
import { deepClone } from '@/util/util'
import Router from '@/router/router'
import { resetRouter } from '@/router/router'
function addPath (ele, first) {
const propsConfig = website.menu.props
const propsDefault = {
name: propsConfig.name || 'name',
label: propsConfig.label || 'label',
path: propsConfig.path || 'path',
icon: propsConfig.icon || 'icon',
children: propsConfig.children || 'children',
}
const isChild = ele[propsDefault.children] && ele[propsDefault.children].length !== 0
if (!isChild && first) {
ele[propsDefault.path] = ele[propsDefault.path] + '/index'
return
}
ele[propsDefault.children].forEach(child => {
child[propsDefault.name] = `${child[propsDefault.name]}-${ele[propsDefault.name]}`
if (!isURL(child[propsDefault.path])) {
child[propsDefault.path] = `${ele[propsDefault.path]}/${child[propsDefault.path] ? child[propsDefault.path] : 'index'}`
}
addPath(child)
})
}
function detachMenu (menu) {
const menuPathList = menu.map(m => m.path)
let mainMenu = {}
const otherMenus = []
for (const iterator of menu) {
if (iterator.path === website.menu.firstMenu.modulePath) {
mainMenu = deepClone(iterator)
} else {
otherMenus.push(iterator)
}
}
const menusMap = keyBy(menu, 'path')
return { mainMenu, otherMenus, menusMap, menuPathList }
}
const menu = {
state: {
menu: getStore({ name: 'menu' }) || [],
mainMenu: getStore({ name: 'main_menu' }) || {},
otherMenus: getStore({ name: 'other_menus' }) || [],
menusMap: getStore({ name: 'menus_map' }) || {},
menuPathList: getStore({ name: 'menu_path_list' }) || [],
},
actions: {
// 获取系统菜单
async GetMenu ({ commit, state, dispatch }) {
await dispatch('ClearMenu')
const { data } = await getMenu()
const menu = deepClone(data.data)
menu.forEach(ele => {
addPath(ele)
})
commit('SET_MENU', menu)
if (state.menuPathList.length === 0) {
const { mainMenu, otherMenus, menusMap, menuPathList } = detachMenu(menu)
commit('SET_MAINMENU', mainMenu)
commit('SET_OTHERMENUS', otherMenus)
commit('SET_MENUSMAP', menusMap)
commit('SET_MENUPATHLIST', menuPathList)
}
Router.$avueRouter.formatRoutes(menu, true)
return menu
},
ClearMenu ({ commit }) {
commit('SET_MENU', [])
commit('SET_MAINMENU', {})
commit('SET_OTHERMENUS', [])
commit('SET_MENUSMAP', {})
commit('SET_MENUPATHLIST', [])
resetRouter()
},
},
mutations: {
SET_MENU: (state, menu) => {
state.menu = menu
setStore({
name: 'menu',
content: menu,
type: 'session',
})
},
SET_MENUSMAP: (state, menusMap) => {
state.menusMap = menusMap
setStore({
name: 'menus_map',
content: menusMap,
type: 'session',
})
},
SET_OTHERMENUS: (state, otherMenus) => {
state.otherMenus = otherMenus
setStore({
name: 'other_menus',
content: otherMenus,
type: 'session',
})
},
SET_MAINMENU: (state, mainMenu) => {
state.mainMenu = mainMenu
setStore({
name: 'main_menu',
content: mainMenu,
type: 'session',
})
},
SET_MENUPATHLIST: (state, menuPathList) => {
state.menuPathList = menuPathList
setStore({
name: 'menu_path_list',
content: menuPathList,
type: 'session',
})
},
},
}
export default menu
<file_sep>/src/views/ics/library/table/options.js
export const columnsMap = [
{
prop: 'question',
label: '标准问题',
}, {
prop: 'type',
label: '分类',
type: 'dict',
}, {
prop: 'modifiedTime',
label: '最后编辑时间',
}, {
prop: 'goodReview',
label: '反馈满意度',
}, {
prop: 'isUsed',
label: '状态',
type: 'dict',
},
]
export const dictsMap = {
isUsed: {
1: '启用',
0: '禁用',
},
}
export function initSearchForm () {
return {
question: '',
}
}<file_sep>/src/views/fams/FinancialManagement/FeeManagement/options.js
import { feeStatus } from '@/const/invoiceConfig.js'
const dictsMap = {
status: feeStatus,
}
const columnsMap = [
{
prop: 'costId',
label: 'ID',
},
{
prop: 'creatorName',
label: '申请人',
},
{
prop: 'totalAmount',
label: '报销金额',
},
{
prop: 'createTime',
label: '申请日期',
width: '150',
},
{
prop: 'status',
label: '状态',
type: 'dict',
},
{
prop: 'auditorName',
label: '部门核准人',
},
]
export { dictsMap, columnsMap }<file_sep>/src/views/fams/GroupFinance/FundTransfer/options.js
// import { mergeByFirst } from '@/util/util'
import { initNow } from '@/util/date'
import { checkContactUser } from '@/util/rules'
import moment from 'moment'
const dictsMap = {
status: {
0: '调拨中',
1: '调出方确认',
2: '调入方确认',
3: '已还款',
4: '发起方取消',
},
allocationWay: {
0: '国脉贝',
1: '线下支付',
},
}
const columnsMap = [
{
prop: 'inOrgName',
label: '调入组织',
},
{
prop: 'outOrgName',
label: '调出组织',
},
{
prop: 'amount',
label: '调拨金额',
width:'100',
},
{
prop: 'allocationWay',
label: '资金调拨方式',
type: 'dict',
},
{
prop: 'status',
label: '状态',
type: 'dict',
},
{
prop: 'creator',
label: '资金调拨发起人',
},
{
prop: 'createTime',
label: '创建时间',
},
]
const calculateTime = (time, value) => {
return moment(time).add(value, 'day').format('YYYY-MM-DD')
}
const initForm = () => {
return {
id: 0, //id
borrowId: 0,
amount: 0,//调拨金额
allocationWay: 0,//资金调拨方式(0国脉贝,1现金)
orgInterest: 0,//组织日利息
groupInterest: 0,//集团日利息
allocationDays: 0,//调拨天数
implementRangeTime: [initNow(), initNow()],//执行日期
implementStartTime: '',//执行开始日期
implementEndTime: '',//执行结束日期
callOutOrgId: '',//调出组织ID
callOutCompanyId: '',//调出线下公司ID
callOutCompanyBankId: '',//调出线下公司银行账户ID
callOutUser: { id: '', name: '' },//调出方财务用户
callOutUserId: '',//调出方财务用户ID
callInOrgId: '',//调入组织ID
callInCompanyId: '',//调入线下公司ID
callInCompanyBankId: '',//调入线下公司银行账户ID
callInUser: { id: '', name: '' },//调入方财务用户
callInUserId: '',//调入方财务用户ID
}
}
const initDetailForm = () => {
return {
id: '',
amount: '',//调拨金额
allocationWay: '',//资金调拨方式(0国脉贝,1现金)
groupInterest: '',//利息
orgInterest: '',//利息
allocationDays: '',//调拨天数
implementStartTime: '',//执行开始日期
implementEndTime: '',//执行结束日期
creator: '',//资金调拨发起人
outOrgName: '',//调出组织
callOutCompany: '',//调出线下公司
callOutCompanyBank: '',//调出线下公司银行账户
callOutUser: '',//调出方财务用户
inOrgName: '',//调入组织
callInCompany: '',//调入线下公司
callInCompanyBank: '',//调入线下公司银行账户
callInUser: '',//调入方财务用户
status: '',//状态(0调拨中,1调出方确认,2调入方确认,3已还款,4发起方取消)
createTime: '',//创建时间
updateTime: '',//更新时间
flag: '',//状态(1显示,2不显示)
}
}
const formToDto = (row) => {
const newForm = { ...row }
newForm.implementStartTime = newForm.implementRangeTime[0]
newForm.implementEndTime = newForm.implementRangeTime[1]
newForm.callOutUserId = newForm.callOutUser.id
newForm.callInUserId = newForm.callInUser.id
return newForm
}
const borrowToForm = (row, id) => {
const newForm = initForm()
newForm.borrowId = id
newForm.allocationDays = row.borrowDays
newForm.amount = row.amount
newForm.callInOrgId = row.inOrgId
newForm.callInCompanyId = row.borrowInCompanyId
newForm.callInCompanyBankId = row.borrowInCompanyBankId
newForm.allocationWay = row.borrowMoneyType
return newForm
}
const rules = {
amount: [
{ required: true, message: '调拨金额为数字且大于0', trigger: 'blur', type: 'number', min: 1 },
],
allocationWay: [
{ required: true, message: '请输入调拨方式', trigger: 'blur' },
],
orgInterest: [
{ required: true, message: '组织日利息(%)为数字且大于等于0', trigger: 'blur', type: 'number', min: 0 },
],
groupInterest: [
{ required: true, message: '集团日利息(%)为数字且大于等于0', trigger: 'blur', type: 'number', min: 0 },
],
allocationDays: [
{ required: true, message: '调拨天数(日)为数字且大于等于0', trigger: 'blur', type: 'number', min: 0 },
],
implementRangeTime: [
{ required: true, message: '请输入执行日期', trigger: 'blur' },
],
estimatedTime: [
{ required: true, message: '请输入预计时间', trigger: 'blur' },
],
callOutOrgId: [
{ required: true, message: '请输入调出组织', trigger: 'blur' },
],
callOutUser: [
{ required: true, message: '请输入调出方财务', validator: checkContactUser('调出方财务'), trigger: 'blur', type: 'object' },
],
callInOrgId: [
{ required: true, message: '请输入调入组织', trigger: 'blur' },
],
callInUser: [
{ required: true, message: '请输入调入方财务', validator: checkContactUser('调入方财务'), trigger: 'blur', type: 'object' },
],
}
export { dictsMap, columnsMap, initForm, initDetailForm, formToDto, borrowToForm, calculateTime, rules }<file_sep>/src/api/fams/org_borrow.js
import request from '@/router/axios'
const prefixUrl = '/fams/borrow'
// @/api/fams/org_borrow
export function getOrgBorrowPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: {
...query,
},
})
}
export function getUnionBorrowPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: {
...query,
borrowObjectType: 2,
},
})
}
export function getOrgBorrowById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function postOrgBorrow (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function cancelOrgBorrow (id) {
return request({
url: `${prefixUrl}/cancel/${id}`,
method: 'get',
})
}
export function outOrgConfirmBorrow (id) {
return request({
url: `${prefixUrl}/out/org/confirm/${id}`,
method: 'get',
})
}
export function groupConfirmBorrow (id) {
return request({
url: `${prefixUrl}/group/confirm/${id}`,
method: 'get',
})
}
export function groupRejectBorrow (id) {
return request({
url: `${prefixUrl}/group/reject/${id}`,
method: 'get',
})
}
export function orgRejectBorrow (id) {
return request({
url: `${prefixUrl}/org/reject/${id}`,
method: 'get',
})
}
export function inOrgConfirmBorrow (id) {
return request({
url: `${prefixUrl}/in/org/confirm/${id}`,
method: 'get',
})
}
export function repayOrgBorrow (obj) {
return request({
url: `${prefixUrl}/repayment`,
method: 'post',
data: obj,
})
}
export function confirmRepayOrgBorrow (id) {
return request({
url: `${prefixUrl}/repayment/confirm/${id}`,
method: 'get',
})
}
export function outOrgReconfirmBorrow (obj) {
return request({
url: `${prefixUrl}/out/org/reconfirm`,
method: 'post',
data: obj,
})
}
<file_sep>/src/api/mlms/index.js
// 资源模块通用接口
import request from '@/router/axios'
// 评论
export function commentMaterial (obj) {
return request({
url: '/mlms/comment/create/review',
method: 'post',
data: obj,
})
}
export function getCommentPage (obj) {
return request({
url: '/mlms/comment/page',
method: 'get',
params: obj,
})
}
<file_sep>/src/views/mlms/material/report/organize/option.js
export const summaryTable = [
{
prop: 'title',
label: '标题',
},
{
prop: 'meetingTime',
label: '会议时间',
},
{
prop: 'meetingType',
label: '会议类型',
},
]
export const productTable = [
{
prop: 'name',
label: '产品名称',
},
{
prop: 'onlineTime',
label: '上线时间',
},
]
export const projectTable = [
{
prop: 'projectName',
label: '项目名称',
},
{
prop: 'publisherName',
label: '项目经理',
},
{
prop: 'publishTime',
label: '发布时间',
},
]
<file_sep>/src/api/mlms/material/datum/aptitude.js
import request from '@/router/axios'
const prefixUrl = '/mlms/honorqual'
export function getTableData (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
export function getTableDataOnlyMe (obj) {
return request({
url: `${prefixUrl}/page/personal`,
method: 'get',
params: obj,
})
}
export function createData (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function updateData (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function deleteData (id) {
let ids = typeof id === 'object' ? id : [id]
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}
export function getDataById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
// 统计荣誉资质的下载
export function downloadCount (id) {
return request({
url: `${prefixUrl}/i_can/download/${id}`,
method: 'get',
})
}
<file_sep>/src/views/wenjuan/components/govDialogImport/README.md
## 数据基因 导入
> 基础
``` html
<gov-dialog-import
@downLoadDemo="handleDownLoadDemo"
:action="action"
ref="importDialog"
@importSuccess="informationSuccess">
</gov-dialog-import>
```
### 属性/方法/回调
|参数|说明|类型|可选值|默认值|
|:--:|--|--|:--:|:--:|
|handleDownLoadDemo|下载模板|Function|||
|action|模板上传接口|String|||
|informationSuccess|上传成功后操作|Function|||
|openDialog|关闭弹窗前操作|Function|||
|closeDialog|关闭弹窗前操作|Function|||
|submit|保存按钮操作|Function|||
### 下载方法
**所有流文件都可以通过这个方法下载**
```javascript
import {downloadExport} from '@/util/util'
// 模板下载
handleDownLoadDemo () {
// getExportDemo接口
getExportDemo().then(response => {
downloadExport({response})
},
```<file_sep>/src/api/admin/module.js
import request from '@/router/axios'
const prefixUrl = '/admin/module'
// @/api/admin/module
// 模块列表
export function getModulePage (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
export function getUnionModulePage (params) {
return request({
url: `${prefixUrl}/union/module/page`,
method: 'get',
params: params,
})
}
export function getOrgModuleList () {
return request({
url: `${prefixUrl}/org/list`,
method: 'get',
})
}
export function getUnionModuleList () {
return request({
url: `${prefixUrl}/union/list`,
method: 'get',
})
}
export function postModule (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function putModule (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function putUnionModule (obj) {
return request({
url: `${prefixUrl}/set/charge`,
method: 'post',
data: obj,
})
}
export function deleteModuleById (id) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: [id],
})
}
<file_sep>/src/router/meeting/index.js
/**
* 会议开放路由
* @type { *[] }
*/
export default [
{
path: '/meeting/:id',
name: '报名页',
component: () => import('@/page/MeetingDetail/index'),
meta: {
keepAlive: false,
isTab: false,
isAuth: false,
},
},
{
path: '/meeting',
name: '报名页预览',
component: () => import('@/page/MeetingDetail/index'),
meta: {
keepAlive: false,
isTab: false,
isAuth: false,
},
},
]
<file_sep>/src/api/crms/agreement.js
import request from '@/router/axios'
const prefixUrl = '/mlms/contract'
const crmUrl = '/crm/contract'
//合同列表
export function getAgreementPage (params) {
return request({
url: `${prefixUrl}/MyClient/page`,
method: 'get',
params: params,
})
}
// 新增
export function postAgreement (obj) {
return request({
url: `${crmUrl}/create`,
method: 'post',
data: obj,
})
}
// 修改
export function putAgreement (obj) {
return request({
url: `${crmUrl}/update`,
method: 'post',
data: obj,
})
}
//通过id查询
export function agreementById (id) {
return request({
url: `${crmUrl}/${id}`,
method: 'get',
})
}
// 删除
export function deleteAgreementById (id) {
return request({
url: `${crmUrl}/delete/batch`,
method: 'post',
data: [id],
})
}
//合同批量删除
export function deleteAgreement (id) {
return request({
url: `${crmUrl}/delete/batch`,
method: 'post',
data: id,
})
}
<file_sep>/src/api/hrms/user_record.js
import request from '@/router/axios'
const prefixUrl = '/hrms/user_record'
// @/api/hrms/user_record
export function getUserRecordOvertimeListById (id) {
return request({
url: `${prefixUrl}/overtime/list/${id}`,
method: 'get',
})
}
export function getPersonnelChangePageByUserId (query) {
return request({
url: `${prefixUrl}/user/page`,
method: 'get',
params: query,
})
}<file_sep>/src/api/common.js
import { Message } from 'element-ui'
import request from '@/router/axios'
// @/api/common
export function getCommonList (url, name) {
return request({
url: `/${url}/list`,
method: 'get',
params: {
name,
},
})
}
export function getCommonPage (url, params) {
return request({
url: `/${url}`,
method: 'get',
params,
})
}
export function downloadUrl (url) {
request({
url: '/admin/file/' + url,
method: 'get',
responseType: 'arraybuffer',
}).then(response => {
// 处理返回的文件流
const blob = new Blob([response.data])
const link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = url
document.body.appendChild(link)
link.style.display = 'none'
link.click()
})
}
const downLoadMessage = [
'文件较大,正在下载中,请耐心等候',
'文件过大,需要较长下载时间,请耐心等候',
]
export function downloadFile (file) {
let downLoadCode1 = window.setTimeout(() => {
Message(downLoadMessage[0])
}, 1000*10)
let downLoadCode2 = window.setInterval(() => {
Message(downLoadMessage[1])
}, 1000*60)
request({
url: '/admin/file/' + file.url,
method: 'get',
responseType: 'arraybuffer',
timeout: '3600000',
}).then(response => {
// 处理返回的文件流
const blob = new Blob([response.data])
const link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = file.name
document.body.appendChild(link)
link.style.display = 'none'
link.click()
// 关闭定时信息
window.clearTimeout(downLoadCode1)
window.clearInterval(downLoadCode2)
})
}
<file_sep>/src/api/govdata/information.js
/**
* 新增政策库政策资讯API请求接口
*/
import request from '@/router/axios'
const prefixUrl = '/gc/policy/information'
/**
* 获取政策列表
* @param {Object} params 参数
*/
export function getInformationPage (params) {
return request({
// url: '/gov/policy/information/pageConsole',
url: `${prefixUrl}/pageConsole`,
method: 'get',
params: params,
headers: {
isNoNeed: true,
},
})
}
// 政策中心里的政策资讯分页
export function getInformationCenterPage (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
headers: {
isNoNeed: true,
},
})
}
/**
* 政策中心里根据id查询政策资讯
*/
export function getInformationCenterById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
headers: {
isNoNeed: true,
},
})
}
// 删除政策
export function deleteInformationById (id) {
return request({
// url: '/gov/policy/information/delete',
url: `${prefixUrl}/delete`,
method: 'delete',
data: id,
headers: {
isNoNeed: true,
},
})
}
// 验证通用政策
export function validInformationTitle (params) {
return request({
// url: '/gov/policy/information/repeat',
url: `${prefixUrl}/repeat`,
method: 'get',
params: params,
headers: {
isNoNeed: true,
},
})
}
/**
* 新增并提交政策
* @param {Object} obj 表单参数
*/
export function postInformationAndCommit (params) {
return request({
// url: '/gov/policy/information/createAndCommit',
url: `${prefixUrl}/createAndCommit`,
method: 'post',
data: params,
headers: {
isNoNeed: true,
},
})
}
/**
* 修改并提交政策
* @param {Object} obj 表单参数
*/
export function putInformationAndCommit (params) {
return request({
// url: '/gov/policy/information/updateAndCommit',
url: `${prefixUrl}/updateAndCommit`,
method: 'post',
data: params,
headers: {
isNoNeed: true,
},
})
}
// 暂存(添加)
export function postInformation (params) {
return request({
// url: '/gov/policy/information/create',
url: `${prefixUrl}/create`,
method: 'post',
data: params,
headers: {
isNoNeed: true,
},
})
}
// 暂存(修改)
export function putInformation (params) {
return request({
// url: '/gov/policy/information/update',
url: `${prefixUrl}/update`,
method: 'post',
data: params,
headers: {
isNoNeed: true,
},
})
}<file_sep>/src/views/wenjuan/util/util.js
import {
validatenull,
} from './validate'
import {
baseUrl,
} from '@/config/env'
import website from '@/config/website'
import CryptoJS from 'crypto-js'
export const transformGetRequest = data => {
let newData = {}
for (let k in data) {
if (data.hasOwnProperty(k) === true) {
if (data[k] != null) {
newData[k] = encodeURIComponent(data[k])
}
}
}
return newData
}
//表单序列化
export const serialize = data => {
let list = []
Object.keys(data).forEach(ele => {
list.push(`${ele}=${data[ele]}`)
})
return list.join('&')
}
/**
* 设置主题
*/
export const setTheme = (name) => {
document.body.className = name
}
export const initMenu = (router, menu) => {
if (menu.length === 0) {
return
}
router.addRoutes(formatRoutes(menu))
}
export const formatRoutes = (aMenu) => {
const aRouter = []
aMenu.forEach(oMenu => {
const {
path,
component,
name,
icon,
children,
label,
redirectUrl,
} = oMenu
if (!validatenull(component)) {
const oRouter = {
path: path,
component (resolve) {
let componentPath = ''
if (component === 'Layout') {
require(['../page/index'], resolve)
return
} else if (component === 'middle') {
require(['../page/index/middle.vue'], resolve)
return
} else {
componentPath = component
}
require([`../${componentPath}.vue`], resolve)
},
meta: { title: label ? label : '' },
name: name,
icon: icon,
redirect: redirectUrl ? redirectUrl : undefined,
children: validatenull(children) ? [] : formatRoutes(children),
}
aRouter.push(oRouter)
}
})
return aRouter
}
/**
* 加密处理
*/
export const encryption = (params) => {
const {
data,
type,
param,
} = params
let { key } = params
const result = JSON.parse(JSON.stringify(data))
if (type === 'Base64') {
param.forEach(ele => {
result[ele] = btoa(result[ele])
})
} else {
param.forEach(ele => {
const data = result[ele]
key = CryptoJS.enc.Latin1.parse(key) // eslint-disable-line
const iv = key
// 加密
const encrypted = CryptoJS.AES.encrypt( // eslint-disable-line
data,
key,
{
iv: iv,
mode: CryptoJS.mode.CBC, // eslint-disable-line
padding: CryptoJS.pad.ZeroPadding // eslint-disable-line
})
result[ele] = encrypted.toString()
})
}
return result
}
/**
* 设置浏览器头部标题
*/
export const setTitle = function (title) {
// title = title ? `${title}-${website.info.title}` : website.info.title
title = title ? `${website.info.title}` : website.info.title
window.document.title = title
}
/**
* 浏览器判断是否全屏
*/
export const fullscreenToggel = () => {
if (fullscreenEnable()) {
exitFullScreen()
} else {
reqFullScreen()
}
}
/**
* esc监听全屏
*/
export const listenfullscreen = (callback) => {
function listen () {
callback()
}
document.addEventListener('fullscreenchange', function () {
listen()
})
document.addEventListener('mozfullscreenchange', function () {
listen()
})
document.addEventListener('webkitfullscreenchange', function () {
listen()
})
document.addEventListener('msfullscreenchange', function () {
listen()
})
}
/**
* 浏览器判断是否全屏
*/
export const fullscreenEnable = () => {
var isFullscreen = document.fullscreenEnabled ||
window.fullScreen ||
document.mozFullscreenEnabled ||
document.webkitIsFullScreen
return isFullscreen
}
/**
* 浏览器全屏
*/
export const reqFullScreen = () => {
if (document.documentElement.requestFullScreen) {
document.documentElement.requestFullScreen()
} else if (document.documentElement.webkitRequestFullScreen) {
document.documentElement.webkitRequestFullScreen()
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen()
}
}
/**
* 浏览器退出全屏
*/
export const exitFullScreen = () => {
if (document.documentElement.requestFullScreen) {
document.exitFullScreen()
} else if (document.documentElement.webkitRequestFullScreen) {
document.webkitCancelFullScreen()
} else if (document.documentElement.mozRequestFullScreen) {
document.mozCancelFullScreen()
}
}
/**
* 递归寻找子类的父类
*/
export const findParent = (menu, id) => {
for (let i = 0; i < menu.length; i++) {
if (menu[i].children.length !== 0) {
for (let j = 0; j < menu[i].children.length; j++) {
if (menu[i].children[j].id === id) {
return menu[i]
} else {
if (menu[i].children[j].children.length !== 0) {
return findParent(menu[i].children[j].children, id)
}
}
}
}
}
}
/**
* 总体路由处理器
*/
export const resolveUrlPath = (url, name) => {
let reqUrl = url
if (url.indexOf('#') !== -1 && url.indexOf('http') === -1) {
const port = reqUrl.substr(reqUrl.indexOf(':'))
reqUrl = `/myiframe/urlPath?src=${baseUrl}${port}${reqUrl.replace('#', '').replace(port, '')}}&name=${name}`
} else if (url.indexOf('http') !== -1) {
reqUrl = `/myiframe/urlPath?src=${reqUrl}&name=${name}`
} else {
reqUrl = `${reqUrl}`
}
return reqUrl
}
/**
* 总体路由设置器
*/
export const setUrlPath = ($route) => {
let value = ''
if ($route.query.src) {
value = $route.query.src
} else {
value = $route.path
}
return value
}
/**
* 动态插入css
*/
export const loadStyle = url => {
const link = document.createElement('link')
link.type = 'text/css'
link.rel = 'stylesheet'
link.href = url
const head = document.getElementsByTagName('head')[0]
head.appendChild(link)
}
/**
* 根据字典的value显示label
*/
export const findByvalue = (dic, value) => {
let result = ''
if (validatenull(dic)) return value
if (typeof (value) === 'string' || typeof (value) === 'number') {
let index = 0
index = findArray(dic, value)
if (index !== -1) {
result = dic[index].label
} else {
result = value
}
} else if (value instanceof Array) {
result = []
let index = 0
value.forEach(ele => {
index = findArray(dic, ele)
if (index !== -1) {
result.push(dic[index].label)
} else {
result.push(value)
}
})
result = result.toString()
}
return result
}
/**
* 根据字典的value查找对应的index
*/
export const findArray = (dic, value) => {
for (let i = 0; i < dic.length; i++) {
if (dic[i].value === value) {
return i
}
}
return -1
}
/**
* 数组分页功能函数
*/
export function pagination (currentPage, pageSize, array) {
const offset = (currentPage - 1) * pageSize
return offset + pageSize >= array.length
? array.slice(offset, array.length)
: array.slice(offset, offset + pageSize)
}
/**
* 打开小窗口
*/
export const openWindow = (url, title, w, h) => {
// Fixes dual-screen position Most browsers Firefox
const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : screen.left
const dualScreenTop = window.screenTop !== undefined ? window.screenTop : screen.top
const width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width
const height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height
const left = ((width / 2) - (w / 2)) + dualScreenLeft
const top = ((height / 2) - (h / 2)) + dualScreenTop
const newWindow = window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left)
// Puts focus on the newWindow
if (window.focus) {
newWindow.focus()
}
}
// excel下载文件解析
function contentDispositionAnalysis (contentDisposition) {
let file = {}
let list = contentDisposition.split('; ')
list.forEach(item => {
let n = item.split('=')
n[1] ? file[n[0]] = n[1] : file[n[0]] = n[0]
})
file.suffix = file.filename.split('.')[1]
return file
}
export function downloadExport ({ title = '', response }) {
let contentInfo = contentDispositionAnalysis(response.headers['content-disposition'].replace(/"/g, ''))
return new Promise((resolve) => {
let headers = response.headers
let blob = new Blob([response.data], {
type: headers['content-type'],
})
let link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
if (!title) {
link.download = contentInfo.filename
} else {
link.download = `${title}.${contentInfo.suffix}`
}
if (window.navigator.msSaveOrOpenBlob) {
navigator.msSaveBlob(blob, `${title}.${contentInfo.suffix}`)
resolve()
return
}
if (document.all) {
link.click()
} else {
let e = document.createEvent('MouseEvents')
e.initEvent('click', true, true)
link.dispatchEvent(e)
}
// link.click()
resolve()
})
}
<file_sep>/src/const/pageConfig.js
export function pageOption () {
return {
current: 1,
size: 10,
}
}<file_sep>/src/config/env.js
// 配置编译环境和线上环境之间的切换
const env = process.env
const baseUrl = ''
const codeUrl = '/api/code'
const actUrl = `${window.location.origin}/act/modeler.html?modelId=`
const wsUrl = '/api/ims/ws'
export { baseUrl, actUrl, codeUrl, env, wsUrl }
<file_sep>/src/api/wel/index.js
import request from '@/router/axios'
const prefixUrl = '/admin/wel'
// @/api/wel/index
export function getAside () {
return request({
url: `${prefixUrl}/aside`,
method: 'get',
})
}
export function getIndex () {
return request({
url: `${prefixUrl}/index`,
method: 'get',
})
}
export function getMaterials () {
return request({
url: '/mlms/material/wel/list',
method: 'get',
})
}
export function getPending (type) {
return request({
url: `${prefixUrl}/pending/list`,
method: 'get',
params: {
type,
},
})
}
export function getContractList (query) {
return request({
url: '/crm/cms/wel/contract/list',
method: 'get',
params: query,
})
}
export function getCustomerList (query) {
return request({
url: '/crm/cms/wel/customer/list',
method: 'get',
params: query,
})
}
export function getProjectList () {
return request({
url: '/fams/iepProjectInformation/getMyProject/list',
method: 'get',
})
}
export function getNotice () {
return request({
url: `${prefixUrl}/pending/list`,
method: 'get',
params: {
type: 'announcement',
},
})
}
export function getInstruction () {
return request({
url: `${prefixUrl}/pending/list`,
method: 'get',
params: {
type: 'instruction',
},
})
}
<file_sep>/src/api/evaluate/singleIndicator.js
import request from '@/router/axios'
import exportDownload from '@/util/export'
const queryUrl = '/evaluate'
export function getEvaluateindex (query) {
return request({
url: `${queryUrl}/evaluateindex/page`, //列表
method: 'get',
params: query,
})
}
export function getEvaluateindexById (id) {
return request({
url: `${queryUrl}/evaluateindex/selectById?id=${id}`, //详情
method: 'get',
})
}
// 删除
export function deleteData (id) {
return request({
url: `${queryUrl}/evaluateindex/deleteById?id=${id}`,
method: 'post',
})
}
// 新增
export function postFormData (obj) {
return request({
url: `${queryUrl}/evaluateindex/save`,
method: 'post',
data: obj,
})
}
// 更新
export function putFormData (obj) {
return request({
url: `${queryUrl}/evaluateindex/update`,
method: 'post',
data: obj,
})
}
// 单项指标模板下载
export function getDownload (params) {
// return exportDownload({url: `${baseName}/model_download`, data: params})
return exportDownload({
url: `${queryUrl}/excel/download`,
data: params,
// method: 'get',
})
}
<file_sep>/src/api/cpms/iepcommontopic.js
import request from '@/router/axios'
const prefixUrl = '/cpms/iepcommontopic'
export function getTableData (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
// 根据id删除话题
export function deleteData (id) {
return request({
url: `${prefixUrl}/delete/${id}`,
method: 'post',
})
}
// 根据id置顶或解除置顶指定话题
export function handleTopUp (obj) {
return request({
url: `${prefixUrl}/topUp`,
method: 'post',
data: obj,
})
}
// 根据id隐藏或解除隐藏指定话题
export function handleHide (obj) {
return request({
url: `${prefixUrl}/hide`,
method: 'post',
data: obj,
})
}
<file_sep>/src/views/hrms/Documents/classified/option.js
export const dictsMap = {
topShow: [
{ value: 0, label: '否' },
{ value: 1, label: '是' },
],
status: [
{ value: 0, label: '生效' },
{ value: 1, label: '失效' },
{ value: 2, label: '废止' },
],
}
export const tableOption = [
{
label: '分类名称',
prop: 'className',
}, {
label: '栏目编码',
prop: 'columnCode',
}, {
label: '创建时间',
prop: 'createTime',
},
]
export const initFormData = () => {
return {
className: '',
columnCode: '',
represent: '',
}
}
export const rules = {
className: [
{ required: true, message: '请输入文件标题', trigger: 'blur' },
],
columnCode: [
{ required: true, message: '请选择文件类别', trigger: 'blur' },
],
represent: [
{ required: true, message: '请输入文件简述', trigger: 'blur' },
],
}
<file_sep>/src/views/crms/contract/options.js
const initSearchForm = () => {
return {
contractName: '',
director: '',
businessTypeFirst: '',
businessType: '',
contractLevel: '',
contractStatus: '',
signDeptName: '',
signTime: '',
contractType: '',
}
}
// const amount = (rules, value, callback) => {
// if (value === '') {
// callback(new Error('金额不能为空'))
// } else {
// var reg = /^\d{0,8}\.{0,1}(\d{1,2})?$/
// var num = /^\d{0,100}\.{0,1}(\d{1,2})?$/
// if (!num.test(value)) {
// callback(new Error('金额为数字类型且小数点后最多两位'))
// } else if (!reg.test(value)) {
// callback(new Error('金额不超过9位整数'))
// }
// }
// callback()
// }
// const amount1 = (rules, value, callback) => {
// var reg = /^\d{0,8}\.{0,1}(\d{1,2})?$/
// var num = /^\d{0,100}\.{0,1}(\d{1,2})?$/
// if (!num.test(value)) {
// callback(new Error('金额为数字类型且小数点后最多两位'))
// } else if (!reg.test(value)) {
// callback(new Error('金额不超过9位整数'))
// }
// callback()
// }
// const RespDept = (rules, value, callback) => {
// if (value.name == '' || value.name == null) {
// callback(new Error('签署组织不能为空'))
// } else {
// callback()
// }
// }
let intValidate = (rule, value, callback) => {
if (/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(value) || value === '') {
callback()
} else {
callback(new Error())
}
}
let xsValidate = (rule, value, callback) => {
if (/^\d+(\.\d{1,2})?$/.test(value) || value === '') {
callback()
} else {
callback(new Error())
}
}
export const rules = {
contractName: [
{ required: true, message: '请输入合同名称', trigger: 'blur' },
{ min: 2, max: 50, message: '长度为2-50个字符', trigger: 'blur' },
],
// contractAmount: [{ required: true, validator: amount, trigger: 'change' }],
contractAmount: [
{ required: true, message: '请输入合同金额', trigger: 'change' },
{ validator: intValidate, message: '请输入正数', trigger: 'change' },
{ validator: xsValidate, message: '小数位最多为2位', trigger: 'change' },
],
contractExpl: [{ max: 255, message: '长度不超过255个字符', trigger: 'blur' }],
businessType: [
{ required: true, message: '请选择业务类型', trigger: 'change' },
],
tagKeyWords: [
{ required: true, message: '请选择或输入标签', trigger: 'change' },
],
companyOrgId: [
{ required: true, message: '请选择委托单位', trigger: 'change' },
],
signCompanyOrgId: [
{ required: true, message: '请选择签属单位', trigger: 'change' },
],
signTime: [{ required: true, message: '请选择签订日期', trigger: 'change' }],
finishTime: [
{ required: true, message: '请选择完结日期', trigger: 'change' },
],
// signDeptOrgName: [{ required: true, validator: RespDept, trigger: 'change' }],
contractLevel: [
{ required: true, message: '请选择合同级别', trigger: 'change' },
],
contractStatus: [
{ required: true, message: '请选择合同状态', trigger: 'change' },
],
// deposit: [{ validator: amount1, trigger: 'change' }],
deposit: [
{ validator: intValidate, message: '请输入正数', trigger: 'change' },
{ validator: xsValidate, message: '小数位最多为2位', trigger: 'change' },
],
projectId: [{ required: true, message: '请选择关联项目', trigger: 'change' }],
}
export const initFormData = () => {
return {
contractName: '',
contractExpl: '',
contractType: 1, // 合同类型
businessType: '',
tagKeyWords: [],
signTime: '',
finishTime: '',
companyOrgId: '', // 委托单位
companyName: { id: '', name: '' },
companyOrgObj: {},
signCompanyOrgId: '', // 签署单位
signCompanyRealName: { id: '', name: '' },
signCompanyOrgObj: {},
signDeptOrgId: '', // 签署组织
signDeptName: '',
underTakeDeptId: [], // 承接部门
underTakeDeptName: [],
directorId: '', // 市场经理-id
directorName: '', // 市场经理-name
directorList: {
id: '',
name: '',
}, // 市场经理-list
contractAmount: '',
contractLevel: '',
contractStatus: '',
deposit: '',
projectName: '',
projectId: '',
contractFile: [],
contractFileList: [],
}
}
export const projecTableOption = [
{
label: '项目名称',
prop: 'projectName',
}, {
label: '项目预算',
prop: 'projectBudget',
}, {
label: '发布人',
prop: 'publisherName',
},
]
export { initSearchForm }
<file_sep>/src/router/wel/index.js
import Layout from '@/page/index/index'
export default [
{
path: '/wel',
component: Layout,
redirect: '/wel/index',
children: [
{
path: 'index',
name: '后台首页',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/index/ican'),
},
{
path: 'newindex',
name: '后台首页(new)',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/index/new'),
},
{
path: 'ican',
name: '后台首页(ican)',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/index/ican'),
},
{
path: 'master',
name: '推荐师父',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/master/'),
},
{
path: 'masterConfirm/:id',
name: '确认师父',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/master/confirm'),
},
{
path: 'friend_confirm/:id',
name: '确认好友',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/RelationshipManage/confirm'),
},
{
path: 'org_confirm/:id',
name: '确认组织',
component: () => import(/* webpackChunkName: "wel" */'@/views/goms/Components/confirm'),
},
{
path: 'account-settings',
name: '个人设置',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/account-settings/index'),
redirect: '/wel/account-settings/base',
children: [
{
path: 'base',
name: 'BaseSettings',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/account-settings/Base'),
meta: { title: '基本设置' },
},
{
path: 'security',
name: 'SecuritySettings',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/account-settings/Security'),
meta: { title: '安全设置' },
},
{
path: 'binding',
name: 'BindingSettings',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/account-settings/Binding'),
meta: { title: '账号关联' },
},
// {
// path: 'notification',
// name: 'NotificationSettings',
// component: () => import(/* webpackChunkName: "wel" */'@/views/wel/account-settings/Notification'),
// },
],
},
{
path: 'org',
name: '选择组织',
component: () => import(/* webpackChunkName: "wel" */'@/views/goms/Welcome/index.vue'),
},
{
path: 'orgwelcome',
name: '欢迎组织',
component: () => import(/* webpackChunkName: "wel" */'@/views/goms/Welcome/Welcome.vue'),
},
{
path: 'desktop',
name: '领导桌面',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/desktop/index'),
},
{
path: 'origanaze_week_detail/:id',
name: '组织周报详情页',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/desktop/OriganazeReport/OriganazeWeekDetail.vue'),
},
{
path: 'origanaze_month_detail/:id',
name: '组织月报详情页',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/desktop/OriganazeReport/OriganazeMonthDetail.vue'),
},
{
path: 'staff_week_detail/:id',
name: '个人周报详情页',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/desktop/StaffReport/StaffWeekDetail.vue'),
},
{
path: 'staff_month_detail/:id',
name: '个人月报详情页',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/desktop/StaffReport/StaffMonthDetail.vue'),
},
{
path: 'visiting_log',
name: '拜訪日志',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/desktop/VisitingLog/index'),
},
{
path: 'visiting_log_detail/:id',
name: '拜訪日志详情',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/desktop/VisitingLog/Detail'),
},
{
path: 'project_report',
name: '项目周报',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/desktop/ProjectReport/index'),
},
{
path: 'project_report_detail/:id',
name: '项目周报详情',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/desktop/ProjectReport/Detail'),
},
{
path: 'staff_report',
name: '员工周月报',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/desktop/StaffReport/index'),
},
{
path: 'origanaze_report',
name: '组织周月报',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/desktop/OriganazeReport/index'),
},
{
path: 'budget_list_detail',
name: '领导桌面项目列表',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/desktop/BudgetListDetail'),
},
{
path: 'relationship_manage',
name: '关系管理',
component: () => import(/* webpackChunkName: "wel" */'@/views/wel/RelationshipManage/index'),
},
],
},
]
<file_sep>/ican.sh
#!/bin/bash
echo "Start Build New Release Branch!"
git reset --hard origin/i-can \
&& git merge origin/develop \
&& git merge origin/feature/mcms/dev \
&& git merge origin/ics \
&& git merge origin/feature/tms/dev \
&& git merge origin/hotfix/org/dev \
&& git push \
&& git checkout deploy-release-ican \
&& git reset --hard origin/i-can \
&& git push
echo "Success!"<file_sep>/src/api/crms/statistics.js
import request from '@/router/axios'
const crmseUrl = '/crm/statistical'
export function getMybusiness (params) {
return request({
url: `${crmseUrl}/my/business`,
method: 'get',
params: params,
})
}<file_sep>/src/api/ims/email.js
import request from '@/router/axios'
const prefixUrl = '/ims/email'
// @/api/ims/email
export function getImsWel () {
return request({
url: `${prefixUrl}/unread_list`,
method: 'get',
})
}
<file_sep>/src/views/hrms/Recruitment/Publish/options.js
import { mergeByFirst } from '@/util/util'
import { initNow } from '@/util/date'
const dictsMap = {
status: {
1: '待发布', 2: '招聘中', 3: '结束招聘',
},
targetCount: { // 是否紧缺
0: '否', 1: '是',
},
}
const columnsMap = [
{
prop: 'dept',
label: '招聘部门',
},
{
prop: 'recruitsCount',
label: '招聘人数',
width: '100',
},
{
prop: 'jobType',
label: '工作类型',
type: 'dictGroup',
dictName: 'hrms_work_type',
width: '100',
},
{
prop: 'applicationTime',
label: '招聘发布时间',
width: '170',
},
{
prop: 'status',
label: '招聘状态',
type: 'dict',
width: '100',
},
]
const initForm = () => {
return {
id: '', // ID
position: [],
positionName: '',
dept: [],
// positionId: '', // 岗位 positionName
// positionName: '', // 岗位 positionName
// deptId: '', // 所属部门 deptnName
deptName: '', // 所属部门 deptnName
recruitsCount: 1, // 招聘人数
targetCount: 0, // 是否紧缺
academicId: '', // 学历要求(dict) hrms_highest_educational
jobTypeId: '', // 工作类型(dict) hrms_work_type
years: '', // 工作年限
profession: '', // 专业要求
place: '', // 工作地点
sex: 1, // 性别
sexName: '', // 性别
treatment: '', // 工资待遇
language: '', // 外语要求
term: initNow(), // 招聘期限
welfare: [], // 福利待遇
welfareTreatmentList: [], // 福利待遇
status: '', // 状态
duties: '', // 岗位职责
claim: '', // 岗位要求
}
}
const initDtoForm = () => {
return {
id: '', // ID
// position: [],
// dept: [],
positionId: '', // 岗位 positionName
// positionName: '', // 岗位 positionName
deptId: '', // 所属部门 deptnName
// deptName: '', // 所属部门 deptnName
recruitsCount: 0, // 招聘人数
targetCount: 0, // 是否紧急
academicId: '', // 学历要求(dict) hrms_highest_educational
jobTypeId: '', // 工作类型(dict) hrms_work_type
years: 0, // 工作年限
profession: '', // 专业要求
place: '', // 工作地点
sex: 1, // 性别
treatment: '', // 工资待遇
language: '', // 外语要求
term: '', // 招聘期限
welfare: '', // 福利待遇
duties: '', // 岗位职责
claim: '', // 岗位要求
}
}
const formToDto = (row) => {
const newForm = mergeByFirst(initDtoForm(), row)
newForm.positionId = row.position[row.position.length - 1]
newForm.deptId = row.dept[row.dept.length - 1]
return newForm
}
const initSearchForm = () => {
return {
position: [], // 岗位id
dept: [], // 部门ID
sex: 0, // 性别id
status: null, // 招聘状态id
rangeTime: null, // 开始时间
}
}
const initDtoSearchForm = () => {
return {
positionId: null, // 岗位id
deptId: null, // 部门ID
sex: 0, // 性别id
status: null, // 招聘状态id
startTime: null, // 开始时间
endTime: null, // 结束时间
}
}
// positionId: 1, // 岗位id
// deptId: 1, // 部门ID
// sex: 1, // 性别id
// status: 1, // 招聘状态id
// startTime: initNow(), // 开始时间
// endTime: initNow(), // 结束时间
const toDtoSearchForm = (row) => {
const newForm = mergeByFirst(initDtoSearchForm(), row)
newForm.sex = row.sex ? row.sex : null
newForm.positionId = row.position.length && row.position[row.position.length - 1]
newForm.deptId = row.dept && row.dept[row.dept.length - 1]
if (row.rangeTime) {
newForm.startTime = row.rangeTime[0]
newForm.endTime = row.rangeTime[1]
}
return newForm
}
const rules = {
position: [
{ required: true, type: 'array', message: '请填写岗位', trigger: 'blur' },
],
dept: [
{ required: false, message: '请填写部门', trigger: 'blur' },
],
recruitsCount: [
{ required: true, message: '请填写招聘人数', trigger: 'blur' },
],
targetCount: [
{ required: true, message: '请选择是否紧急', trigger: 'blur' },
],
academicId: [
{ required: true, message: '请填写学历要求', trigger: 'blur' },
],
jobTypeId: [
{ required: true, message: '请填写工作类型', trigger: 'blur' },
],
years: [
{ required: true, message: '请填写工作年限', trigger: 'blur' },
],
profession: [
{ required: true, message: '请填写专业要求', trigger: 'blur' },
],
place: [
{ required: true, message: '请填写工作地点', trigger: 'blur' },
],
sex: [
{ required: true, message: '请填写性别', trigger: 'blur' },
],
treatment: [
{ required: true, message: '请填写工资待遇', trigger: 'blur' },
],
language: [
{ required: true, message: '请填写外语要求', trigger: 'blur' },
],
term: [
{ required: true, message: '请填写招聘期限', trigger: 'blur' },
],
welfare: [
{ type: 'array', required: true, message: '请填写福利待遇', trigger: 'blur' },
],
duties: [
{ required: true, message: '请填写岗位职责', trigger: 'blur' },
],
claim: [
{ required: true, message: '请填写岗位要求', trigger: 'blur' },
],
}
export { dictsMap, columnsMap, initForm, initSearchForm, formToDto, toDtoSearchForm, rules }<file_sep>/src/router/router.js
import Vue from 'vue'
import VueRouter from 'vue-router'
import PageRouter from './page/'
import hrmsRouter from './hrms/'
import mlmsRouter from './mlms/'
import icsRouter from './ics/'
import gpmsRouter from './gpms/'
import imsRouter from './ims/'
import componentsRouter from './components/'
import welRouter from './wel/'
import atmsRouter from './atms/'
import crmsRouter from './crms/'
import cfmsRouter from './cfms/'
// import appRouter from './app/'
import cpmsRouter from './cpms/'
import pgbdRouter from './pgbd/'
import famsRouter from './fams/'
import conmRouter from './conm/'
import tmsRouter from './tms/'
import exceptionRouter from './exception/'
import meeting from './meeting/'
import AvueRouter from './avue-router'
import Store from '../store/'
Vue.use(VueRouter)
const createRouter = () => new VueRouter({
mode: 'history',
routes: [],
})
const Router = createRouter()
export function initRouter (router, store) {
AvueRouter.install(router, store)
router.$avueRouter.formatRoutes(store.state.menu.menu, true)
router.addRoutes([
...hrmsRouter,
...imsRouter,
...componentsRouter,
...mlmsRouter,
...icsRouter,
...welRouter,
...gpmsRouter,
...crmsRouter,
// ...appRouter,
...cpmsRouter,
...famsRouter,
...conmRouter,
...PageRouter,
...atmsRouter,
...pgbdRouter,
...cfmsRouter,
...tmsRouter,
...exceptionRouter,
...meeting,
])
}
initRouter(Router, Store)
export function resetRouter () {
const newRouter = createRouter()
initRouter(newRouter, Store)
Router.matcher = newRouter.matcher
}
export default Router
<file_sep>/src/views/BlockChain/Record/options.js
const columnsMap = [
{
prop: 'id',
label: 'ID',
width: '55',
},
{
prop: 'hash',
label: '哈希值',
minWidth: '200',
type: 'detail',
},
{
prop: 'sender',
label: '发送者',
width: '100',
},
{
prop: 'receiver',
label: '接收者',
width: '100',
},
{
prop: 'amount',
label: '金额',
width: '80',
},
{
prop: 'createTime',
label: '创建时间',
},
]
const initSearchForm = () => {
return {
send: {
id: '',
name: '',
},
receive: {
id: '',
name: '',
},
rangeTime: [],
}
}
const toDtoSearchForm = (row) => {
const newForm = { ...row }
newForm.sendUserId = newForm.send.id
newForm.receiveUserId = newForm.receive.id
if (newForm.rangeTime.length) {
newForm.startTime = newForm.rangeTime[0]
newForm.endTime = newForm.rangeTime[1]
}
delete newForm.send
delete newForm.receive
delete newForm.rangeTime
return newForm
}
export {
columnsMap,
initSearchForm,
toDtoSearchForm,
}<file_sep>/src/views/mlms/material/datum/contract/option.js
import { getStore } from '@/util/store'
const dicData = getStore({ name: 'dictGroup' })
let changeDictFn = (name) => {
let obj = {}
for (let item of dicData[name]) {
obj[item.value] = item.label
}
return obj
}
export const dictsMap = {
// contractType: [
// { value: '0', label: '内部合同' },
// { value: '1', label: '外部合同' },
// ],
contractType: {
'0': '内部合同',
'1': '外部合同',
},
businessType: changeDictFn('mlms_business_type'),
contractStatus: changeDictFn('mlms_contract_status'),
contractLevel: changeDictFn('mlms_contract_level'),
}
export const deptList = [
{ id: 1, name: '浙江省教育厅' },
{ id: 2, name: '浙江省渔业厅' },
]
export const tableOption = [
{
label: '市场经理',
prop: 'directorRealName',
width: '100px',
}, {
label: '合同类型',
prop: 'contractType',
type: 'dict',
width: '100px',
}, {
label: '合同金额',
prop: 'contractAmount',
width: '100px',
}, {
label: '合同状态',
prop: 'contractStatus',
type: 'dict',
width: '100px',
}, {
label: '回款率',
prop: '',
width: '100px',
},
]
export const initFormData = () => {
return {
contractName: '',
contractExpl: '',
contractType: '1', // 合同类型
businessType: '',
tagKeyWords: [],
signTime: '',
finishTime: '',
companyOrgId: '', // 委托单位
companyName: {id: '', name: ''},
companyOrgObj: {},
signCompanyOrgId: '', // 签署单位
signCompanyRealName: {id: '', name: ''},
signCompanyOrgObj: {},
signDeptOrgId: '', // 签署组织
signDeptName: '',
underTakeDeptId: [], // 承接部门
underTakeDeptName: [],
directorId: '', // 市场经理-id
directorName: '', // 市场经理-name
directorList: {
id: '',
name: '',
}, // 市场经理-list
contractAmount: '',
contractLevel: '',
contractStatus: '',
deposit: '',
projectName: '',
projectId: '',
contractFile: [],
contractFileList: [],
isHistory: 1,
signCompany: '',
}
}
let intValidate = (rule, value, callback) => {
if (/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(value) || value === '') {
callback()
} else {
callback(new Error())
}
}
let xsValidate = (rule, value, callback) => {
if (/^\d+(\.\d{1,2})?$/.test(value) || value === '') {
callback()
} else {
callback(new Error())
}
}
let objValidate = (rule, value, callback) => {
if (value.id == undefined) {
callback(new Error())
} else {
callback()
}
}
export const rules = {
contractName: [
{ required: true, message: '请输入合同名称', trigger: 'blur' },
],
contractExpl: [
{ required: true, message: '', trigger: 'blur' },
],
contractType: [
{ required: true, message: '请选择合同类型', trigger: 'change' },
],
businessType: [
{ required: true, message: '请选择业务类型', trigger: 'change' },
],
tagKeyWords: [
{ required: true, message: '请输入至少3个标签', trigger: 'change' },
],
signTime: [
{ required: true, message: '请选择签订日期', trigger: 'blur' },
],
finishTime: [
{ required: true, message: '请选择完结日期', trigger: 'blur' },
],
companyOrgId: [
{ required: true, message: '必填', trigger: 'change' },
],
companyOrgObj: [
{ validator: objValidate, message: '必填', trigger: 'change' },
],
signCompanyOrgId: [
{ required: true, message: '请输入签署组织', trigger: 'change' },
],
signCompanyOrgObj: [
{ validator: objValidate, message: '必填', trigger: 'change' },
],
signDeptOrgId: [
{ required: true, message: '必填', trigger: 'change' },
],
signDeptName: [
{ required: true, message: '必填', trigger: 'change' },
],
underTakeDeptId: [
{ required: true, message: '必填', trigger: 'change' },
],
underTakeDeptList: [
{ required: true, message: '必填', trigger: 'change' },
],
directorId: [
{ required: true, message: '必填', trigger: 'change' },
],
directorName: [
{ required: true, message: '必填', trigger: 'change' },
],
directorList: [
{ required: true, message: '请选择市场经理', trigger: 'change' },
],
contractAmount: [
{ required: true, message: '请输入合同金额', trigger: 'change' },
{ validator: intValidate, message: '请输入正数', trigger: 'change' },
{ validator: xsValidate, message: '小数位最多为2位', trigger: 'change' },
],
contractLevel: [
{ required: true, message: '请选择合同级别', trigger: 'change' },
],
contractStatus: [
{ required: true, message: '请选择合同状态', trigger: 'change' },
],
deposit: [
{ validator: intValidate, message: '请输入正数', trigger: 'change' },
{ validator: xsValidate, message: '小数位最多为2位', trigger: 'change' },
],
projectId: [
{ required: true, message: '请选择关联项目', trigger: 'change' },
],
}
export const projecTableOption = [
{
label: '项目名称',
prop: 'projectName',
}, {
label: '项目预算',
prop: 'projectBudget',
}, {
label: '发布人',
prop: 'publisherName',
},
]
export function initSearchForm () {
return {
contractName: '',
director: '',
businessTypeFirst: '',
businessType: '',
contractLevel: '',
contractStatus: '',
signDeptName: '',
signTime: '',
contractType: '',
}
}
export const infoList = [
{ name: '关联项目', value: 'projectName', type: 'project', subVal: 'serialNo' },
{ name: '市场经理', value: 'directorRealName' },
{ name: '合同类型', value: 'contractType', type: 'dict' },
{ name: '业务类型', value: 'businessTypeList' },
{ name: '签订日期', value: 'signTime', type: 'date' },
{ name: '完结日期', value: 'finishTime', type: 'date' },
{ name: '委托单位', value: 'companyRealName' },
{ name: '签署单位', value: 'signCompanyRealNameName' },
{ name: '签署组织', value: 'signDeptOrgNames' },
{ name: '承接部门', value: 'underTakeDeptNames' },
{ name: '合同金额', value: 'contractAmount' },
{ name: '合同级别', value: 'contractLevel', type: 'dict' },
{ name: '保证金', value: 'deposit' },
{ name: '签署主体', value: 'signCompanyName' },
]
<file_sep>/src/api/fams/fee.js
import request from '@/router/axios'
const prefixUrl = '/fams/fee'
// @/api/fams/fee
export function getMyFeePage (query) {
return request({
url: `${prefixUrl}/my/page`,
method: 'get',
params: query,
})
}
// 财务管理
export function getFeePage (query) {
return request({
url: `${prefixUrl}/financial_page`,
method: 'get',
params: query,
})
}
// 个人审批发票
export function getMyFeeApprovalPage (query) {
return request({
url: `${prefixUrl}/primary_page`,
method: 'get',
params: query,
})
}
export function getFeeById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function postFee (obj, isPublish = false) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: { isPublish, ...obj },
})
}
export function putFee (obj, isPublish = false) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: { isPublish, ...obj },
})
}
export function putFeeRelation (obj) {
return request({
url: `${prefixUrl}/update/project`,
method: 'post',
data: obj,
})
}
export function referFeeById (id) {
return request({
url: `${prefixUrl}/refer/${id}`,
method: 'post',
})
}
export function withdrawFeeById (id) {
return request({
url: `${prefixUrl}/withdraw/${id}`,
method: 'post',
})
}
export function deleteFeeById (id) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: [id],
})
}
export function deleteFeeBatch (ids) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}
export function rejectFee (obj) {
return request({
url: `${prefixUrl}/financial_refuse`,
method: 'post',
data: obj,
})
}
export function passFee (obj) {
return request({
url: `${prefixUrl}/financial_agree`,
method: 'post',
data: obj,
})
}
export function myRejectFee (obj) {
return request({
url: `${prefixUrl}/primary_refuse`,
method: 'post',
data: obj,
})
}
export function myPassFee (obj) {
return request({
url: `${prefixUrl}/primary_agree`,
method: 'post',
data: obj,
})
}
export function myTransFee (obj) {
return request({
url: `${prefixUrl}/primary_transmit`,
method: 'post',
data: obj,
})
}<file_sep>/src/api/crms/information.js
import request from '@/router/axios'
const crmsUrl = 'crm/customer'
// 资讯-新增
export function createConsultation (obj) {
return request({
url: `${crmsUrl}/create`,
method: 'post',
data: obj,
})
}<file_sep>/src/api/mlms/material/datum/material.js
import request from '@/router/axios'
const prefixUrl = '/mlms/material'
export function getTableData (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
// 供给邮件关联使用,与上面的链接一模一样
export function getMaterialList (params) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
export function getTableDataOnlyMe (params) {
return request({
url: `${prefixUrl}/page/personal`,
method: 'get',
params: params,
})
}
export function createData (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function updateData (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function deleteData (id) {
let ids = typeof id === 'object' ? id : [id]
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}
export function getDataById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
// 文件下载浏览次数统计
export function downloadCount (id) {
return request({
url: `${prefixUrl}/i_can/download/${id}`,
method: 'get',
})
}
// 获取优秀材料
export function getGreatMaterial (id) {
return request({
url: `${prefixUrl}/excellent/list/${id}`,
method: 'get',
})
}
// 获取材料的总数
export function getMaterialTotal (id) {
return request({
url: `${prefixUrl}/total/${id}`,
method: 'get',
})
}
// 重名验证
export function validateName (name) {
return request({
url: `${prefixUrl}/get/name/${name}`,
method: 'post',
})
}
// 判断用户有无联盟
export function getUnion () {
return request({
url: `${prefixUrl}/get/union`,
method: 'post',
})
}
// 更新版本
export function getVersion (obj) {
return request({
url: `${prefixUrl}/get/new/version`,
method: 'post',
data: obj,
})
}
<file_sep>/src/api/fams/financial_management.js
import request from '@/router/axios'
const prefixUrl = '/fams/finance/account'
// @/api/fams/financial_management
export function getCreateFinanceByUserId (userId) {
return request({
url: `${prefixUrl}/create_by_user/${userId}`,
method: 'get',
})
}
<file_sep>/src/api/tms/statistics.js
import request from '@/router/axios'
const prefixUrl = '/tms'
// @/api/tms/statistics
export function getTagStatistics () {
return request({
url: `${prefixUrl}/statistics/count`,
method: 'get',
})
}
export function getTagDistributed () {
return request({
url: `${prefixUrl}/statistics/distributed`,
method: 'get',
})
}
export function getTagDayNew () {
return request({
url: `${prefixUrl}/statistics/daynew`,
method: 'get',
})
}
export function getTagWeekNew () {
return request({
url: `${prefixUrl}/statistics/weeknew`,
method: 'get',
})
}
export function getTagCommon () {
return request({
url: `${prefixUrl}/statistics/common`,
method: 'get',
})
}
export function getTagRelationList (id) {
return request({
url: `${prefixUrl}/statistics/relation/${id}`,
method: 'get',
})
}
<file_sep>/src/views/fams/GroupFinance/UnionProfitAndLoss/Year/options.js
const columnsMap = [
{
prop: 'year',
label: '年度',
width: '80',
},
{
prop: 'orgName',
label: '组织名称',
width: '300',
},
{
prop: 'contractAmount',
label: '合同金额',
},
]
export { columnsMap }<file_sep>/src/views/exam/reviewCenter/testQuestionsLibrary/Page/makedown.js
export const gruber = {
block: {
//自定义每题的题干、选项、答案和解析
//题干
qtTitle: function qtTitle (block) {
let m = block.match(/^(([0-9]+\.)|(((\()|()[0-9]+((\))|))))\s*(.*?)\s*(?:\n|$)/)
if (!m) return undefined
let title = ['title'].concat(m[8])
return title
},
//选项
qtKey: function qtKey (block, qt_type) {
let m = block.match(/^([A-Z])(\.)\s*(.*?)\s*(?:\n|$)/)
if (!m) return undefined
if (qt_type === 13 || qt_type === 12) {
let n = m[1].match(/^[A-Z]/)
let key = [n[0]].concat(m[3])
return key
} else {
let error = ['key_error']
error.push(m[0])
return error
}
},
//答案
qtAnswer: function qtAnswer (block, qt_type) {
let m = block.match(/^(答案[::])\s*(.*?)\s*(?:\n|$)/)
if (!m) return undefined
let answer = ['answer']
let n
if (qt_type === 13) {
n = m[2].match(/^\s*[a-z]\s*(?:\n|$)/i)
if (n == null) {
let error = ['ans_error']
error.push(m[2])
return error
} else {
answer.push(m[2].toUpperCase())
}
} else if (qt_type === 12) {
n = m[2].match(/^\s*[a-z]{1,26}\s*(?:\n|$)/i)
if (n == null) {
let error = ['ans_error']
error.push(m[2])
return error
} else {
answer.push(m[2].toUpperCase().split(''))
}
} else if (qt_type === 11) {
n = m[2].match(/^\s*(正确|错误|对|错)\s*(?:\n|$)/i)
if (n == null) {
let error = ['ans_error']
error.push(m[2])
return error
} else {
const txt = m[2] == '对' ? '正确' : m[2] == '错' ? '错误' : m[2]
answer.push(txt)
}
} else {
answer.push(m[2])
}
return answer
},
// 解析
qtAnalysis: function qtAnalysis (block) {
let m = block.match(/^(解析[::])\s*(.*?)\s*(?:\n|$)/)
if (!m) return undefined
let analysis = ['analysis']
analysis.push(m[2])
return analysis
},
// 标签
qtTag: function qtTag (block) {
let m = block.match(/^(标签[::])\s*(.*?)\s*(?:\n|$)/)
if (!m) return undefined
let res = /([、,,.]|\.)/g
m[2] = m[2].replace(res, ',')
let labels = ['tag']
labels.push(m[2])
return labels
},
para: function para (block) {
return ['para'].concat(block)
},
},
}
export const markArray = [
'qtTitle', 'qtKey', 'qtAnswer', 'qtAnalysis', 'qtTag', 'para',
]<file_sep>/src/api/examPaper/examPaperApi.js
import request from '@/router/axios'
/**
* 获取列表数据
* @param {Object} params 参数
*/
export function getExamPagerList (params) {
return request({
url: '/exms/ieptestpaper/page',
method: 'get',
params: params,
})
}
/**
* 提交试卷
* @param {Object} params 对象
*/
export function postNewPaper (params) {
return request({
url: '/exms/ieptestpaper/createTestPaper',
method: 'post',
data: params,
})
}
/**
* 获取题库相应题型的数量
* @param {Object} params 对象
*/
export function postPaperAmount (params) {
return request({
url: '/exms/iepitembank/statistics',
method: 'post',
params: params,
})
}
/**
* 获取固定选题试题
* @param {Object} params 对象
*/
export function getPaperTest (params) {
return request({
url: '/exms/iepitembank/selectItemByTypeSub',
method: 'post',
params: params,
})
}
/**
* 删除试卷
*/
export function deletePaperById (params) {
return request({
url: '/exms/ieptestpaper/deleteByStatus',
method: 'post',
data: params,
})
}
/**
* 根据ID获取试卷
*/
export function getTestPaperById (params) {
return request({
url: '/exms/ieptestpaper/getTestPaperById',
method: 'get',
params: params,
})
}
<file_sep>/src/views/wenjuan/util/export.js
import request from '@/views/wenjuan/router/request'
import {downloadExport} from '@/util/util'
export default function exportDownload ({url, method = 'post', data = {}, title = ''}) {
return new Promise((resolve) => {
return request({
url: url,
method: method,
headers: {
responseType: 'arraybuffer',
},
timeout: 60 * 1000 * 30,
data: data,
responseType: 'blob',
}).then((response) => {
downloadExport({title: title, response}).then(() => {
resolve()
})
})
})
}
<file_sep>/src/views/atms/options.js
import { mergeByFirst } from '@/util/util'
const dictsMap = {
taskStatus: {
1: '未完成',
2: '已完成',
3: '已确认',
},
priority: {
1: '普通',
2: '紧急',
3: '非常紧急',
},
}
const initForm = (opt) => {
return {
taskId:'',
taskName: '',
parentName:'',
taskStatus: '1',//任务状态
priority: '',//优先级
creatorId:'',//创建人id
executors: [],//协同人
assistants: [],//执行人,
principals: {
id: opt ? opt.userId : '',
name: opt ? opt.realName : '',
},//负责人
principal:'',//负责人id
principalName:'',//负责人
avatar:'',//负责人头像
startEndTime:[],//起止时间
completeTime:'',//完成时间
startTime:'',
endTime:'',
tagKeyWords: [],//标签
remarks:'',//备注
annexList: [],//附件
attach:'',
materials: [],//关联内容
records:[],//流转日志
similarTasks:[],//相似任务
children: [],//子任务
parentId:'',
summaryIds: [], // 纪要
summaryList: [],
materialIds: [], // 材料
materialList: [],
projectId:'',//项目
projectName:'',
projectList:[{id:'',name:''}],
}
}
const initTransferForm = () => {
return {
principal:{id:'',name:''},
}
}
const initConversionForm = () => {
return {
parent:{id:'',name:''},
}
}
const formToDto = (form) => {
const newForm = mergeByFirst(initForm(), form)
newForm.executorIds = form.executors.map(m=>m.id)
newForm.assistantIds = form.assistants.map(m=>m.id)
return newForm
}
const rules = {
taskName: [
{ required: true, message: '请输入任务名称', trigger: 'blur' },
],
// taskStatus: [
// { required: true, message: '请输入', trigger: 'blur' },
// ],
// priority: [
// { required: true, message: '请输入', trigger: 'blur' },
// ],
// executors: [
// { required: true, message: '请输入', trigger: 'blur' },
// ],
// assistants: [
// { required: true, message: '请输入', trigger: 'blur' },
// ],
startEndTime: [
{ required: true, message: '请输入', trigger: 'blur' },
],
// tagKeyWords: [
// { required: true, message: '请输入', trigger: 'blur' },
// ],
}
export const relatedFormList = [{
name: '关联的纪要',
ids: 'summaryIds',
list: 'summaryList',
}, {
name: '关联的材料',
ids: 'materialIds',
list: 'materialList',
},
]
export { initForm, rules, dictsMap, formToDto, initTransferForm, initConversionForm }<file_sep>/src/views/wel/approval/Components/Detail/options.js
// import { mergeByFirst } from '@/util/util'
import { initNow } from '@/util/date'
const dictsMap = {
startTime: {
1: '请假开始时间',
2: '出差开始时间',
3: '加班开始时间',
4: '入职时间',
5: '入职时间',
6: '入职时间',
},
endTime: {
1: '请假结束时间',
2: '出差结束时间',
3: '加班结束时间',
4: '转正时间',
5: '离职时间',
6: '调岗时间',
},
status: {
0: '未审核',
1: '通过',
2: '拒绝',
},
sStatus: {
1: '通过',
2: '拒绝',
},
}
const initForm = () => {
return {
id: '', // ID
name: '', // 申请人
avatar: '', // 头像
type: 1, //
deptList: [], // 所属部门
approverList: [],
attachFile: [], // 附件
createTime: '', // 创建时间
startTime: '', // 开始时间(1:请假开始时间;2:出差开始时间;3:加班开始时间;4:入职时间;5:入职时间)
endTime: '', // 结束时间(1:请假结束时间;2:出差结束时间;3:加班结束时间;4:转正时间;5:离职时间;6:调岗时间)
job: '', // 职务
title: '', // 职称
reason: '', // 申请理由
annex: '', // 附件
status: 0,
orgName: '',
processList: [], // 申请流程
cc: '', // 抄送人
ccList: [], // 抄送人
userId: '', // 抄送人
transferDeptList: {
name: '',
},
levaeType: '',
busTripDistrict: '',
}
}
const formToVo = (row) => {
const newForm = { ...row }
return newForm
}
const initSelfForm = () => {
return {
id: '', // 用户ID 不可编辑
name: '', // 真实姓名 不可编辑
avatar: '', // 头像
positionName: '', // 岗位
job: '', // 职务
title: '', // 职称
entryTime: '', // 入职时间
positiveTime: '', // 转正时间
transferTime: '', // 调动时间
deptList: [], // 所属部门 Vo 不可编辑
dept: [], // 所属部门不可编辑
}
}
export {
dictsMap,
initSelfForm,
initForm,
formToVo,
initNow,
}
<file_sep>/src/views/admin/version/options.js
const columnsMap = [
{
prop: 'versionTitle',
label: '标题',
width:'600px',
},
{
prop: 'versionNumber',
label: '版本号',
width:'100px',
},
{
prop: 'publisherName',
label: '发布人',
width:'100px',
},{
prop: 'createTime',
label: '发布时间',
width:'150px',
},
]
const initForm = () => {
return {
id: '',
versionTitle: '',
versionNumber: '',
createTime:'',
versionDesc:'',
}
}
export { columnsMap, initForm }<file_sep>/src/views/goms/BasicConfiguration/Suggest/options.js
const dictsMap = {
status: {
0: '草稿',
1: '未处理',
2: '已采纳',
3: '已驳回',
},
}
const columnsMap = [
{
prop: 'status',
label: '状态',
type: 'dict',
},
{
prop: 'sendTime',
label: '发送时间',
},
]
export { dictsMap, columnsMap }<file_sep>/src/api/crms/contract.js
import request from '@/router/axios'
const prefixUrl = '/mlms/contract'
export function getContractPage (params) {
return request({
url: `${prefixUrl}/page/outContract`,
method: 'get',
params: params,
})
}
export function postContract (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function putContract (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
//只删除客户
export function deleteContractById (id) {
return request({
url: `${prefixUrl}/deleteRelation/batch`,
method: 'post',
data: [id],
})
}
//删除全部
export function deleteContract (id) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: [id],
})
}
export function getDataById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
<file_sep>/src/router/conm/index.js
import Layout from '@/page/index/index'
export default [
{
path: '/comn',
component: Layout,
children: [
{
path: 'station_management_detail/:id',
name: '站点管理详情',
component: () => import('@/views/conm/StationGroupManagement/Detail'),
},
// {
// path: 'column_management/:id',
// name: '栏目管理',
// component: () => import('@/views/conm/ColumnManagement/index'),
// },
// {
// path: 'attribute_management/:id',
// name: '推荐位管理',
// component: () => import('@/views/conm/AttributeManagement/index'),
// },
// {
// path: 'a_d_slot_management/:id',
// name: '广告位管理',
// component: () => import('@/views/conm/ADSlotManagement/index'),
// },
// {
// path: 'a_d_management/:id',
// name: '广告管理',
// component: () => import('@/views/conm/ADManagement/index'),
// },
{
path: 'document_management/:id',
name: '文档管理',
component: () => import('@/views/conm/DocumentManagement/index'),
},
{
path: 'document_management_detail/:id',
name: '文档管理详情',
component: () => import('@/views/conm/DocumentManagement/Detail'),
},
{
path: 'document_management_edit/:id',
name: '文档管理新增',
component: () => import('@/views/conm/DocumentManagement/Edit'),
},
],
},
]
<file_sep>/src/views/wel/approval/Components/New/options.js
import { mergeByFirst } from '@/util/util'
import { initNow } from '@/util/date'
const initForm = () => {
return {
id: '', // ID
userId: '', // 申请人ID
orgId: '', // 申请人ID
avatar: '', // 申请人avatar
name: '',
positionName: '',
job: '',
title: '',
nowTime: initNow(),
positiveTime: '',
transferTime: '',
deptQm: '',
deptList: [],
dept: [], // 所属部门不可编辑
type: 1, // 审批类型(字典:1-请假申请;2-出差申请;3-加班申请;4-请假申请;5-离职申请;6-调岗申请;7-招聘申请)
startTime: initNow(), // 开始时间(1:请假开始时间;2:出差开始时间;3:加班开始时间;4:入职时间;5:入职时间)
endTime: '', // 结束时间(1:请假结束时间;2:出差结束时间;3:加班结束时间;4:转正时间;5:离职时间;6:调岗时间)
reason: '', // 申请理由
attachFile: [], // 文件
annex: [], // 文件
approver: [], // 审批人
cc: [], // 抄送人
duration: '', //各种时长
levaeType: '', // 请假类型
transferDeptList: {
id: '',
name: '',
}, // 部门
transferDept: '', // 部门ID
transferPosition: [], // 岗位ID
busTripDistrict: '',
}
}
const formToVo = (row) => {
const newForm = mergeByFirst(initForm(), row)
newForm.annex = row.attachFile || []
newForm.approver = row.approverList || []
newForm.cc = row.ccList || []
return newForm
}
const selfToVo = (row) => {
const newForm = mergeByFirst(initForm(), row)
newForm.annex = row.attachFile || []
newForm.startTime = row.entryTime || ''
newForm.approver = row.approverList || []
newForm.cc = row.ccList || []
return newForm
}
const initSelfForm = () => {
return {
id: '', // 用户ID 不可编辑
name: '', // 真实姓名 不可编辑
avatar: '', // 头像
positionName: '', // 岗位
job: '', // 职务
title: '', // 职称
entryTime: '', // 入职时间
positiveTime: '', // 转正时间
transferTime: '', // 调动时间
deptList: [], // 所属部门 Vo 不可编辑
dept: [], // 所属部门不可编辑
}
}
const formToDto = (row, type, userId) => {
const newForm = { ...row, type, userId }
newForm.attachFileUrl = row.annex.map(m => m.url)[0]
newForm.transferDept = row.transferDeptList.id
newForm.transferPosition = row.transferPosition[row.transferPosition.length - 1]
newForm.approver = row.approver.map(m => m.id)
newForm.cc = row.cc.map(m => m.id)
delete newForm.annex
delete newForm.attachFile
return newForm
}
export {
initSelfForm,
initForm,
formToDto,
formToVo,
selfToVo,
initNow,
}
<file_sep>/src/views/fams/MoreSettings/BankAccountSetting/options.js
// import { mergeByFirst } from '@/util/util'
const initForm = () => {
return {
id: '',
// isWagePay: 0, // (0-不是,1-是)
accountName: '',
// companyIds: [],
// isInvoiceingPay: 0, // (0-不是,1-是)
}
}
const columnsMap = [
{
prop: 'id',
label: 'ID',
width: 80,
},
{
prop: 'accountName',
label: '银行户头',
},
{
prop: 'updateTime',
label: '操作时间',
width: '170px',
},
]
export {
columnsMap,
initForm,
}
<file_sep>/src/api/app/hrms/index.js
import request from '@/router/axios'
const prefixUrl = '/hrms/channel_recruit'
// @/api/app/hrms/index
export const getPostList = (params) => {
return request({
url: `${prefixUrl}/list`,
method: 'get',
params: params,
})
}
export const getNewestList = (params) => {
return request({
url: `${prefixUrl}/training_newest`,
method: 'get',
params: params,
})
}
// 培训预告
export const getNoticeList = (params) => {
return request({
url: `${prefixUrl}/training_notice`,
method: 'get',
params: params,
})
}
export const getPastList = (params) => {
return request({
url: `${prefixUrl}/training_past`,
method: 'get',
params: params,
})
}
export const getRecruitPage = (params) => {
return request({
url: `${prefixUrl}/training_page`,
method: 'get',
params: params,
})
}
export const getRecruitDetail = (id) => {
return request({
url: `${prefixUrl}/training/${id}`,
method: 'get',
})
}
// 国脉人
export const getRecruitDetailPage = (obj) => {
return request({
url: `${prefixUrl}/hr_detail/page`,
method: 'get',
params: obj,
})
}
// 频道页国脉人统计
export const getRecruitCount = () => {
return request({
url: `${prefixUrl}/count`,
method: 'get',
})
}
// 今日寿星
export const getRecruitBirthday = () => {
return request({
url: `${prefixUrl}/birthday`,
method: 'get',
})
}
// 热门培训
export const getHottestList = () => {
return request({
url: `${prefixUrl}/training_hottest`,
method: 'get',
})
}
// 优秀讲师
export const getTeacherList = () => {
return request({
url: `${prefixUrl}/training_teacher`,
method: 'get',
})
}
// 组织人才需求
export const getRecruitList = (id) => {
return request({
url: `${prefixUrl}/recruit_list/${id}`,
method: 'get',
})
}
// 频道页用户详情
export const getUserDetail = (id) => {
return request({
url: `${prefixUrl}/user_detail/${id}`,
method: 'get',
})
}
// 频道页用户相似用户
export const getSimilarUsers = (id) => {
return request({
url: `${prefixUrl}/user_detail/similar_users/${id}`,
method: 'get',
})
}
// 交流密切
export const getCommunication = (id) => {
return request({
url: `${prefixUrl}/communication/${id}`,
method: 'get',
})
}
// 数据-个人信用
export const getCredit = () => {
return request({
url: `${prefixUrl}/personal/credit`,
method: 'get',
})
}
// 数据雷达图
export const getRadar = () => {
return request({
url: `${prefixUrl}/user_map`,
method: 'get',
})
}
// 光彩国脉人
export const getGlowPersonList = () => {
return request({
url: 'hrms/iephrsplendormanage/userList',
method: 'get',
})
}
// 个人证书list
export const getCertificateList = () => {
return request({
url: 'hrms/relation/certificate/list',
method: 'get',
})
}
// 个人证书page
export const getCertificatePage = () => {
return request({
url: 'hrms/relation/certificate/page',
method: 'get',
})
}
<file_sep>/src/views/admin/union/options.js
// org config options
const dictsMap = {
isOpen: {
0: '开',
1: '关',
},
status: {
0: '审核通过',
1: '待审核',
2: '审核驳回',
},
}
const columnsMap = [
{
prop: 'name',
label: '联盟名称',
width: '200px',
},
{
prop: 'intro',
label: '联盟描述',
type: 'detail',
},
{
prop: 'status',
label: '状态',
type: 'dict',
width: '80px',
},
{
prop: 'createTime',
label: '创建时间',
type: 'date',
formatString: 'YYYY-MM-DD',
width: '140px',
},
]
const initForm = () => {
return {
abrName: '',
contactMethod: '',
coreAdvantage: '',
createTime: '',
establishTime: '',
intro: '',
logo: '',
modules: [],
name: '',
orgId: 0,
orgName: '',
status: 0,
structure: '',
unionCulture: '',
unionId: 1,
updateTime: '',
userId: 1,
}
}
const checkboxInit = (row) => {
if (row.status === 0)
return 0 //不可勾选
else
return 1 //可勾选
}
export { dictsMap, columnsMap, checkboxInit, initForm }<file_sep>/src/views/crms/contract/columns.js
const columnsMapByTypeId = [
{ label: '合同名称', prop: 'contractName',width:'300' },
{ label: '合同类型', prop: 'contractType', type: 'dict' },
{ label: '合同金额', prop: 'contractAmount' },
{ label: '合同状态', prop: 'contractStatusValue' },
{ label: '回款率', prop: 'odds' },
]
const dictsMap = {
contractType: {
'0': '内部合同',
'1': '外部合同',
},
}
export { columnsMapByTypeId, dictsMap }
<file_sep>/src/api/app/tms/index.js
import request from '@/router/axios'
const prefixUrl = '/tms/channel_tag'
export const getTagsList = (params) => {
return request({
url: `${prefixUrl}/list`,
method: 'get',
params: params,
})
}
// 推荐主题
export const getRectagsList = (params) => {
return request({
url: `${prefixUrl}/rectags`,
method: 'get',
params: params,
})
}
<file_sep>/src/api/cpms/thoughts.js
import request from '@/router/axios'
const prefixUrl = '/cpms/iephrthoughts'
const commentUrl = '/cpms/iepcommonthoughtscomment'
const replyUrl = '/cpms/iepcommonthoughtsreply'
export function thoughtsCreate (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function getThoughtsList (obj) {
return request({
url: `${prefixUrl}/list`,
method: 'get',
params: obj,
})
}
export function getThoughtsPage (obj) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: obj,
})
}
export function thoughtsDelete (obj) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: obj,
})
}
// 分页查询感想
export function geTallPage (obj) {
return request({
url: `${prefixUrl}/all_page`,
method: 'get',
params: obj,
})
}
// 获取我关注的用户的说说
export function getFollowPage (obj) {
return request({
url: `${prefixUrl}/follow_page`,
method: 'get',
params: obj,
})
}
// 说说中@人联想接口
export function getUserNameList (obj) {
return request({
url: `${prefixUrl}/user/name/list`,
method: 'get',
params: obj,
})
}
// 说说点赞
export function addThumbsUpByRecord (id) {
return request({
url: `${prefixUrl}/addThumbsUpByRecord/${id}`,
method: 'get',
})
}
// 说说总数榜 - 总
export function getMostThoughts () {
return request({
url: `${prefixUrl}/mostThoughts`,
method: 'get',
})
}
// 说说总数榜 - 分页
export function getMostThoughtsPage (params) {
return request({
url: `${prefixUrl}/mostThoughts/page`,
method: 'get',
params: params,
})
}
// 本周排行榜 - 总
export function getMostThoughtsWeekly () {
return request({
url: `${prefixUrl}/mostThoughtsWeekly`,
method: 'get',
})
}
// 本周排行榜 - 分页
export function getMostThoughtsWeeklyPage (params) {
return request({
url: `${prefixUrl}/mostThoughtsWeekly/page`,
method: 'get',
params: params,
})
}
// 本周点赞榜 - 总
export function getMostThumbedThoughtsWeekly () {
return request({
url: `${prefixUrl}/mostThumbedThoughtsWeekly`,
method: 'get',
})
}
// 本周点赞榜 - 分页
export function getMostThumbedThoughtsWeeklyPage (params) {
return request({
url: `${prefixUrl}/mostThumbedThoughtsWeekly/page`,
method: 'get',
params: params,
})
}
// 热门话题榜 - 总
export function getHotTopics () {
return request({
url: `${prefixUrl}/hotTopics`,
method: 'get',
})
}
// 热门话题榜 - 分页
export function getHotTopicsPage (params) {
return request({
url: `${prefixUrl}/hotTopics/page`,
method: 'get',
params: params,
})
}
// 说说点赞用户列表
export function getThumbMembers (id) {
return request({
url: `${prefixUrl}/thumbMembers/${id}`,
method: 'get',
})
}
// 说说详情
export function getDetailById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
// 获取对应话题的说说列表
export function getTopicThoughts (obj) {
return request({
url: `${prefixUrl}/topicThoughts`,
method: 'get',
params: obj,
})
}
// 根据id置顶指定说说
export function topUpThoughts (obj) {
return request({
url: `${prefixUrl}/topUp`,
method: 'post',
data: obj,
})
}
// 说说管理页面的说说分页
export function getManagePage (params) {
return request({
url: `${prefixUrl}/manage/page`,
method: 'get',
params: params,
})
}
// 获取置顶说说的列表
export function getToppedThoughts (params) {
return request({
url: `${prefixUrl}/getToppedThoughts`,
method: 'get',
params: params,
})
}
// 批量修改说说公开状态
export function postStatusBatch (data) {
return request({
url: `${prefixUrl}/status/batch`,
method: 'post',
data: data,
})
}
// 批量修改说说公开状态
export function getMostComments (params) {
return request({
url: `${prefixUrl}/mostComments/page`,
method: 'get',
params: params,
})
}
/******************************************************************* 评论 commentUrl */
// 评论
export function CommentThoughts (obj) {
return request({
url: `${commentUrl}/create`,
method: 'post',
data: obj,
})
}
// 评论点赞
export function addcCommentThumbsByRecord (id) {
return request({
url: `${commentUrl}/commentThumbsByRecord/${id}`,
method: 'get',
})
}
// 评论删除
export function deleteCommentThumbsById (id) {
return request({
url: `${commentUrl}/${id}`,
method: 'post',
})
}
// 评论的分页
export function getCommentsByThoughtsId (params) {
return request({
url: `${commentUrl}/getCommentsByThoughtsId`,
method: 'get',
params: params,
})
}
/******************************************************************* 回复 replyUrl */
// 回复评论
export function CommentReply (obj) {
return request({
url: `${replyUrl}/create`,
method: 'post',
data: obj,
})
}
// 回复评论
export function deleteCommentById (id) {
return request({
url: `${replyUrl}/${id}`,
method: 'post',
})
}
// 回复点赞
export function addReplyThumbsByRecord (id) {
return request({
url: `${replyUrl}/replyThumbsByRecord/${id}`,
method: 'get',
})
}
<file_sep>/src/api/fams/initial.js
import request from '@/router/axios'
const prefixUrl = '/fams/initial'
// @/api/fams/initial
export function getinitialList (orgId, year) {
return request({
url: `${prefixUrl}/list/${orgId}/${year}`,
method: 'get',
})
}
export function putinitial (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}<file_sep>/src/views/wenjuan/components/govDetailForm/js/index.js
export function getYear (val) {
return val.getFullYear()
}
export function getMonth (val, pad = 1) {
return ((val.getMonth() + 1) + '').padStart(pad, '0')
}
export function getDate (val, pad = 1) {
return (val.getDate() + '').padStart(pad, '0')
}
export function getHours (val, pad = 1) {
return (val.getHours() + '').padStart(pad, '0')
}
export function getMinutes (val, pad = 1) {
return (val.getMinutes() + '').padStart(pad, '0')
}
export function getSeconds (val, pad = 1) {
return (val.getSeconds() + '').padStart(pad, '0')
}
export function valueFormat (val, valueFormat) {
if (val === '') {
return ''
}
let value = new Date(val)
let times = {
yyyy: {
text: 'yyyy',
getTime: getYear(value),
},
M: {
text: 'M',
getTime: getMonth(value),
},
MM: {
text: 'MM',
getTime: getMonth(value, 2),
},
d: {
text: 'd',
getTime: getDate(value),
},
dd: {
text: 'dd',
getTime: getDate(value, 2),
},
H: {
text: 'H',
getTime: getHours(value),
},
HH: {
text: 'HH',
getTime: getHours(value, 2),
},
m: {
text: 'm',
getTime: getMinutes(value),
},
mm: {
text: 'mm',
getTime: getMinutes(value, 2),
},
s: {
text: 's',
getTime: getSeconds(value),
},
ss: {
text: 'ss',
getTime: getSeconds(value, 2),
},
}
if (valueFormat === 'timestamp') {
if (typeof val === 'number') {
return +value
}
return ''
} else if (typeof valueFormat === 'string') {
const reg = /[a-zA-Z]+/g
const result = valueFormat.match(reg)
if (_isFormat(result, times)) {
const unreg = /[^a-zA-Z]+/g
const unresult = valueFormat.match(unreg)
return getTimes({times, unresult, result})
}
return ''
} else {
return ''
}
}
// 判断规则是否正确
function _isFormat (val, times) {
let is = true
for (let i = 0, len = val.length; i < len; i++) {
if (times[val[i]] == null) {
is = false
break
}
}
return is
}
/**
* [获取时间]
* @param {Object} options.times [格式]
* @param {Array} result [匹配的时间格式]
* @param {Array} unresult [匹配时间连接符]
* @return {[type]} [description]
*/
function getTimes ({times = {}, result = [], unresult = []}) {
let re = ''
for (let i = 0, len = result.length; i < len; i++) {
// console.log(times[result[i]])
re += times[result[i]].getTime
if (unresult && i < unresult.length) {
re += unresult[i]
}
}
return re
}
<file_sep>/src/views/mlms/material/components/options.js
import { getStore } from '@/util/store'
const dicData = getStore({ name: 'dictGroup' })
function changeDict (list) {
let data = {}
for (let item of list) {
data[item.value] = item.label
}
return data
}
export const dictsMap = {
meetingType: changeDict(dicData.mlms_meeting_type),
visitType: changeDict(dicData.mlms_visit_type),
}
// 分享
export function initShareForm () {
return {
attachmentIds: [],
content: '',
emailId: 0,
materialIds: [],
projectIds: [],
receiverIds: [],
receiverList: {
unions: [],
orgs: [],
users: [],
},
reportIds: [],
status: 1,
subject: '',
summaryIds: [],
summaryList: [],
tagKeyWords: [],
type: 2, // 类型为分享
kind: 0,
}
}
var receiverValidate = (rule, value, callback) => {
if (value.orgs.length == 0 && value.users.length == 0) {
callback(new Error())
} else {
callback()
}
}
export const shareRules = {
subject: [
{ required: true, message: '必填', trigger: 'blur' },
],
receiverList: [
{ validator: receiverValidate, message: '必填', trigger: 'change' },
],
content: [
{ required: true, message: '必填', trigger: 'blur' },
],
}
export const shareType = {
summary: {
ids: 'summaryIds',
list: 'summaryList',
name: '纪要',
},
material: {
ids: 'materialIds',
list: 'materialList',
name: '材料',
},
aptitude: {
ids: 'aptitudeIds',
list: 'aptitudeList',
name: '荣誉资质',
},
}
// 纠错
export function initWrongForm () {
return {
attachmentIds: [],
content: '',
emailId: 0,
materialIds: [],
projectIds: [],
receiverIds: [],
receiverList: {
unions: [],
orgs: [],
users: [],
},
reportIds: [],
status: 1,
subject: '',
summaryIds: [],
summaryList: [],
tagKeyWords: [],
type: 3, // 类型为纠错
kind: 0,
}
}
export const wrongRules = {
subject: [
{ required: true, message: '必填', trigger: 'blur' },
],
receiverIds: [
{ required: true, message: '必填', trigger: 'blur' },
],
content: [
{ required: true, message: '必填', trigger: 'blur' },
],
}
<file_sep>/src/views/tms/NameList/options.js
import { mergeByFirst } from '@/util/util'
const dictsMap = {
lockFlag: {
0: '启用',
1: '禁用',
},
sex: {
0: '男',
1: '女',
},
}
const initForm = () => {
return {
name: '',//姓名
idCard: '',//身份证号
image: '',//头像
sex: '',//性别
politicsValue: '',
marriageValue: '',
birthValue: '',
residentValue: '',
educationValue: '',
idCardFace: '',//身份证正面
idCardEmblem: '',//身份证国徽面
birthDate: '',//出生年月:
nation: '',//民族
politicsStatus: '',//政治面貌.
marriageStatus: '',//婚姻状况.
birthStatus: '',//生育状况.
residentType: '',//户口类别.
birthplaceProvince: '',//户籍所在省
birthplaceCity: '',//户籍所在市
residenceCities: '',//户籍地址
residenceAddress: '',
province: '',//家庭所在省
residence: [],
current: [],
city: '',//家庭所在市
currentCities: '',//家庭地址
currentAddress: '',
education: '',//最高学历
university: '',//毕业学校
qq: '',
major: '',
phone: '',//联系电话
graduateTime: '',//毕业时间
wechat: '',//微信
email: '',//邮箱
socialRela: '',//外部头衔
agency: '',//任职机构
job: '',
introduction: '',//机构简介
}
}
const columnsMap = [
{
prop: 'name',
label: '姓名',
},
{
prop: 'sex',
label: '性别',
type: 'dict',
},
{
prop: 'phone',
label: '联系电话',
},
{
prop: 'job',
label: '职称/职务',
},
{
prop: 'province',
label: '所属省',
},
{
prop: 'lockFlag',
label: '状态',
type: 'dict',
},
]
const columnsPendingMap = [
{
prop: 'name',
label: '机构名称',
},
{
prop: 'type',
label: '机构分类',
},
{
prop: 'province',
label: '所属省',
},
{
prop: 'industry',
label: '行业',
},
{
prop: 'time',
label: '申请时间',
},
{
prop: 'obj',
label: '申请对象',
},
]
const initSearchForm = () => {
return {
sex: '',
province: '',
currentParmas: [],
phone: '',
university: '',
lockFlag: '',
}
}
const formToDto = (row) => {
const newForm = mergeByFirst(initForm(), row)
newForm.province = row.current[0]
newForm.city = row.current[1]
newForm.birthplaceProvince = row.residence[0]
newForm.birthplaceCity = row.residence[1]
// newForm.positionId = row.position[row.position.length - 1]
// newForm.deptIds = row.dept.map(m => m.id)
return newForm
}
const rules = {
name: [{
required: true,
message: '请输入机构名称',
trigger: 'blur',
}],
type: [{
required: true,
message: '请输入机构分类',
trigger: 'blur',
}],
}
export { dictsMap, columnsPendingMap, columnsMap, initForm, initSearchForm, rules, formToDto }<file_sep>/src/views/crms/Customer/columns.js
const dictsMap = {
isContract: {
1: '是',
2: '否',
},
}
const columnsMapByTypeId = [
[
{
label: '区域类型',
prop: 'districtTypeName',
},
{
label: '客户关系',
prop: 'clientRelaName',
},
{
label: '市场经理',
prop: 'marketManagerName',
},
],
[
{
label: '区域类型',
prop: 'districtTypeName',
},
{
label: '客户关系',
prop: 'clientRelaName',
},
{
label: '签订合同',
prop: 'isContract',
type: 'dict',
},
],
[
{
label: '区域类型',
prop: 'districtTypeName',
},
{
label: '客户关系',
prop: 'clientRelaName',
},
{
label: '市场经理',
prop: 'marketManagerName',
},
{
label: '签订合同',
prop: 'isContract',
type: 'dict',
},
],
[
{
label: '区域类型',
prop: 'districtTypeName',
},
{
label: '客户关系',
prop: 'clientRelaName',
},
],
]
const tabList = [
{
label: '我的客户',
value: '2',
},
{
label: '协作客户',
value: '3',
},
{
label: '全部客户',
value: '1',
},
{
label: '公海库',
value: '4',
},
]
export { columnsMapByTypeId, tabList, dictsMap }
<file_sep>/src/views/hrms/DailyManagement/LeaveHoliday/options.js
// org config options
const dictsMap = {
startTime: {
1: '请假开始时间',
2: '出差开始时间',
3: '加班开始时间',
4: '入职时间',
5: '入职时间',
6: '入职时间',
},
endTime: {
1: '请假结束时间',
2: '出差结束时间',
3: '加班结束时间',
4: '转正时间',
5: '离职时间',
6: '调岗时间',
},
status: {
0: '未审核',
1: '通过',
2: '拒绝',
},
sStatus: {
1: '通过',
2: '拒绝',
},
}
const columnsMap = [
{
prop: 'applyType',
label: '申请类型',
},
{
prop: 'leavingType',
label: '请假类型',
},
{
prop: 'duration',
label: '时长',
},
{
prop: 'startTime',
label: '申请开始时间',
},
{
prop: 'endTime',
label: '申请结束时间',
},
{
prop: 'status',
label: '状态',
type: 'dict',
width: '90px',
},
]
const initForm = () => {
return {
'id': '', // ID
'name': '', // 申请人
'avatar': '', // 头像
'type': 1, //
'deptList': [], // 所属部门
'approverList': [],
'attachFile': [], // 附件
'createTime': '', // 创建时间
'startTime': '', // 开始时间(1:请假开始时间;2:出差开始时间;3:加班开始时间;4:入职时间;5:入职时间)
'endTime': '', // 结束时间(1:请假结束时间;2:出差结束时间;3:加班结束时间;4:转正时间;5:离职时间;6:调岗时间)
'job': '', // 职务
'title': '', // 职称
'reason': '', // 申请理由
'annex': '', // 附件
'status': 0,
'processList': [], // 申请流程
'cc': '', // 抄送人
'ccList': [], // 抄送人
'userId': '', // 抄送人
}
}
const initSearchForm = () => {
return {
name: '',
type: '',
status: '',
rangeTime: [],
}
}
const toDtoSearchForm = (row) => {
const newForm = { ...row }
newForm.startTime = newForm.rangeTime[0]
newForm.endTime = newForm.rangeTime[1]
delete newForm.rangeTime
return newForm
}
export { dictsMap, columnsMap, initForm, initSearchForm, toDtoSearchForm }
<file_sep>/src/views/fams/OrgAssets/OrganizationTransfer/options.js
// org config options
const dictsMap = {
isReward: {
1: '打赏',
2: '扣减',
},
}
const tabList = [
{
label: '转出',
value: 'outOrgId',
},
{
label: '转入',
value: 'inOrgId',
},
]
const colMap = {
'inOrgId': [
{
prop: 'outOrgName',
label: '转出组织',
},
{
prop: 'amount',
label: '金额',
},
{
prop: 'createTime',
label: '操作时间',
},
],
'outOrgId': [
{
prop: 'inOrgName',
label: '转入组织',
},
{
prop: 'amount',
label: '金额',
},
{
prop: 'createTime',
label: '操作时间',
},
],
}
const initForm = () => {
return {
id: '', // ID
amount: 0, // 打赏金额
remarks: '', // 打赏备注
orgId: '', // 打赏对象
}
}
const rules = {
amount: [
{ type: 'number', required: true, message: '输入的金额至少大于 0 元', trigger: 'blur', min: 0.01 },
],
orgId: [
{ required: true, message: '请选择组织', trigger: 'change' },
],
}
export { dictsMap, colMap, initForm, tabList, rules }
<file_sep>/src/views/wel/approval/approval/ExaminApproval/options.js
import { mergeByFirst } from '@/util/util'
const dictsMap = {
status: {
0: '待审核',
1: '审核通过',
2: '审核不通过',
},
}
const columnsMap = [
{
prop: 'applyType',
label: '申请类型',
},
{
prop: 'applyStartTime',
label: '发起时间',
width:'170',
},
]
const initForm = () => {
return {
name: '',
isOpen: false,
intro: '',
}
}
const initSearchForm = () => {
return {
name: '',
sex: '',
}
}
const initDeliverForm = () => {
return {
ids: [],
user: {
id: null,
name: null,
},
}
}
const dtoDeliverForm = () => {
return {
ids: [],
userId: null,
}
}
const toDeliverForm = (row) => {
const newForm = mergeByFirst(dtoDeliverForm(), row)
newForm.userId = row.user.id
return newForm
}
export { dictsMap, columnsMap, initForm, initSearchForm, initDeliverForm, dtoDeliverForm, toDeliverForm }<file_sep>/src/views/fams/FinancialManagement/IManagement/options.js
// import { mergeByFirst } from '@/util/util'
const dictsMap = {
incomeMode: {
'0': '库存现金',
'1': '银行存款',
},
}
const columnsMap = [
{
prop: 'createTime',
label: '时间',
type: 'date',
width: '150',
formatString: 'YYYY-MM-DD',
},
{
prop: 'amount',
label: '金额',
width: '80',
},
{
prop: 'typeValue',
label: '类型',
},
{
prop: 'orgName',
label: '组织',
type: 'detail',
},
{
prop: 'companyName',
label: '线下公司',
type: 'detail',
},
{
prop: 'incomeMode',
label: '收入方式',
type: 'dict',
},
{
prop: 'accountName',
label: '银行账户',
type: 'detail',
},
{
prop: 'remarks',
label: '备注',
},
]
const initForm = () => {
return {
type: [],
createTime: '',
orgId: '',
invoiceOrgId: '',
protocolId: '',
orgName: '',
expenditureId: '',
incomeMode: '0',
companyId: '',
accountId: '',
protocolName: '',
projectId: '',
projectName: '',
projectNumber: '',
serialNo: '', // serialNo 项目编号
amount: 0,
// invoiceAmount: 0,
remarks: '',
realName: '',
typeValue: '',
invoicingTax: '',
interestRate: '',
relations: [],
}
}
const initSearchForm = () => {
return {
rangeTime: [],
type: [],
companyName: '',
incomeMode: '',
bankAccount: '',
remarks: '',
}
}
const toDtoForm = (row) => {
const newForm = { ...row }
newForm.parentType = newForm.type[0]
newForm.type = newForm.type[1]
return newForm
}
const toDtoSearchForm = (row) => {
const newForm = { ...row }
newForm.startTime = row.rangeTime[0]
newForm.endTime = row.rangeTime[1]
delete newForm.rangeTime
newForm.type = newForm.type[1]
return newForm
}
const rules = {
type: [
{ required: true, type: 'array', message: '请输入收入类型', trigger: 'change' },
],
createTime: [
{ required: true, message: '请输入收入时间', trigger: 'blur' },
],
orgName: [
{ required: true, message: '请输入收入组织', trigger: 'blur' },
],
incomeMode: [
{ required: true, message: '请输入收入方式', trigger: 'blur' },
],
companyId: [
{ required: true, message: '请输入收入公司', trigger: 'change' },
],
accountId: [
{ required: true, message: '请输入银行户头', trigger: 'change' },
],
amount: [
{ required: true, message: '请输入支出金额', trigger: 'blur', type: 'number' },
],
}
const warningText = '和项目相关的收入/费用,请关联具体项目(未审核项目无法关联财务数据)'
export {
dictsMap,
columnsMap,
initForm,
toDtoForm,
rules,
warningText,
initSearchForm,
toDtoSearchForm,
}
<file_sep>/release.sh
#!/bin/bash
echo "Start Build New Release Branch!"
git reset --hard origin/develop \
&& git merge origin/feature/pg-big-data/dev \
&& git merge origin/feature/mcms/dev \
&& git merge origin/feature/tms/dev \
&& git merge origin/hotfix/org/dev
echo "Success!"<file_sep>/src/views/hrms/OrganizationalStructure/PostLibrary/PostType/options.js
const columnsMap = [
{
prop: 'name',
label: '岗位分类名称',
width: '300',
},
{
prop: 'description',
label: '分类说明',
},
]
const initForm = () => {
return {
id: '',
name: '',
description: '',
}
}
const initSearchForm = () => {
return {
name: '',
}
}
export { columnsMap, initForm, initSearchForm }
<file_sep>/src/util/text.js
export function timeFix () {
const time = new Date()
const hour = time.getHours()
return hour < 9 ? '早上好' : hour <= 11 ? '上午好' : hour <= 13 ? '中午好' : hour < 20 ? '下午好' : '晚上好'
}
export function welcome () {
const arr = ['智慧组织,遇见未来']
const index = Math.floor(Math.random() * arr.length)
return arr[index]
}
<file_sep>/src/api/hrms/excel.js
import request from '@/router/axios'
const prefixUrl = '/hrms'
// @/api/hrms/excel
export function postExcelExport (fileds) {
return request({
url: `${prefixUrl}/excel/export`,
method: 'post',
headers: {
'Content-Type': 'application/json',
},
responseType: 'arraybuffer',
data: fileds,
}).then(response => {
// 处理返回的文件流
const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' })
const link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = '导出信息.xls'
link.click()
})
}
export function postAppprovalExcelExport (query) {
return request({
url: `${prefixUrl}/excel/applic_export`,
method: 'post',
params: query,
headers: {
'Content-Type': 'application/json',
},
responseType: 'arraybuffer',
}).then(response => {
// 处理返回的文件流
const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' })
const link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = '导出信息.xls'
link.click()
})
}<file_sep>/src/views/wenjuan/components/govLayout/index.js
import GovLayoutBody from './body'
import GovLayoutButtonGroup from './buttonGroup'
import GovLayoutDialog from './dialog'
import GovLayoutForm from './form'
import GovLayoutHeader from './header'
import GovLayoutMain from './main'
export default { GovLayoutBody, GovLayoutButtonGroup, GovLayoutDialog, GovLayoutForm, GovLayoutHeader, GovLayoutMain }<file_sep>/src/api/hrms/employee_profile.js
import request from '@/router/axios'
const prefixUrl = '/hrms/employee_profile'
// @/api/hrms/employee_profile
export function getEmployeeProfilePage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function getEmployeeProfileById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function getEmployeeProfileSelf () {
return request({
url: `${prefixUrl}/self`,
method: 'get',
})
}
export function putEmployeeProfile (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function getGrowthFile (id) {
return request({
url: `${prefixUrl}/growth_file/${id}`,
method: 'get',
})
}
export function postInduction (obj) {
return request({
url: `${prefixUrl}/induction`,
method: 'post',
data: obj,
})
}
export function postPositive (obj) {
return request({
url: `${prefixUrl}/positive`,
method: 'post',
data: obj,
})
}
export function postDeparture (obj) {
return request({
url: `${prefixUrl}/departure`,
method: 'post',
data: obj,
})
}
export function postTransfer (obj) {
return request({
url: `${prefixUrl}/transfer`,
method: 'post',
data: obj,
})
}
export function getUserCard (id) {
return request({
url: `${prefixUrl}/userCard/${id}`,
method: 'get',
})
}
<file_sep>/src/views/wenjuan/mixins/dialog_mixins.js
import FormDialog from '@/components/form-dialog'
import PageDialog from '@/components/page-dialog'
export default {
data () {
return {
dialogShow: false,
}
},
components: { FormDialog, PageDialog },
methods: {
handleDialogClose (val) {
this.dialogShow = val
},
},
}
<file_sep>/src/views/fams/GroupFinance/ProjectAccounting/options.js
import { getYear } from '@/util/date'
const rules = {
orgId: [
{ required: true, message: '请选择组织', trigger: 'blur' },
],
businessDate: [
{ required: true, message: '请选择日期', trigger: 'blur' },
],
amount: [
{ type: 'number', required: true, message: '请输入日期', trigger: 'blur' },
],
}
const columnsMap = [
{
prop: 'orgName',
label: '组织名称',
width:'150',
},
{
prop: 'amount',
label: '业务指标(元)',
},
{
prop: 'projectAmount',
label: '项目金额',
},
{
prop: 'contractAmount',
label: '合同金额',
},
{
prop: 'projectAmount',
label: '待签金额',
},
{
prop: 'projectIncome',
label: '到账金额',
},
{
prop: 'invoicingAmount',
label: '开票金额',
},
]
function initForm () {
return {
year: '',
amount: '',
}
}
const initSearchForm = () => {
return {
orgName: '',
businessYear: '',
}
}
const toDtoSearchForm = (row) => {
const newForm = { ...row }
newForm.businessYear = getYear(row.businessYear) || null
return newForm
}
const toDtoForm = (row) => {
const newForm = { ...row }
newForm.year = getYear(row.year) || null
return newForm
}
export { columnsMap, initForm, toDtoForm, initSearchForm, toDtoSearchForm, rules }<file_sep>/src/api/fams/balance_rule.js
import request from '@/router/axios'
const prefixUrl = '/fams/balance_rule'
// @/api/fams/balance_rule
export function addBellBalanceRule () {
return request({
url: `${prefixUrl}/login/bell/add`,
method: 'get',
})
}
export function addBellBalanceRuleByNumber (number) {
return request({
url: `${prefixUrl}/bell/add/${number}`,
method: 'get',
})
}
export function getBellBalancePage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function getBlockChainRulePage (query) {
return request({
url: `${prefixUrl}/block_chain/page`,
method: 'get',
params: query,
})
}
export function getBellBalancePageById (id) {
return function (query) {
return request({
url: `${prefixUrl}/page/${id}`,
method: 'get',
params: query,
})
}
}
export function getBlockChainRuleById (id) {
return function (query) {
return request({
url: `${prefixUrl}/block_chain/page/${id}`,
method: 'get',
params: query,
})
}
}
export function getBellBalanceById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function putBellBalance (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
<file_sep>/src/views/admin/token/options.js
// org config options
const columnsMap = [
{
label: '用户ID',
prop: 'user_id',
align: 'center',
width:'100px',
},
{
label: '用户名',
prop: 'username',
align: 'center',
},
{
label: '令牌',
prop: 'access_token',
align: 'center',
overHidden: true,
width:'350px',
},
{
label: '类型',
prop: 'token_type',
align: 'center',
},
{
label: '过期时间',
prop: 'expires_in',
align: 'center',
},
]
const initForm = () => {
return {
access_token: '',
createTime: '',
refresh_token: '',
username: '',
token_type: '',
expires_in: '',
}
}
export { columnsMap, initForm }<file_sep>/src/util/rules.js
const checkContactUser = (label) => {
return function (rule, value, callback) {
if (!value.id) {
return callback(new Error(`${label}不能为空`))
}
callback()
}
}
const checkContactUsers = (label) => {
return function (rule, value, callback) {
if (!value.length) {
return callback(new Error(`${label}不能为空`))
}
callback()
}
}
const checkContact = (label) => {
return function (rule, value, callback) {
if (!value.orgs.length && !value.unions.length &&!value.users.length) {
return callback(new Error(`${label}不能为空`))
}
callback()
}
}
export { checkContactUser, checkContactUsers, checkContact }<file_sep>/src/api/tms/function.js
import request from '@/router/axios'
const prefixUrl = '/tms'
// @/api/tms/function
export function getTagFunctionList () {
return request({
url: `${prefixUrl}/function/list`,
method: 'get',
})
}
export function getTagFunctionMap () {
return request({
url: `${prefixUrl}/function/map`,
method: 'get',
})
}
export function postTagFunction (obj) {
return request({
url: `${prefixUrl}/function/create`,
method: 'post',
data: obj,
})
}
export function putTagFunction (obj) {
return request({
url: `${prefixUrl}/function/update`,
method: 'post',
data: obj,
})
}
export function deleteTagById (id) {
return request({
url: `${prefixUrl}/function/delete/${id}`,
method: 'post',
})
}
export function enableTagFunction (id) {
return request({
url: `${prefixUrl}/function/update_enable/${id}`,
method: 'post',
})
}
<file_sep>/src/views/govdata/policyManage/multiply_mixin.js
export default {
methods: {
/**
* 字符串转数组
* @param str {string}
* @return {number[]} This is the result
*/
decodeSplitStr (str) {
if (!str) {
return []
}
let strArr = str.split(',')
return strArr.filter(m => {
return m !== ''
})
},
/**
* 数组转字符串
* @param arr {number[]} This is the result
* @return {string}
*/
encodeSplitStr (arr) {
if (!arr) {
return ''
}
return arr.join(',') === '' ? '' : arr.join(',') + ','
},
},
}
<file_sep>/src/views/fams/OrgAssets/OrgProfitAndLoss/options.js
const columnsMap = [
{
prop: 'month',
label: '月份',
width: '55',
},
{
prop: 'orgName',
label: '组织名称',
width: '250',
},
{
prop: 'contractAmount',
label: '合同金额',
},
]
export { columnsMap }<file_sep>/src/api/admin/version.js
import request from '@/router/axios'
const prefixUrl = '/admin/version'
export function getVersionPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function getVersionById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function getVersionTree () {
return request({
url: `${prefixUrl}/tree`,
method: 'get',
})
}
export function postVersion (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function putVersion (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function deleteVersionById (id) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: [id],
})
}
<file_sep>/src/core/editor_use.js
// Import and use Vue Froala lib.
import Vue from 'vue'
import VueFroala from 'vue-froala-wysiwyg'
require('font-awesome/css/font-awesome.min.css')//此处可在index.html中引入:font-awesome cdn地址:<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
Vue.use(VueFroala)
<file_sep>/src/views/thought/follow/option.js
export const tableOption = [
{
label: 'ID',
prop: 'id',
}, {
label: '姓名',
prop: 'name',
}, {
label: '组织',
prop: 'orgName',
},
]
export const dictsMap = {
topicType: {
'1': '普通话题',
'2': '专项话题',
},
}<file_sep>/src/views/gpms/project/Total/const.js
import { getStore } from '@/util/store'
import { checkProjectName } from '@/api/gpms/index'
const dicData = getStore({ name: 'dictGroup' })
function changeDict (list) {
let data = {}
for (let item of list) {
data[item.value] = item.label
}
return data
}
export const dictMap = {
is_yes: [
{ value: 1, label: '是' },
{ value: 2, label: '否' },
],
projectStatus: {
1:'待提交',2:'待审核',3:'已立项',4:'审核未通过',5:'锁定',
},
projectStage: changeDict(dicData.prms_project_stage),
stageOptions: [],
typeOptions: [
{ id: 1, value: '1', label: '类型一' },
],
workTypeOne: [
{ id: 1, value: '1', label: '类型一' },
],
bustypeOptions: [],
isRelevOptions: [],
undertakeOptions: [],
}
export const columnsMap = [
// {
// prop: 'projectTime',
// label: '立项时间',
// },
]
let intValidate = (rule, value, callback) => {
if (/^[1-9]*[1-9][0-9]*$/.test(value) || value === '') {
callback()
} else {
callback(new Error())
}
}
var timeout = null
var checkName = (rule, value, callback) => {
if (!value) {
return callback(new Error('项目名称不能为空'))
}
if(timeout !== null)
clearTimeout(timeout)
timeout = setTimeout(() => {
checkProjectName({projectName:value}).then(res => {
if (res.data.data === false) {
return callback(new Error(res.data.msg))
}
else {
callback()
}
})
}, 1000)
}
export const rules = {
projectType: [
{ required: true, message: '请选择项目类型', trigger: 'blur' },
],
projectName: [
{ validator: checkName, required: true, trigger: 'change' },
],
projectTime: [
{ required: true, message: '请选择立项时间', trigger: 'blur' },
],
relatedClient: [
{ required: true, message: '请输入相关客户', trigger: 'change' },
],
projectTagList: [
{ required: true, message: '请输入项目标签', trigger: 'change' },
],
projectStage: [
{ required: true, message: '请选择项目阶段', trigger: 'change' },
],
projectBudget: [
{ validator: intValidate, message: '请输入正整数', trigger: 'change' },
],
isRelevanceProduct: [
{ required: true, message: '请选择是否关联产品', trigger: 'change' },
],
notRelevanceProductReason: [
{ required: true, message: '请输入未关联产品理由', trigger: 'blur' },
],
}
export function paramForm () {
return {
name: '',//项目名称
stage: '',//项目阶段
protype: '',//项目类型
bustype: '',//业务类型
budget:{
num1 : null,
num2 : null,
},//项目预算
pact: {
num1:null,
num2:null,
},//合同金额
manager: '',//市场经理
guide: '',//项目指导
relevancy: '',//关联产品
carry: '',//承接部门
join: '',//合作部门
time:{
opentime:null,
closetime:null,
},
issue: '',//发布人
}
}
export function initFormData (obj) {
const name = obj ? obj.realName : ''
const id = obj ? obj.userId : ''
return {
projectTime:'',//立项时间
projectStatus:'',//项目状态
projectName: '', // 项目名称
projectExplain: '',//项目说明
projectTypeBefore: '', // 项目类型
projectType: '', // 项目类型
businessType: '', // 业务类型
businessTypeSec: '', // 其他
projectLevel: '',//项目等级
attendeeId:'',//委托组织
relatedClient: '', // 相关客户
relatedClientList: {
id: '',
name: '',
},
projectBudget: '', // 项目预算
approvalTime:'',//立项时间
applyTime:'',//审批时间
endTime:'',
projectManager:'',// 项目经理
projectManagerList:{
id,
name,
},// 项目经理
projectHandles:'',// 协作负责人
projectHandlesList:[],
memberList: [], // 项目成员
membersList: [],
mktManager: '', // 市场经理
marketManagerList:[],
mktManagerList: [],
projectMentor: '', // 项目指导人
mentorList:[],
projectMentorList: [],
projectTagList: [], // 项目标签
isRelevanceProduct: '', // 是否关联产品
notRelevanceProductReason: '', // 不关联理由
inChargeDept: '', // 承接部门
inChargeDeptList: {},
initFormData:{},// 项目等级
coopDept: '', // 合作部门
coopDeptList: {},
groupExternalCooperatePartner: '', // 集团外部合作伙伴
groupExternalCooperatePartnerList: { id: '', name: '' },
productIds: [], // 产品
productList: [],
summaryIds: [], // 纪要
summaryList: [],
materialIds: [], // 材料
materialList: [],
contractIds: [], // 合同
contractAmount: '',//合同金额
contractList: [],
projectIds: [], // 项目
projectList: [],
reportIds: [], // 周报
reportList: [],
paymentRelations: [], // 预计回款时间,
estimatedSigntime: '', // 预计签订时间
projectBudgetList: {},
projectAmount: 0,
projectStage: '',
orgId:'',
isClaim: 1,
isOpen:3,
}
}
export const relatedFormList = [{
name: '关联的纪要',
ids: 'summaryIds',
list: 'summaryList',
}, {
name: '关联的材料',
ids: 'materialIds',
list: 'materialList',
// }, {
// name: '关联的合同'
// ids: 'contractIds',
// list: 'contractList',
// }, {
// name: '关联的项目',
// ids: 'projectIds',
// list: 'projectList',
}, {
name: '关联的项目周报',
ids: 'reportIds',
list: 'reportList',
},
]
export const initSearchForm = () => {
return {
projectName: '',//项目名称
orgId:'',//所属组织
projectStage: [],//项目阶段
projectLevel: [],//项目等级
isRelevanceProduct: '',//是否项目关联
manager: '',//项目经理
}
}
// 项目预算
export const initBudgetForm = () => {
return {
artificialCost: '', // 人工成本
projectCommission: '', // 项目提成
taxes: '', // 税费
bidWinning: '', // 中标服务费
outsourcingCost: '', // 外包费用(必填)
commission: '', // 佣金(必填)
expertsFee: '', // 项目评审专家费
otherFees: '', //其他
managementFee: '', // 项目管理费
invoiceFee: '', // 开票费用
travelFee: '', // 差旅费
projectBudget: '', // 项目总预算(必填)
forecastProfits: '', // 预估利润
}
}
export function initTransferForm () {
return {
name:'',
projectManagerList:{
id: '',
name: '',
},
pubilsh:false,
}
}<file_sep>/src/views/conm/StationGroupManagement/options.js
const dictsMap = {
status: {
0: '禁用',
1: '正常',
},
}
const initForm = () => {
return {
parentId: '',//上级站点
// orgId: '',//组织
siteName: '',//名称
url: '',//域名
manageList: [],//管理员
// manageVoList: [],
mobileUrl: '',//手机端域名
status: 1,//状态
}
}
const columnsMap = [
{
prop: 'url',
label: '域名',
},
// {
// prop: 'orgId',
// label: '组织',
// },
{
prop: 'mobileUrl',
label: '手机端域名',
},
{
prop: 'status',
label: '状态',
type: 'dict',
},
]
const initSearchForm = () => {
return {
}
}
const rules = {
siteName: [{
required: true,
message: '请输入站点名称',
trigger: 'blur',
}],
}
const selfRules = {
...rules,
}
export { dictsMap, columnsMap, initForm, initSearchForm, rules, selfRules }<file_sep>/src/store/modules/common.js
import { getStore, setStore } from '@/util/store'
import website from '@/const/website'
const common = {
state: {
isCollapse: false,
screen: -1,
windowSize: { width: 0, height: 0 },
isWelcome: getStore({ name: 'isWelcome' }) || false,
isLock: getStore({ name: 'isLock' }) || false,
showCollapse: getStore({ name: 'showCollapse' }) || false,
showSearch: getStore({ name: 'showSearch' }) || false,
showMenu: getStore({ name: 'showMenu' }) || false,
showMoney: getStore({ name: 'showMoney' }) || false,
website: website,
},
actions: {},
mutations: {
SET_WELCOME: state => {
state.isWelcome = !state.isWelcome
setStore({
name: 'isWelcome',
content: state.isWelcome,
})
},
SET_COLLAPSE: state => {
state.isCollapse = !state.isCollapse
},
SET_SHOWCOLLAPSE: (state, active) => {
state.showCollapse = active
setStore({
name: 'showCollapse',
content: state.showCollapse,
})
},
SET_SHOWMENU: (state, active) => {
state.showMenu = active
setStore({
name: 'showMenu',
content: state.showMenu,
})
},
SET_SHOWMONEY: (state, active) => {
state.showMoney = active
setStore({
name: 'showMoney',
content: state.showMoney,
})
},
SET_SHOWSEARCH: (state, active) => {
state.showSearch = active
setStore({
name: 'showSearch',
content: state.showSearch,
})
},
SET_SCREEN: (state, screen) => {
state.screen = screen
},
SET_WINDOWSIZE: (state, size) => {
state.windowSize = size
},
},
}
export default common
<file_sep>/src/views/hrms/OrganizationalStructure/PostLibrary/PostLibrary/options.js
const columnsMap = [
{
prop: 'name',
label: '岗位名称',
},
{
prop: 'typeName',
label: '岗位分类',
width:'100',
},
{
prop: 'count',
label: '在职人数',
width:'100',
},
]
const initForm = () => {
return {
id: '',
name: '',
typeName: '',
typeId: '',
count: '',
duties: '',
claim: '',
}
}
const initSearchForm = () => {
return {
typeId: null,
}
}
export { columnsMap, initForm, initSearchForm }
<file_sep>/src/views/goms/BasicConfiguration/OrganizationInformation/Memorabilia/options.js
const dictsMap = {
status: {
0: '正常',
1: '待审核',
2: '锁定',
3: '待配置',
},
}
const columnsMap = [
{
prop: 'title',
label: '标题',
width: 400,
},
{
prop: 'creator',
label: '发布人',
},
{
prop: 'happenTime',
label: '发布时间',
},
]
const initForm = () => {
return {
id: '',
title: '',
happenTime: '',
content: '',
}
}
const rules = {
title: [
{ required: true, message: '请输入标题', trigger: 'change' },
],
happenTime: [
{ required: true, message: '请选择日期', trigger: 'change' },
],
content: [
{ required: true, message: '请填写详细内容', trigger: 'change' },
],
}
export { dictsMap, columnsMap, initForm, rules }
<file_sep>/src/views/mlms/material/report/util.js
// let todayDate = '2019, 01, 01 00:00:01'
// 根据距离当前日的天数获取年月日
export function getDays (day) {
let today = new Date()
let targetday_milliseconds=today.getTime() + 1000*60*60*24*day
today.setTime(targetday_milliseconds) //注意,这行是关键代码
let tYear = today.getFullYear()
let tMonth = today.getMonth()
let tDate = today.getDate()
tMonth = doHandleMonth(tMonth + 1)
tDate = doHandleMonth(tDate)
return {
year: tYear,
month: tMonth,
day: tDate,
tMonth: today.getMonth(),
tDay: today.getDate(),
}
}
// 获取今天的时间 YYYY-MM-DD HH:MM:SS
export function getDate (day) {
let myDate = new Date()
let obj = getDays(day)
return obj.year + '-' + obj.month + '-' + obj.day + ' ' + myDate.getHours() + '-' + myDate.getMinutes() + '-' + myDate.getSeconds()
}
// 根据参数获取时间 YYYY-MM-DD HH:MM:SS
export function getDateStr (day) {
let myDate = new Date(day)
return myDate.getFullYear() + '-' + formatDig(myDate.getMonth() + 1) + '-' + formatDig(myDate.getDate()) + ' ' + formatDig(myDate.getHours()) + ':' + formatDig(myDate.getMinutes()) + ':' + formatDig(myDate.getSeconds())
}
function doHandleMonth (month){
let m = month
if(month.toString().length == 1){
m = '0' + month
}
return m
}
// 今天是第几周 -- 月
export function getWeekOfMonth (date) {
let today = ''
if (date) {
today = new Date(`${formatYear(date)} 00:00:00`)
} else {
today = new Date()
}
let firstDay = new Date(today.getFullYear(), today.getMonth(), 1)
let dayOfWeek = firstDay.getDay()
let spendDay = 0
if (dayOfWeek != 1) {
spendDay = 7 - dayOfWeek + 1
}
firstDay = new Date(today.getFullYear(), today.getMonth(), 1 + spendDay)
let d = Math.ceil((today.valueOf() - firstDay.valueOf()) / 86400000)
let result = Math.ceil(d / 7)
return result
};
// 今天是第几周 -- 年(从第一天开始算,加上去年的最后一周)
export function getWeekOfYear (year, month, day) {
let today = ''
if (year) {
today = new Date(year, month, day)
} else {
today = new Date()
}
let firstDay = new Date(today.getFullYear(), 0, 1)
let dayOfWeek = firstDay.getDay()
let spendDay = 1
if (dayOfWeek != 0) {
spendDay = 7 - dayOfWeek + 1
}
firstDay = new Date(today.getFullYear(), 0, 1 + spendDay)
let d = Math.ceil((today.valueOf() - firstDay.valueOf()) / 86400000)
let result = Math.ceil(d / 7)
return result
};
// 获取月份
function getMonth (month) {
var y = new Date(month)
return y.getMonth()
}
// 月份日期前一位补0
export function formatDig (num) {
return num>9?''+num:'0'+num
}
// 根据传入的时间,返回 MM-DD
function formatDate (mill){
var y = new Date(mill)
let raws = [
// y.getFullYear(),
formatDig(y.getMonth() + 1),
formatDig(y.getDate()),
// y.getDay() || 7,
]
let format = ['-','-']
return String.raw({raw:raws}, ...format)
}
// 根据传入的时间,返回YYYY-MM-DD
export function formatYear (mill){
var y = new Date(mill)
let raws = [
y.getFullYear(),
formatDig(y.getMonth() + 1),
formatDig(y.getDate()),
// y.getDay() || 7,
]
let format = ['-','-','-']
return String.raw({raw:raws}, ...format)
}
// 数字转中文
export function toChinesNum (num) {
let changeNum = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九']
let unit = ['', '十', '百', '千', '万']
num = parseInt(num)
let getWan = (temp) => {
let strArr = temp.toString().split('').reverse()
let newNum = ''
for (var i = 0; i < strArr.length; i++) {
newNum = (i == 0 && strArr[i] == 0 ? '' : (i > 0 && strArr[i] == 0 && strArr[i - 1] == 0 ? '' : changeNum[strArr[i]] + (strArr[i] == 0 ? unit[0] : unit[i]))) + newNum
}
return newNum
}
let overWan = Math.floor(num / 10000)
let noWan = num % 10000
if (noWan.toString().length < 4) noWan = '0' + noWan
return overWan ? getWan(overWan) + '万' + getWan(noWan) : getWan(num)
}
// 获取全年的周数
export function createWeeks (year, type = ''){
// let arr = [{ year: `${year}` }]
let arr = []
let index = 1
const ONE_DAY = 24 * 3600 * 1000
// 首先计算第一个礼拜一的日期,从这一天开始计算星期
var da = new Date(year, 0, 1)
var n = 7 - (da.getDay() + 6) % 7
if (n == 7) {
n = 0
}
let start = new Date(year, 0, 1+n),
end = new Date(year, 11, 31)
let firstDay = start.getDay() || 7
// lastDay = end.getDay() || 7
let startTime=+start,
endTime = startTime + (7 - firstDay) * ONE_DAY,
// _endTime = end - (7 - lastDay) * ONE_DAY
_endTime = end
let mIndex = 0
let obj = {
index: index,
month: getMonth(startTime),
startTime: formatDate(startTime),
endTime: formatDate(endTime),
title: '第'+toChinesNum(index)+'周',
timeStamp: +startTime,
}
let mObj = {
date: '1月',
time: `${year}-${formatDig(mIndex+1)}`,
timeStamp: (+new Date(year, mIndex, 1)),
children: [],
title: `1月${type}月报`,
}
mObj.children.unshift(obj)
index++
startTime = endTime + ONE_DAY
endTime = endTime + 7 * ONE_DAY
while (endTime < _endTime) {
obj = {
index: index,
month: getMonth(startTime),
startTime: formatDate(startTime),
endTime: formatDate(endTime),
title: '第'+toChinesNum(index)+'周',
timeStamp: +startTime,
}
// 若月份变大,首先将原有的月份对象放入数组中,再重新生成新月份
if (mIndex < obj.month) {
arr.unshift(mObj)
++mIndex
mObj = {
date: `${mIndex+1}月`,
time: `${year}-${formatDig(mIndex+1)}`,
timeStamp: (+new Date(year, mIndex, 1)),
children: [],
title: `${mIndex+1}月${type}月报`,
}
}
mObj.children.unshift(obj)
index++
startTime = endTime + ONE_DAY
endTime = endTime + 7 * ONE_DAY
}
// 最后一个月,需要计算最后一天是哪一天,进行补全
let lastN = 6 - ((new Date(startTime)).getDay() + 6) % 7
if (lastN > 0) {
// 若为0,则不需要补全,不为0年份加一,月份为0
end = new Date(year+1, 0, lastN)
}
mObj.children.unshift({
index: index,
month: getMonth(startTime),
startTime: formatDate(startTime),
endTime: formatDate(+end),
title: '第'+toChinesNum(index)+'周',
timeStamp: +startTime,
})
arr.unshift(mObj)
arr.unshift({ year: `${year}` })
index++
return arr
}
// 根据传入的时间,获取到这个星期的起始时间和结束时间 MM-DD
export function getWeekStartAndEnd (day) {
let date = new Date(day)
let today = date.getDay()
let firstDay = +new Date(+date - (today-1)*24*3600*1000)
let lastDay = firstDay + 6*24*3600*1000
return {
startTime: formatDate(firstDay),
endTime: formatDate(lastDay),
startYear: formatYear(firstDay),
endYear: formatYear(lastDay),
}
}
// 根据传入的时间获取周一
export function getMonday (date) {
let today = new Date(formatYear(date))
// let index = today.getDay() - 1
let index = today.getDay() == 0 ? 6 : today.getDay() - 1
let monday = new Date(+today - index*24*3600*1000)
return {
timeStamp: +monday,
time: formatYear(monday),
}
}
// 返回当前月和周的排序 - 倒叙
export function getDateObj (row, date) {
let day = +date
let month = date.getMonth() + 1
let week = 0
let list = row[13 - month]
// 两种情况,首先上个月的周报,timeStamp 应该是小于这个月最小的周的时间戳
for (let item of list.children) {
// 判断现在的时候距离这个礼拜的周一相差在一周之内
// if (day > item.timeStamp+7*24*3600*1000) {
// 因为是倒叙获取的,所以判断的应该是比第一天小
if (day < item.timeStamp) {
week++
} else {
if (week == 0) {
// 上个月的最后一周
if (month == 1) { // 上个月是去年的12月
return { month: (13 - 12), week: 0 }
} else { // 普通的月份,即上个月
return { month: (13 - month), week: 0 }
}
} else {
return { month: (13 - month), week }
}
}
}
return { month: (13 - month), week }
}
/**
* 日期格式化
*/
export function dateFormat (DATE, format = 'yyyy-MM-dd') {
if (!DATE) return ''
let date = new Date(DATE)
// let format = 'yyyy-MM-dd hh:mm:ss'
if (date.getFullYear()) {
var o = {
'M+': date.getMonth() + 1, // month
'd+': date.getDate(), // day
'h+': date.getHours(), // hour
'm+': date.getMinutes(), // minute
's+': date.getSeconds(), // second
'q+': Math.floor((date.getMonth() + 3) / 3), // quarter
'S': date.getMilliseconds(), // millisecond
}
if (/(y+)/.test(format)) {
format = format.replace(RegExp.$1,
(date.getFullYear() + '').substr(4 - RegExp.$1.length))
}
for (var k in o) {
if (new RegExp('(' + k + ')').test(format)) {
format = format.replace(RegExp.$1,
RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length))
}
}
return format
}
return ''
}
<file_sep>/src/views/wel/approval/initiate/options.js
import { mergeByFirst } from '@/util/util'
// org config options
const dictsMap = {
approveResult: {
0: '未审核',
1: '通过',
2: '拒绝',
},
}
const columnsMap = [
{
prop: 'applyType',
label: '申请类型',
},
{
prop: 'applyStartTime',
label: '发起时间',
width:'170',
},
{
prop: 'applyEndTime',
label: '审批时间',
width:'170',
},
]
const initForm = () => {
return {
name: '',//申请人
applyStartTime: '',//发起时间
entryTime: '',//入职时间
departureTime: '',//离职时间
positionId: '', // 岗位 positionName
// positionName: '', // 岗位 positionName
deptId: '', // 所属部门 deptnName
// deptName: '', // 所属部门 deptnName
reason: '',//理由
annex: '',//附件
approver: '',//审批人
copyPerson: '',//抄送人
job: '',//职务
title: '',//职称
becomeTime: '',//转正时间
startTime: '',//开始时间
endTime: '',//结束时间
overtime: '',//加班时长
businessTime: '',//出差时长
businessPlace: '',//出差地点
leavingType: '',//请假类型
leavingTime: '',//请假时长
transferTime: '',//调岗时间
isOpen: false,
intro: '',
}
}
const initDtoForm = () => {
return {
name: '',//申请人
applyStartTime: '',//发起时间
entryTime: '',//入职时间
departureTime: '',//离职时间
positionId: '', // 岗位 positionName
// positionName: '', // 岗位 positionName
deptId: '', // 所属部门 deptnName
// deptName: '', // 所属部门 deptnName
reason: '',//理由
annex: '',//附件
approver: '',//审批人
copyPerson: '',//抄送人
job: '',//职务
title: '',//职称
becomeTime: '',//转正时间
startTime: '',//开始时间
endTime: '',//结束时间
overtime: '',//加班时长
businessTime: '',//出差时长
businessPlace: '',//出差地点
leavingType: '',//请假类型
leavingTime: '',//请假时长
transferTime: '',//调岗时间
isOpen: false,
intro: '',
}
}
const formToDto = (row) => {
const newForm = mergeByFirst(initDtoForm(), row)
newForm.positionId = row.position[row.position.length - 1]
newForm.deptId = row.dept[row.dept.length - 1]
return newForm
}
const initSearchForm = () => {
return {
name: '',
sex: '',
}
}
export { dictsMap, columnsMap, initForm, formToDto, initSearchForm }<file_sep>/src/core/components_use.js
import Vue from 'vue'
// TODO:容器Container 统一改为 Iep前缀
import BasicContainer from '@/components/BasicContainer/index'
import BasicAsideContainer from '@/components/BasicAsideContainer/index'
import IepLayoutDrawerContainer from '@/components/IepLayout/DrawerContainer/index'
import OperationWrapper from '@/components/Operation/Wrapper'
import OperationSearch from '@/components/Operation/Search'
import OperationContainer from '@/components/Operation/Container'
import IepPageHeader from '@/components/IepCommon/PageHeader'
import FooterToolBar from '@/components/FooterToolbar'
import IepResult from '@/components/IepResult/index'
// 富文本
// import IepEditor from '@/components/IepEditor/'
import IepFroalaEditor from '@/components/IepFroalaEditor/'
import IepHtml from '@/components/IepHtml/'
// 公共组件
import IepPagination from '@/components/IepCommon/Pagination'
import IepTabs from '@/components/IepCommon/Tabs'
import IepTabScroll from '@/components/IepTabScroll/'
import IepNoData from '@/components/IepCommon/NoData'
import IepToDev from '@/components/IepToDev/'
import IepTip from '@/components/IepCommon/Tip'
import IepIdentityMark from '@/components/IepCommon/IdentityMark'
import IepReadMarkDel from '@/components/IepCommon/ReadMarkDel'
import IepFiveKay from '@/components/IepCommon/FiveKey'
import IepKeyItem from '@/components/IepCommon/KeyItem'
import IepUserCard from '@/components/IepCommon/UserCard'
import IepCharts from '@/components/IepCommon/ECharts'
import IepStatisticsHeader from '@/components/IepCommon/StatisticsHeader'
import IepSlotCard from '@/components/IepCommon/SlotCard'
import IepIsOpen from '@/components/IepCommon/IsOpen'
// 表单组件
import IepTag from '@/components/IepTag'
import IepNewTag from '@/components/IepTag/newIndex'
import IepSelect from '@/components/IepForm/Select'
import IepSelectDetail from '@/components/IepForm/SelectDetail'
import IepDatePicker from '@/components/IepForm/DatePicker'
import IepCascader from '@/components/IepForm/Cascader'
import IepDictDetail from '@/components/IepForm/DictDetail'
import IepDictSelect from '@/components/IepForm/DictSelect'
import IepDictCascader from '@/components/IepForm/DictCascader'
import IepDictCascaderDetail from '@/components/IepForm/DictCascaderDetail'
import IepDescriptionItem from '@/components/IepForm/DescriptionItem'
import IepTagDetail from '@/components/IepForm/TagDetail'
import IepDivDetail from '@/components/IepForm/DivDetail'
import IepDivDetailSwitch from '@/components/IepForm/DivDetailSwitch'
import IepDateRangeSelect from '@/components/IepForm/DateRangeSelect'
import IepFormItem from '@/components/IepForm/FormItem'
import IepCrmsSelect from '@/components/IepForm/CrmsSelect'
import IepCrmsSelectMultiple from '@/components/IepForm/CrmsSelectMultiple'
// input
import IepInputAmount from '@/components/IepInput/InputAmount'
import IepInputNumber from '@/components/IepInput/InputNumber'
import IepInputArea from '@/components/IepInput/InputArea'
import IepAntInput from '@/components/IepInput/AntInput'
// 头像上传文件有关组件
import IepAvatar from '@/components/IepUpload/Avatar'
import IepImgAvatar from '@/components/IepImg/ImgAvatar'
import IepImg from '@/components/IepImg/index'
import IepUpload from '@/components/IepUpload/index'
import IepDownload from '@/components/IepUpload/Download'
import IepUploadSelect from '@/components/IepUpload/Select'
import IepUploadDialog from '@/components/IepUpload/Dialog'
// 弹出层相关组件
import IepDialog from '@/components/IepDialog/'
import IepADialog from '@/components/IepDialog/ADialog'
import IepDrawer from '@/components/IepDrawer/'
import IepHoverCard from '@/components/IepCommon/HoverCard'
import IepReviewConfirm from '@/components/IepCommon/ReviewConfirm'
import IepImageDialog from '@/components/IepCommon/ImageDialog'
// 投资弹框
import IepEquityDialog from '@/components/IepCommon/EquityDialog'
// 表格相关组件
import IepTable from '@/components/IepTable/'
import IepTableLink from '@/components/IepTable/Link'
import IepTableLinkImgDesc from '@/components/IepTable/LinkImgDesc'
// 通讯录组件Contact
import IepContactSelect from '@/components/IepContact/Select'
import IepContactMultiple from '@/components/IepContact/Multiple'
import IepContactMultipleUser from '@/components/IepContact/MultipleUser'
// 部门组件Contact
import IepDeptSelect from '@/components/IepDept/Select'
import IepDeptMultiple from '@/components/IepDept/Multiple'
// 合同组件Contact
import IepContractSelect from '@/components/IepContract/Select'
// 项目
import IepProjectSelect from '@/components/IepProject/Select'
//任务
import IepTaskAtmsSelect from '@/components/IepTask/atmsSelect'
// 展示页公共组件
import IepAppTabCard from '@/components/IepApp/TabCard'
import IepAppTabsCard from '@/components/IepApp/TabsCard'
import IepAppFooterBar from '@/components/IepApp/FooterBar'
import IepAppLayout from '@/components/IepApp/Layout'
import IepAppListCard from '@/components/IepApp/ListCard'
import IepAppRankingCard from '@/components/IepApp/RankingCard'
import IepAppLabelCard from '@/components/IepApp/LabelCard'
import IepAppAssortCard from '@/components/IepApp/AssortCard'
import IepAppRewardCard from '@/components/IepApp/RewardCard'
import IepAppEvaluationReview from '@/components/IepApp/EvaluationReview'
import IepAppEvaluationReviews from '@/components/IepApp/EvaluationReviews'
// 注册全局容器
Vue.component(BasicContainer.name, BasicContainer)
Vue.component(BasicAsideContainer.name, BasicAsideContainer)
Vue.component(IepLayoutDrawerContainer.name, IepLayoutDrawerContainer)
Vue.component(OperationWrapper.name, OperationWrapper)
Vue.component(OperationContainer.name, OperationContainer)
Vue.component(OperationSearch.name, OperationSearch)
Vue.component(IepPageHeader.name, IepPageHeader)
Vue.component(FooterToolBar.name, FooterToolBar)
Vue.component(IepResult.name, IepResult)
//富文本
// Vue.component(IepEditor.name, IepEditor)
Vue.component(IepFroalaEditor.name, IepFroalaEditor)
Vue.component(IepHtml.name, IepHtml)
// 公共组件
Vue.component(IepPagination.name, IepPagination)
Vue.component(IepTabs.name, IepTabs)
Vue.component(IepTabScroll.name, IepTabScroll)
Vue.component(IepNoData.name, IepNoData)
Vue.component(IepToDev.name, IepToDev)
Vue.component(IepTip.name, IepTip)
Vue.component(IepIdentityMark.name, IepIdentityMark)
Vue.component(IepReadMarkDel.name, IepReadMarkDel)
Vue.component(IepFiveKay.name, IepFiveKay)
Vue.component(IepKeyItem.name, IepKeyItem)
Vue.component(IepUserCard.name, IepUserCard)
Vue.component(IepCharts.name, IepCharts)
Vue.component(IepStatisticsHeader.name, IepStatisticsHeader)
Vue.component(IepSlotCard.name, IepSlotCard)
Vue.component(IepIsOpen.name, IepIsOpen)
// 表单组件
Vue.component(IepTag.name, IepTag)
Vue.component(IepNewTag.name, IepNewTag)
Vue.component(IepSelect.name, IepSelect)
Vue.component(IepSelectDetail.name, IepSelectDetail)
Vue.component(IepCascader.name, IepCascader)
Vue.component(IepDictDetail.name, IepDictDetail)
Vue.component(IepDictSelect.name, IepDictSelect)
Vue.component(IepDictCascader.name, IepDictCascader)
Vue.component(IepDictCascaderDetail.name, IepDictCascaderDetail)
Vue.component(IepDatePicker.name, IepDatePicker)
Vue.component(IepDescriptionItem.name, IepDescriptionItem)
Vue.component(IepTagDetail.name, IepTagDetail)
Vue.component(IepDivDetail.name, IepDivDetail)
Vue.component(IepDivDetailSwitch.name, IepDivDetailSwitch)
Vue.component(IepDateRangeSelect.name, IepDateRangeSelect)
Vue.component(IepFormItem.name, IepFormItem)
Vue.component(IepCrmsSelect.name, IepCrmsSelect)
Vue.component(IepCrmsSelectMultiple.name, IepCrmsSelectMultiple)
Vue.component(IepInputNumber.name, IepInputNumber)
Vue.component(IepInputAmount.name, IepInputAmount)
Vue.component(IepInputArea.name, IepInputArea)
Vue.component(IepAntInput.name, IepAntInput)
// 头像上传文件有关组件
Vue.component(IepImgAvatar.name, IepImgAvatar)
Vue.component(IepImg.name, IepImg)
Vue.component(IepUpload.name, IepUpload)
Vue.component(IepAvatar.name, IepAvatar)
Vue.component(IepDownload.name, IepDownload)
Vue.component(IepUploadSelect.name, IepUploadSelect)
Vue.component(IepUploadDialog.name, IepUploadDialog)
// 弹出层相关组件
Vue.component(IepDialog.name, IepDialog)
Vue.component(IepADialog.name, IepADialog)
Vue.component(IepDrawer.name, IepDrawer)
Vue.component(IepHoverCard.name, IepHoverCard)
Vue.component(IepReviewConfirm.name, IepReviewConfirm)
Vue.component(IepImageDialog.name, IepImageDialog)
//投资弹框
Vue.component(IepEquityDialog.name, IepEquityDialog)
// 表格相关组件
Vue.component(IepTable.name, IepTable)
Vue.component(IepTableLink.name, IepTableLink)
Vue.component(IepTableLinkImgDesc.name, IepTableLinkImgDesc)
// 通讯录组件Contact
Vue.component(IepContactSelect.name, IepContactSelect)
Vue.component(IepContactMultiple.name, IepContactMultiple)
Vue.component(IepContactMultipleUser.name, IepContactMultipleUser)
// 部门组件Dept
Vue.component(IepDeptSelect.name, IepDeptSelect)
Vue.component(IepDeptMultiple.name, IepDeptMultiple)
// 合同组件Contract
Vue.component(IepContractSelect.name, IepContractSelect)
// 项目
Vue.component(IepProjectSelect.name, IepProjectSelect)
//任务
Vue.component(IepTaskAtmsSelect.name, IepTaskAtmsSelect)
// 展示页公共组件
Vue.component(IepAppTabCard.name, IepAppTabCard)
Vue.component(IepAppTabsCard.name, IepAppTabsCard)
Vue.component(IepAppFooterBar.name, IepAppFooterBar)
Vue.component(IepAppLayout.name, IepAppLayout)
Vue.component(IepAppListCard.name, IepAppListCard)
Vue.component(IepAppRankingCard.name, IepAppRankingCard)
Vue.component(IepAppLabelCard.name, IepAppLabelCard)
Vue.component(IepAppAssortCard.name, IepAppAssortCard)
Vue.component(IepAppRewardCard.name, IepAppRewardCard)
Vue.component(IepAppEvaluationReview.name, IepAppEvaluationReview)
Vue.component(IepAppEvaluationReviews.name, IepAppEvaluationReviews)
<file_sep>/src/views/wel/index/IcanContent/thoughtList/library/keyup.js
// import { loadContactsPyList } from '@/api/admin/contacts'
import { getUserNameList } from '@/api/cpms/thoughts'
export default {
data () {
return {
restaurants: [],
state: '',
keyupType: false,
keyupTypes: false,
startPos: -1,
content: '',
}
},
methods: {
handleKeyup (val) {
// 因为输入法的原因,需要在输入之后延时获取字符串
setTimeout(() => {
let elInput = document.getElementById('keyupStart') // 根据id选择器选中对象
let startPos = elInput.selectionStart // input 第0个字符到选中的字符
if (val.key === ' ') { // 输入空格 -- 关闭搜索
this.keyupTypes = false
} else if (val.key === 'Backspace' && this.startPos === startPos + 1) { // 输入删除 -- 关闭搜索
this.keyupTypes = false
}
if (this.keyupType) { // 输入普通的内容 -- 根据输入搜索
this.gettingFocus()
} else if (val.code === 'Digit2') { // 输入@ -- 打开搜索
// 中文输入发状态下监听不到 @ 输入,所以要监听 2 然后判断是否输入了 @
if (this.formData.content.slice(startPos - 1, startPos) === '@') {
this.startPos = startPos
this.keyupType = true
this.keyupTypes = true
}
}
}, 200)
},
handleCancal () {
this.handleEnd()
},
querySearchAsync (queryString, cb) {
let defaultObj = {
value: '轻敲空格完成输入',
id: 0,
}
if (!this.keyupTypes) {
cb([defaultObj])
this.handleEnd()
} else {
getUserNameList({ name: this.state }).then(({ data }) => {
let list = [defaultObj].concat(data.data.map(m => {
return {
value: m.name,
id: m.id,
}
}))
cb(list)
})
}
},
// 联想搜索
handleSelect (item) {
let elInput = document.getElementById('keyupStart') // 根据id选择器选中对象
var startPos = elInput.selectionStart // input 第0个字符到选中的字符
if (item.id === 0) {
this.formData.content = this.formData.content.slice(0, startPos) + ' ' + this.formData.content.slice(startPos)
} else {
this.formData.content = this.formData.content.slice(0, this.startPos) + item.value + ' ' + this.formData.content.slice(startPos)
}
this.handleEnd()
this.$nextTick(() => {
this.$refs['content'].focus()
})
},
// 结束
handleEnd () {
this.keyupType = false
this.content = ''
this.state = ''
},
// @人
handleAnt () {
let elInput = document.getElementById('keyupStart') // 根据id选择器选中对象
let startPos = elInput.selectionStart // input 第0个字符到选中的字符
this.formData.content = this.formData.content.slice(0, startPos) + '@' + this.formData.content.slice(startPos)
this.startPos = startPos + 1
this.keyupType = true
this.keyupTypes = true
this.gettingFocus()
},
gettingFocus () {
let elInput = document.getElementById('keyupStart') // 根据id选择器选中对象
let startPos = elInput.selectionStart // input 第0个字符到选中的字符
this.state = this.formData.content.slice(this.startPos, startPos)
if (this.formData.content !== this.content) {
this.content = this.formData.content
this.$refs['autocomplete'].focus()
this.$nextTick(() => {
this.$refs['content'].focus()
})
}
},
handleSubject () {
let elInput = document.getElementById('keyupStart') // 根据id选择器选中对象
let startPos = elInput.selectionStart // input 第0个字符到选中的字符
this.formData.content = this.formData.content.slice(0, startPos) + '#请填写话题# ' + this.formData.content.slice(startPos)
},
},
}<file_sep>/src/router/exception/index.js
import Layout from '@/page/index/index'
export default [
{
path: '/myiframe',
component: Layout,
redirect: '/myiframe',
children: [
{
path: ':routerPath',
name: 'iframe',
component: () => import('@/components/iframe/main'),
props: true,
},
],
},
{
path: '/404',
component: () => import(/* webpackChunkName: "exception" */ '@/components/error-page/404'),
name: '404',
meta: {
keepAlive: true,
isTab: false,
isAuth: false,
},
},
{
path: '/exception',
name: '错误页',
component: Layout,
redirect: '/exception/500',
children: [
{
path: '403',
component: () => import(/* webpackChunkName: "exception" */ '@/components/error-page/403'),
name: '403',
meta: {
keepAlive: true,
isTab: false,
isAuth: false,
},
},
{
path: '500',
component: () => import(/* webpackChunkName: "exception" */ '@/components/error-page/500'),
name: '500',
meta: {
keepAlive: true,
isTab: false,
isAuth: false,
},
},
{
path: '502',
component: () => import(/* webpackChunkName: "exception" */ '@/components/error-page/502'),
name: '502',
meta: {
keepAlive: true,
isTab: false,
isAuth: false,
},
},
{
path: '503',
component: () => import(/* webpackChunkName: "exception" */ '@/components/error-page/503'),
name: '503',
meta: {
keepAlive: true,
isTab: false,
isAuth: false,
},
},
{
path: '504',
component: () => import(/* webpackChunkName: "exception" */ '@/components/error-page/504'),
name: '504',
meta: {
keepAlive: true,
isTab: false,
isAuth: false,
},
},
],
},
{
path: '/403',
redirect: '/exception/403',
},
{
path: '/500',
redirect: '/exception/500',
},
{
path: '/502',
redirect: '/exception/502',
},
{
path: '/503',
redirect: '/exception/503',
},
{
path: '/504',
redirect: '/exception/504',
},
]
<file_sep>/src/views/goms/UnionManagement/UnionMember/options.js
const initOrgForm = () => {
return {
orgId: null,
}
}
const initForm = () => {
return {
belongUser: '',
logo: '',
createTime: '',
orgId: null,
moduleIds: [],
moduleNum: null,
orgName: '',
}
}
const columnsMap = [
{
prop: 'orgName',
label: '组织名称',
},
{
prop: 'belongUser',
label: '所属者',
},
{
prop: 'createTime',
label: '创建时间',
},
]
export { initOrgForm, columnsMap, initForm }<file_sep>/src/views/wenjuan/mixins/menu.js
import { mapMutations } from 'vuex'
export default {
methods: {
...mapMutations([
'SET_MENU',
'SET_ACTIVE_MAIN_MENU',
]),
setCurrentMenu (menus, name) {
menus.forEach((item) => {
// if ('shujukeshi' === name){
// this.$router.push('/lookdata')
// return
// }
if (name === item.name) {
if (!item.redirectUrl.indexOf('myiframe')) {
this.$router.push({name: item.name})
} else {
this.$router.push({path: item.redirectUrl || item.path})
}
// this.$router.push({name: name})
this.$store.commit('SET_MENU', item.children)
return false
}
})
},
},
}
<file_sep>/src/views/wel/rss/options.js
// org config options
const dictsMap = {
status: {
0: '技术文档',
1: '产品与解决方案',
2: '培训/课程',
},
}
const columnsMap = [
{
prop: 'themeList',
label: '主题',
type: 'tag',
iepType: 'themeList',
},
{
prop: 'industryList',
label: '行业',
type: 'tag',
iepType: 'industryList',
},
{
prop: 'publishTime',
label: '发文时间',
type: 'date',
formatString: 'YYYY-MM-DD',
},
]
const initForm = () => {
return {
name: '',
isOpen: false,
intro: '',
}
}
const toDtoForm = (row) => {
const newForm = { ...row }
return newForm
}
export { dictsMap, columnsMap, initForm, toDtoForm }<file_sep>/src/util/notify.js
import { Notification } from 'element-ui'
import router from '@/router/router'
// Notification
const notifyTypeMap = {
3: {
isPush: false,
listName: 'announcementList',
numName: 'announcementNum',
},
4: {
isPush: false,
listName: 'emailList',
numName: 'emailNum',
},
5: {
isPush: false,
listName: 'systemMessageList',
numName: 'systemMessageNum',
},
6: {
isPush: true,
notifyTitle: '通知消息',
notifyDesc: '收到一条通知消息,点击查看',
notifyPath: '/ims_spa/announcement_detail',
listName: 'announcementList',
numName: 'announcementNum',
},
7: {
isPush: true,
notifyTitle: '邮件',
notifyDesc: '收到一封邮件,点击查看',
notifyPath: '/mlms_spa/email/detail',
listName: 'emailList',
numName: 'emailNum',
},
8: {
isPush: true,
notifyTitle: '系统消息',
notifyDesc: '收到一条系统消息,点击查看',
notifyPath: '/ims_spa/system_message_detail',
listName: 'systemMessageList',
numName: 'systemMessageNum',
},
}
const notifyShow = (title, message, path) => {
let notify = Notification({
title,
message,
onClick: () => {
router.push(path)
notify.close()
},
})
}
const pushNotify = (data) => {
let body = JSON.parse(data.body)
const notifyBody = notifyTypeMap[body.type]
if (notifyBody.isPush) {
notifyShow(notifyBody.notifyTitle, notifyBody.notifyDesc, `${notifyBody.notifyPath}/${body.msg[0].id}`)
}
return {notifyBody, body}
}
export { pushNotify }<file_sep>/src/views/BlockChain/Config/Edit/options.js
// import { mergeByFirst } from '@/util/util'
const columnsMap = [
{
prop: 'ruleName',
label: '规则名称',
},
{
prop: 'number',
label: '规则编码',
},
{
prop: 'action',
label: '动作',
type: 'dictGroup',
dictName: 'fams_wealth_action',
},
{
prop: 'score',
label: '能贝数值',
},
{
prop: 'dailyLimit',
label: '每日上限次数',
},
{
prop: 'totalExpenditure',
label: '累计支出',
},
{
prop: 'remarks',
label: '描述',
type: 'detail',
},
]
const initForm = () => {
return {
ruleId: '',
orgId: '',
creatorId: '',
createTime: '',
type: '',
ruleName: '',
number: '',
score: '',
action: '',
dailyLimit: '',
totalExpenditure: '',
remarks: '',
}
}
const rules = {
score: [
{ required: true, message: '请填写国脉贝数量', trigger: 'blur', type: 'number' },
],
dailyLimit: [
{ required: true, message: '请填写每日上限次数', trigger: 'blur', type: 'number' },
],
action: [
{ required: true, message: '请填写动作', trigger: 'blur' },
],
remarks: [
{ required: true, message: '请填写描述', trigger: 'blur' },
],
}
export { columnsMap, initForm, rules }
<file_sep>/src/views/fams/OrgAssets/ProjectAccounting/options.js
import { getYear, getMonth } from '@/util/date'
const columnsMap = [
{
prop: 'createTime',
label: '立项时间',
type: 'date',
formatString: 'YYYY-MM-DD',
},
{
prop: 'projectStage',
label: '项目阶段',
width:100,
type: 'dictGroup',
dictName: 'prms_project_stage',
},
]
const rules = {
orgId: [
{ required: true, message: '请选择组织', trigger: 'blur' },
],
businessDate: [
{ required: true, message: '请选择时间', trigger: 'blur' },
],
amount: [
{ required: true, message: '请输入指标金额', trigger: 'blur', type: 'number' },
],
}
const initDetailForm = () => {
return {
projectName: '',
contractAmount: 0,
publisher: '',
serialNo: '',
publisherList: { id: '', name: '' },
projectManagerList: { id: '', name: '' },
mktManagerList: { id: '', name: '' },
projectTime: '',
endTime: '',
}
}
const initForm = () => {
return {
orgId: '',
businessDate: '',
amount: 0,
}
}
const initSearchForm = () => {
return {
projectType: null,
signatureStatus: null,
projectStage: null,
date: '',
}
}
const toDtoSearchForm = (row) => {
const newForm = { ...row }
newForm.year = getYear(newForm.date) || null
newForm.month = getMonth(newForm.date) || null
if (newForm.onlyYear) {
delete newForm.month
}
return newForm
}
const toDtoForm = (row) => {
const newForm = { ...row }
newForm.businessYear = getYear(row.businessDate) || null
newForm.businessMonth = getMonth(row.businessDate) || null
delete newForm.businessDate
return newForm
}
export { columnsMap, initForm, initDetailForm, toDtoForm, initSearchForm, toDtoSearchForm, rules }<file_sep>/src/views/crms/business/options.js
const initForm = () => {
return {
id: '', // ID
clientName: '', // 客户名称 clientName
projectName: '', // 项目名称 projectName
businessType: [], // 业务类型 businessType
intentionLevelKey: '', // 意向程度 intentionLevel
tags: [], // 商机标签 businessTag
opportunityDes: '', // 商机描述
publisher: '', //发布者
publishDate: '', //发布日期
reciver: '', //认领人
isOpen: 3,
}
}
// 全部客户搜索
const allSearchForm = () => {
return {
clientName: '',
intentionLevel: '',
projectName: '',
statusValue: '',
businessTypeKey: [],
publisherName: '',
isCreate: '',
}
}
// 我的客户/协作客户搜索
const initSearchForm = () => {
return {
clientName: '',
intentionLevel: '',
projectName: '',
businessTypeKey: [],
publisherName: '',
isCreate: '',
}
}
const rules = {
clientName: [
{ required: true, message: '请输入客户名称', trigger: 'blur' },
{ max: 20, message: '长度不超过20个字符', trigger: 'blur' },
],
projectName: [
{ required: true, message: '请输入项目名称', trigger: 'blur' },
{ min: 2, max: 25, message: '长度在 2 到 25 个字符', trigger: 'blur' },
],
businessType: [
{ required: true, message: '请选择业务类型', trigger: 'blur' },
],
intentionLevel: [
{ required: true, message: '请选择意向程度', trigger: 'blur' },
],
tags: [{ required: true, message: '请添加商机标签', trigger: 'blur' }],
opportunityDes: [
{ required: true, message: '请输入商机描述', trigger: 'blur' },
{ max: 500, message: '长度不超过500个字符', trigger: 'blur' },
],
}
const initBusinessForm = () => {
return {
clientId: '',
clientName: '', //客户名称
clientTypeKey: [], //客户类型
districtType: '', // 区域类型
businessTypeKey: [], // 业务类型
specificBusinessType: '', //具体业务类型
clientRela: '', //客户关系
followUpStatus: '', // 跟进状态
marketManager: '', // 市场经理
lastTime: '', // 距离上次拜访已有(全部客户没有但依然存着)
phoneNumber: '', //手机号码
respDept: '', //负责部门
companyUrl: '', //单位网址
companyFunction: '', //单位职能
contractAddress: '', //单位地址
otherDesc: '', //其他说明
tags: [],
collaborations: [],
}
}
export { initForm, allSearchForm, initSearchForm, rules, initBusinessForm }
<file_sep>/src/api/hrms/department_management.js
import request from '@/router/axios'
const prefixUrl = '/admin/dept'
// @/api/hrms/department_management
export function getDeptPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function postDept (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function putDept (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function deleteDeptById (id) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: [id],
})
}
export function deleteDeptBatch (ids) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}
export function validDeptCode (code) {
return request({
url: `/admin/dept/repeat/number/${code}`,
method: 'get',
})
}<file_sep>/src/views/hrms/Recruitment/TalentPool/ResumeLibrary/options.js
import { mergeByFirst } from '@/util/util'
const dictsMap = {
status: {
1: '待处理',
2: '已邀约',
3: '邀约未面试',
4: '面试未录用',
5: '已录用',
},
}
const columnsMap = [
{
prop: 'sex',
label: '性别',
width: 55,
},
{
prop: 'age',
label: '年龄',
width: 55,
},
{
prop: 'education',
label: '学历',
type: 'dictGroup',
dictName: 'hrms_highest_educational',
width: '100',
},
{
prop: 'applyPosition',
label: '应聘岗位',
},
{
prop: 'receptionTime',
label: '简历接受时间',
},
{
prop: 'source',
label: '来源',
type: 'dictGroup',
dictName: 'hrms_resume_source',
width: '100',
},
{
prop: 'remarks',
label: '备注',
width: '120',
},
]
const initForm = () => {
return {
id: '',
name: '',
sex: 1,
avatar: '',
birthday: '',
title: '',
phone: '',
age: '',
email: '',
height: '',
weight: '',
nation: '',
address: '',
politics: '',
health: '',
marriage: '',
bear: '',
university: '',
education: '',
relation: '',
referrer: '',
appWay: '',
source: '',
hobbies: '',
advantage: '',
honor: '',
result: '',
position: [],
positionId: '',
positionName: '',
arrive: '',
salary: '',
workPlace: '',
attach: [],
attachFile: [], // 文件
workExperience: [],
trainingSituation: [],
eduSituation: [],
userCert: [],
blacklistArea: '',
blacklistReasons: '',
postscript: '',
cities: [],
}
}
const formToDto = row => {
const newForm = mergeByFirst(initForm(), row)
newForm.attachFileUrl = row.attach.map(m => m.url)[0]
newForm.positionId = row.position[row.position.length - 1]
return newForm
}
const formToVo = row => {
const newForm = mergeByFirst(initForm(), row)
newForm.attach = row.attachFile || []
return newForm
}
const initSearchForm = () => {
return {
name: '', // 姓名
positionName: '', // 岗位名称
position: [], // 岗位id
educationId: null, // 最高学历字典ID
sex: 0, // 性别id
rangeTime: null, // 开始时间
status: null, // 简历状态id
rangeAge: null, // 年龄
}
}
const initDtoSearchForm = () => {
return {
name: '', // 姓名
positionName: '', // 岗位名称
positionId: null, // 岗位id
educationId: null, // 最高学历字典ID
sex: 0, // 性别id
startTime: null, // 简历接收时间(开始时间)
endTime: null, // 简历接收时间(结束时间)
status: null, // 简历状态
minAge: null, // 最小年龄
maxAge: null, // 最大年龄
}
}
// positionId: 1, // 岗位id
// deptId: 1, // 部门ID
// sex: 1, // 性别id
// status: 1, // 招聘状态id
// startTime: initNow(), // 开始时间
// endTime: initNow(), // 结束时间
const toDtoSearchForm = row => {
const newForm = mergeByFirst(initDtoSearchForm(), row)
newForm.sex = row.sex ? row.sex : null
newForm.positionId =
row.position.length && row.position[row.position.length - 1]
if (row.rangeTime) {
newForm.startTime = row.rangeTime[0]
newForm.endTime = row.rangeTime[1]
}
if (row.rangeAge) {
newForm.minAge = row.rangeAge[0]
newForm.maxAge = row.rangeAge[1]
}
return newForm
}
const initToResumeForm = () => {
return {
ids: [],
reason: '',
}
}
const initToBlacklistForm = () => {
return {
ids: [],
area: '',
reason: '',
}
}
const initrejectedForm = () => {
return {
msg: '',
}
}
const studyColumns = [
{
prop: 'name',
label: '学习(教育)单位',
},
{
prop: 'startTime',
label: '起始时间',
},
{
prop: 'content',
label: '学习内容',
},
]
const workExpColumns = [
{
prop: 'name',
label: '公司',
},
{
prop: 'position',
label: '岗位',
},
{
prop: 'startTime',
label: '起始时间',
},
{
prop: 'description',
label: '工作描述',
},
{
prop: 'leavingReason',
label: '离职原因',
},
]
const trainingColumns = [
{
prop: 'name',
label: '培训名称',
},
{
prop: 'place',
label: '培训单位',
},
{
prop: 'method',
label: '培训方式',
},
{
prop: 'startTime',
label: '起始时间',
},
]
const certificateColumns = [
{
prop: 'name',
label: '证书名称',
},
{
prop: 'number',
label: '证书编号',
},
{
prop: 'issuedPlace',
label: '颁发单位',
},
{
prop: 'annex',
label: '附件',
},
]
const rules = {
name: [{ required: true, message: '请填写姓名', trigger: 'blur' }],
phone: [{ required: true, message: '请填写联系电话', trigger: 'blur' }],
education: [{ required: true, message: '请填写最高学历', trigger: 'blur' }],
position: [
{
required: true,
type: 'array',
message: '请填写应聘岗位',
trigger: 'blur',
},
],
workPlace: [{ required: true, message: '请填写期望工作地', trigger: 'blur' }],
}
export {
dictsMap,
columnsMap,
initForm,
initrejectedForm,
formToDto,
initToResumeForm,
initToBlacklistForm,
workExpColumns,
studyColumns,
trainingColumns,
certificateColumns,
initSearchForm,
toDtoSearchForm,
formToVo,
rules,
}
<file_sep>/src/views/admin/social/options.js
const columnsMap = [
{
prop: 'id',
label: 'ID',
},
{
prop: 'type',
label: '类型',
},
{
prop: 'remark',
label: '描述',
},
{
prop: 'appId',
label: 'appId',
},
{
prop: 'appSecret',
label: 'appSecret',
},
{
prop: 'createTime',
label: '创建时间',
},
]
const rules = {
id:[{required:true,message: '请输入', trigger: 'blur'}],
type:[{required:true,message: '请输入', trigger: 'blur'}],
appId:[{required:true,message: '请输入', trigger: 'blur'}],
appSecret:[{required:true,message: '请输入', trigger: 'blur'}],
}
const initForm = () => {
return {
appId: '',
appSecret: '',
redirectUrl: '',
remark: '',
type: '',
}
}
export { columnsMap, initForm, rules }<file_sep>/src/views/wenjuan/components/govDialog/README.md
## 数据基因 通用弹窗
### 基础用法
> 基础弹窗
``` html
<gov-dialog
ref="mainDialog"
:title="title"
:btnGroup="btnGroup"
@open="handleOpen"
@opened="handleOpened"
@close="handleClose"
@closed="handleClosed"
@dialogClose="dialogClose">
弹窗内容(插槽)
</gov-dialog>
```
``` javascript
data() {
return {
// 弹窗标题
title: '',
// 弹窗按钮
btnGroup: [
{
label: '取消', // 按钮文本
loading: false, // 按钮加载中状态
disabled: false, // 是否禁用按钮
fn: 'dialogClose', // 按钮回调方法名称
}, {
label: '提交',
loading: false,
disabled: false,
fn: 'dialogSubmit',
}
],
}
}
methods: {
openDialog(name) {
// 打开弹窗的方法
this.$refs[name].open()
},
dialogClose(name) {
// 关闭弹窗的方法
this.$refs[name].close()
},
dialogSubmit() {
// 自定义按钮的回调
},
handleOpen () {
// 打开弹窗的回调
},
handleOpened() {
// 打开弹窗动画结束后的回调
},
handleClose() {
// 关闭弹窗的回调
},
handleClosed() {
// 关闭弹窗动画结束后的回调
},
}
```
### 属性/方法/回调
> Attributes 属性
|参数|说明|类型|可选值|默认值|
|:--:|--|--|:--:|:--:|
|width|宽度|String|-|50%|
|title|标题|String|-|'无标题弹窗'|
|top|距离顶部距离|String|-|15vh|
|customClass|自定义类名|String|-|-|
|modal|是否显示遮罩|Boolean|-|true|
|center|是否居中对齐|Boolean|-|false|
|fullscreen|是否全屏|Boolean|-|false|
|lockScroll|锁定body滚动条|Boolean|-|true|
|showClose|是否显示关闭按钮|Boolean|-|true|
|appendToBody|是否插入到body元素|Boolean|-|true|
|btnGroup|footer按钮组|Array|-|-|
|isBtnGroup|控制底部按钮有无|Boolean|-|true|
> btnGroup
- 传入属性回调函数为传入时的fn
|属性|说明|可选值|默认值|
|--|--|--|--|
|label|按钮名称|-|-|
|type|类型|primary/success/info/warning/danger|-|
|size|尺寸|mini/small/medium/default|default|
|loading|是否加载中状态|-|false|
|show|显示/隐藏|-|true|
|disabled|是否禁用按钮|-|false|
|fn|回调函数名称|-|-|
> event 回调
|事件名称|说明|回调参数|
|--|--|--|
|open|弹窗打开的回调|-|
|opened|打开动画结束后的回调|-|
|close|弹窗关闭的回调|-|
|closed|关闭动画结束后的回调|-|<file_sep>/src/views/fams/OrgAssets/OrganizationReward/options.js
// org config options
// import { checkContactUsers } from '@/util/rules'
const dictsMap = {
isReward: {
1: '打赏',
2: '扣减',
},
}
const columnsMap = [
{
prop: 'targetUserName',
label: '打赏对象',
},
{
prop: 'orgName',
label: '所属组织',
},
{
prop: 'amount',
label: '金额',
},
{
prop: 'createTime',
label: '操作时间',
},
{
prop: 'message',
label: '备注',
type: 'detail',
},
]
const initForm = () => {
return {
id: '', // ID
amount: 0, // 打赏金额
message: '', // 打赏备注
type: '', // 打赏类型
projectId: '', // 项目
projectName: '', // 项目
isReward: '1', // 打赏/扣减
targetUsers: [], // 打赏对象
}
}
const initSearchForm = () => {
return {
orgId: '', // ID
}
}
const dtoForm = (row) => {
const newForm = { ...row }
newForm.targetUserIds = newForm.targetUsers.map(m => m.id)
return newForm
}
const rules = {
isReward: [
{ required: true, message: '请选择打赏方式', trigger: 'blur' },
],
amount: [
{ type: 'number', required: true, message: '输入的金额至少大于 0 元', trigger: 'blur', min: 0.01 },
],
type: [
{ required: true, message: '请选择打赏类型', trigger: 'blur' },
],
targetUsers: [
{ type: 'array', required: true, message: '请选择打赏对象', trigger: 'blur' },
],
}
export { dictsMap, columnsMap, initForm, dtoForm, rules, initSearchForm }
<file_sep>/src/store/modules/notify.js
import { pushNotify } from '@/util/notify'
const notify = {
state: {
announcementList: [],
announcementNum: 0,
emailList: [],
emailNum: 0,
systemMessageList: [],
systemMessageNum: 0,
},
mutations: {
updateNotify (state, data) {
state[data.key] = data.value
},
},
actions: {
UpdatePushNotify ({ commit }, data) {
const {notifyBody, body} = pushNotify(data)
commit('updateNotify', { key: notifyBody.listName, value: body.msgList })
commit('updateNotify', { key: notifyBody.numName, value: body.msgNum })
},
SetNotify ({ commit }, data) {
for (const key in data) {
if (data.hasOwnProperty(key)) {
const element = data[key]
commit('updateNotify', { key: key, value: element })
}
}
},
},
}
export default notify
<file_sep>/src/views/wenjuan/config/index.js
import Vue from 'vue'
import GovButton from '@/components/govButton/index'
import GovSearchBar from '@/components/govSearchBar/index'
import GovDialog from '@/components/govDialog/index'
import GovLayout from '@/components/govLayout'
import GovDialogImport from '@/components/govDialogImport'
import GovDialogExport from '@/components/govDialogExport'
import GovDetailForm from '@/components/govDetailForm'
import GovSmartTag from '@/components/govSmartTag'
const components = [
GovButton,
GovSearchBar,
GovDialog,
GovLayout.GovLayoutBody,
GovLayout.GovLayoutButtonGroup,
GovLayout.GovLayoutDialog,
GovLayout.GovLayoutForm,
GovLayout.GovLayoutHeader,
GovLayout.GovLayoutMain,
GovDialogImport,
GovDialogExport,
GovDetailForm,
GovSmartTag,
]
components.forEach(component => {
Vue.component(component.name, component)
})
export default Vue<file_sep>/src/views/goms/UnionManagement/Configuration/ModuleManager/options.js
import { mergeByFirst } from '@/util/util'
const dictsMap = {
status: {
0: '正常',
1: '锁定',
},
}
const columnsMap = [
{
prop: 'name',
label: '模块名称',
},
{
prop: 'status',
label: '状态',
type: 'dict',
},
{
prop: 'userName',
label: '创建者',
},
{
prop: 'memberNum',
label: '成员数量',
},
{
prop: 'createTime',
label: '创建时间',
},
]
const initForm = () => {
return {
moduleId: '',
userId: '',
user: {
id: '',
name: '',
},
status: '',
}
}
const toDtoForm = (row) => {
const newForm = { ...row }
newForm.userId = newForm.user.id
return newForm
}
const toVoForm = (row) => {
const newForm = mergeByFirst(initForm(), row)
newForm.user = {
id: row.userId,
name: row.userName,
}
return newForm
}
export { columnsMap, initForm, toDtoForm, dictsMap, toVoForm }<file_sep>/src/store/modules/fams.js
import { getTotal } from '@/api/fams/total'
const fams = {
state: {
rewardDialogShow: false,
withdrawableCash: 0,
totalAsset: 0,
dayBell: 0,
ARewardedPerson: [],
invoiceDialogShow: false,
billingDialogShow: false,
},
mutations: {
SET_REWARD_DIALOG_SHOW: (state, rewardDialogShow) => {
state.rewardDialogShow = rewardDialogShow
},
SET_WITHDRAWABLECASH: (state, withdrawableCash) => {
state.withdrawableCash = withdrawableCash
},
SET_TOTALASSET: (state, totalAsset) => {
state.totalAsset = totalAsset
},
SET_DAYBELL: (state, dayBell) => {
state.dayBell = dayBell
},
SET_INVOICE_DIALOG_SHOW: (state, invoiceDialogShow) => {
state.invoiceDialogShow = invoiceDialogShow
},
SET_BILLING_DIALOG_SHOW: (state, billingDialogShow) => {
state.billingDialogShow = billingDialogShow
},
SET_WITHDRAWABLE_CASH: (state, data) => {
state.withdrawableCash = data.withdrawableCash
state.ARewardedPerson = data.person
},
},
actions: {
async famsGetTotal ({ commit }) {
const { data } = await getTotal()
if (['1', '2'].includes(data.msg)) {
commit('SET_WITHDRAWABLECASH', 0)
commit('SET_TOTALASSET', 0)
commit('SET_DAYBELL', 0)
} else {
const withdrawableCash = data.data.withdrawableCash || 0
const totalasset = (data.data.govmadeBell || 0) + (data.data.lockBell || 0)
const dayBell = data.data.dayBell || 0
commit('SET_WITHDRAWABLECASH', withdrawableCash)
commit('SET_TOTALASSET', totalasset)
commit('SET_DAYBELL', dayBell)
}
return data
},
async famsReward ({ commit, dispatch }, aperson = null) {
const { data } = await dispatch('famsGetTotal')
commit('SET_WITHDRAWABLE_CASH', {
withdrawableCash: data.withdrawableCash,
person: aperson ? [aperson] : [],
})
commit('SET_REWARD_DIALOG_SHOW', true)
},
},
}
export default fams
<file_sep>/src/views/wenjuan/management/const/mixin.js
export default {
data () {
return {
projectIdDic: [],
}
},
computed: {
searchOption () {
return [
{ label: '项目名称', prop: 'status', type: 'select', data: this.projectIdDic },
]
},
},
created () {
},
}
<file_sep>/src/api/govSmartTag/index.js
import request from '@/views/wenjuan/router/request'
const baseUrl = '/tms/tag'
//智能标签remote请求
export function selectTags (keyword) {
return request({
url: `${baseUrl}/assn_tag?keyWord=${keyword}`,
method: 'get',
})
}
//获取智能标签所有内容形成下拉选
export function getTagSelect () {
return request({
url: `${baseUrl}/selectTag`,
method: 'get',
})
}<file_sep>/src/views/wenjuan/questionnaire/const/mixin.js
import {
getDic,
} from '@/views/wenjuan/util/dic'
import {getGroupDept} from '@/api/evaluate/question'
var moment = require('moment')
export default {
data () {
return {
form: {
},
showSubordinate: false,
showGrade: false,
projectIdDic: [],
createByDic: [],
groupData: [],
groupDic: [],
disabledProject: false, // 判断是否是项目跳转过来的
projectId: '',
}
},
computed: {
column () {
return [
{
label: '问卷名称',
prop: 'name',
span: 12,
maxlength: 50,
rules: [{
required: true,
message: '不能为空',
trigger: 'blur',
}],
},
{
label: '问卷类型',
prop: 'type',
span: 12,
type: 'select',
dicData: getDic('QUESTION_TYPE'),
visdiplay: false,
rules: [{
required: true,
message: '不能为空',
trigger: 'change',
}],
},
{
label: '所属项目',
prop: 'projectId',
span: 12,
visdiplay: this.showSubordinate,
type: 'select',
dicData: this.projectIdDic,
rules: [{
required: true,
message: '不能为空',
trigger: 'change',
}],
disabled: this.disabledProject,
change: (value)=>{
if(value.value){
getGroupDept(value.value).then(({data}) => {
if (data.code === this.SUCCESS) {
let deptIds = []
data.data.map(item=>{
deptIds.push(...item.eligibleUnitsList)
})
this.form.evaDept = deptIds
this.$nextTick(()=>{
this.$refs['form'] ? this.$refs['form'].clearValidate(): ''
})
}
})
}
},
},
{
label: '问卷范围',
prop: 'evaDept',
type: 'select',
multiple: true,
dicData: this.groupDic,
span: 12,
rules: [{
required: true,
message: '不能为空',
trigger: 'change',
}],
},
{
label: '开始日期',
prop: 'startTime',
span: 15,
type: 'datetime',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rules: [{
required: true,
message: '不能为空',
trigger: 'blur',
},{ validator: this.validateStart, trigger: 'blur' }],
},
{
label: '结束日期',
prop: 'endTime',
span: 15,
type: 'datetime',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rules: [{
required: true,
message: '不能为空',
trigger: 'blur',
},{ validator: this.validateEnd, trigger: 'blur' }],
},
{
label: '是否评分',
prop: 'isGrade',
span: 12,
type: 'radio',
visdiplay: false,
dicData: [{
value: '1',
label: '是',
},{
value: '2',
label: '否',
}],
rules: [{
required: true,
message: '不能为空',
trigger: 'blur',
}],
},
// {
// label: '评分有效性',
// prop: 'gradeEffective',
// span: 12,
// type: 'radio',
// visdiplay: this.showGrade,
// dicData: [{
// value: '1',
// label: '按人数',
// },{
// value: '2',
// label: '按回答率',
// }],
// rules: [{
// required: true,
// message: '不能为空',
// trigger: 'blur',
// }],
// },
// {
// label: '有效阈值',
// type: 'number',
// prop: 'gradeNumber',
// span: 12,
// visdiplay: this.showGrade,
// rules: [{
// required: true,
// message: '不能为空',
// trigger: 'blur',
// }],
// maxlength: 4,
// },
{
label: '问卷描述',
prop: 'remarks',
span: 24,
type: 'textarea',
rules: [{
required: true,
message: '不能为空',
trigger: 'blur',
}],
maxlength: 150,
},
]
},
detailOption () {
return {
option: [
{
column: [
{
label: '问卷名称',
prop: 'name',
span: 12,
},
// {
// label: '问卷类型',
// prop: 'type',
// span: 12,
// type: 'select',
// dicData: getDic('QUESTION_TYPE'),
// },
// {
// label: '所属项目',
// prop: 'projectId',
// type: 'select',
// dicData: this.projectIdDic,
// span: 12,
// },
{
label: '问卷单位',
prop: 'evaDept',
type: 'select',
dicData: this.groupDic,
span: 12,
},
{
label: '问卷描述',
prop: 'remarks',
span: 12,
slot: true,
},
{
label: '开始日期',
prop: 'startTime',
span: 15,
},
{
label: '结束日期',
prop: 'endTime',
span: 15,
},
],
},
],
}
},
editOption () {
return {
menuBtn: false,
labelWidth: '100',
labelPosition: 'right',
column: this.column,
}
},
searchOption () {
return [
{ label: '问卷名称', prop: 'name', change: ()=> {}},
{ label: '问卷状态', prop: 'status', type: 'select', data: getDic('QUESTION_STATUS'), change: ()=> {} },
]
},
searchOptionMy () {
return [
{ label: '问卷名称', prop: 'name'},
]
},
tableOption () {
return {
addBtn: false,
editBtn: false,
delBtn: false,
header: false,
selection: false,
menuWidth: '180px',
indexLabel: '序号',
index: false,
align: 'center',
border: false,
column: [
{ label: '问卷名称', prop: 'name',width:'120px'},
{ label: '创建人', prop: 'createBy',type: 'dic', dicData: this.createByDic,width:'70px' },
{ label: '问卷状态', prop: 'status', type: 'dic', dicData: getDic('QUESTION_STATUS') ,width:'80px'},
{ label: '开始日期', prop: 'startTime', type: 'date',width:'150px' },
{ label: '结束日期', prop: 'endTime', type: 'date',width:'150px' },
{ label: '参与人数/收到问卷人数', prop: 'proportion',width:'170px' },
{ label: '回收率', prop: 'recovery'},
],
}
},
myTableOption () {
return {
addBtn: false,
editBtn: false,
delBtn: false,
header: false,
selection: false,
menuWidth: '180px',
indexLabel: '序号',
index: false,
align: 'center',
border: false,
column: [
{ label: '问卷名称', prop: 'name'},
{ label: '创建人', prop: 'createBy',type: 'dic', dicData: this.createByDic },
{ label: '问卷类型', prop: 'type', type: 'dic', dicData: getDic('QUESTION_TYPE') },
{ label: '问卷状态', prop: 'status', type: 'dic', dicData: getDic('QUESTION_STATUS') },
{ label: '所属项目', prop: 'projectId',type: 'select', dicData: this.projectIdDic },
{ label: '开始日期', prop: 'startTime', type: 'date',width:'150px' },
{ label: '结束日期', prop: 'endTime', type: 'date',width:'150px' },
],
}
},
chooseOption () {
return {
addBtn: false,
editBtn: false,
delBtn: false,
header: false,
selection: false,
menuWidth: '180px',
indexLabel: '序号',
index: false,
align: 'center',
border: false,
column: [
{ label: '问卷名称', prop: 'name'},
{ label: '创建人', prop: 'createBy',type: 'dic', dicData: this.createByDic },
{ label: '问卷类型', prop: 'type', type: 'dic', dicData: getDic('QUESTION_TYPE') },
{ label: '问卷状态', prop: 'status', type: 'dic', dicData: getDic('QUESTION_STATUS') },
{ label: '所属项目', prop: 'projectId',type: 'select', dicData: this.projectIdDic },
],
}
},
},
watch: {
'form.type': {
deep: true,
handler (val) {
if(val == 1){
this.showSubordinate = true
}else{
this.showSubordinate = false
this.form.subordinate = ''
}
this.$nextTick(()=>{
this.$refs['form'] ? this.$refs['form'].clearValidate(): ''
})
},
},
'form.isGrade': {
handler (val) {
if(val == 1){
this.showGrade = true
}else{
this.showGrade = false
this.form.gradeEffective = ''
this.form.gradeNumber = ''
}
},
},
},
methods: {
validateStart (rule, value, callback) {
let selectTime = moment(value).valueOf()
let nowTime = new Date().valueOf()
let endTime = moment(this.form.endTime).valueOf()
// moment(value).valueOf() new Date().valueOf()
if (selectTime < nowTime) {
callback(new Error('开始的时间必须得是当前时间之后!'))
} else if(selectTime >= endTime){
callback(new Error('开始的时间必须小于结束时间!'))
} else {
callback()
}
},
validateEnd (rule, value, callback) {
let selectTime = moment(value).valueOf()
let startTime = moment(this.form.startTime).valueOf()
if (selectTime <= startTime) {
callback(new Error('结束时间必须大于开始时间!'))
} else {
callback()
}
},
},
}
<file_sep>/src/api/app/mlms/honor.js
import request from '@/router/axios'
const prefixUrl = '/mlms/channel_material/honor'
const honorListUrl = '/mlms/channel_material/honor_list'
// 获得资质库总数
export const getHonorCount = (params) => {
return request({
url: `${prefixUrl}/count`,
method: 'get',
params: params,
})
}
// 获得选项卡
export const getHonorSign = (params) => {
return request({
url: `${prefixUrl}/getSign`,
method: 'get',
params: params,
})
}
// 获得资质库分页(包含模糊搜索)
export const getHonorPage = (params) => {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: params,
})
}
export function getHonorPage1 (size) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: {
size,
},
})
}
// 组织详情资质集合
export const getHonorList = (id) => {
return request({
url: `${honorListUrl}/${id}`,
method: 'get',
})
}
<file_sep>/src/store/modules/ican.js
import { getAccountInfo } from '@/api/fams/block_chain'
const ican = {
state: {
rewardDialogShow: false,
withdrawableCash: 0,
},
mutations: {
SET_ICAN_REWARD_DIALOG_SHOW: (state, rewardDialogShow) => {
state.rewardDialogShow = rewardDialogShow
},
SET_ICAN_WITHDRAWABLE_CASH: (state, data) => {
state.withdrawableCash = data.withdrawableCash
state.ARewardedPerson = data.person
},
},
actions: {
icanReward ({ commit }) {
getAccountInfo().then(({ data }) => {
if (data.data) {
commit('SET_ICAN_WITHDRAWABLE_CASH', {
withdrawableCash: data.data.balance,
})
commit('SET_ICAN_REWARD_DIALOG_SHOW', true)
}
})
},
},
}
export default ican<file_sep>/src/api/evaluate/report.js
import request from '@/router/axios'
//获取评测说明
export function getEvaluatingDescription (query) {
return request({
url: '/evaluate/evaluateintegratedchart/selectReportShows',
method: 'get',
params: query,
})
}
//保存评测说明
export function saveEvaluatingDescription (data) {
return request({
url: '/evaluate/evaluateintegratedchart/saveReportShows',
method: 'post',
data: data,
})
}
//问题属性分布情况
export function getProblemProperties (query) {
return request({
url: '/evaluate/evaluateintegratedchart/problemProperties',
method: 'get',
params: query,
})
}
//查看得分情况
export function getScores (query) {
return request({
url: '/evaluate/evaluateintegratedchart/scores',
method: 'get',
params: query,
})
}
//查看综合评测的评测说明
export function getReportShows (query) {
return request({
url: '/evaluate/evaluateintegratedchart/instructions',
method: 'get',
params: query,
})
}
//查看得分表
export function getScoreTable (query) {
return request({
url: '/evaluate/evaluateintegratedchart/scoreTable',
method: 'get',
params: query,
})
}
//日常评测 工单出具情况
export function getWorkOrderIssue (query) {
return request({
url: '/evaluate/evaluatedailychart/workOrderIssue',
method: 'get',
params: query,
})
}
//日常评测 工单整改情况分析
export function getRectificationAnalysis (query) {
return request({
url: '/evaluate/evaluatedailychart/rectificationAnalysis',
method: 'get',
params: query,
})
}
//日常评测 问题属性分布
export function getDailyProblemProperties (query) {
return request({
url: '/evaluate/evaluatedailychart/problemProperties',
method: 'get',
params: query,
})
}
//查看综合评测的评测说明
export function getDailyReportShows (query) {
return request({
url: '/evaluate/evaluatedailychart/instructions',
method: 'get',
params: query,
})
}
//根据项目id获取,并按参评单位分类 综合
export function evaluateintegratedchart (query) {
return request({
url: '/evaluate/evaluateintegratedchart/particularsByProject',
method: 'get',
params: query,
})
}
//根据项目id获取,并按参评单位分类 日常
export function evaluatedailychart (query) {
return request({
url: '/evaluate/evaluatedailychart/particularsByProject',
method: 'get',
params: query,
})
}
<file_sep>/src/views/hrms/OrganizationalStructure/DepartmentManagement/options.js
import { mergeByFirst } from '@/util/util'
import { initNow } from '@/util/date'
const dictsMap = {
}
const columnsMap = [
{
prop: 'name',
label: '部门名称',
},
{
prop: 'userName',
label: '负责人',
width: '100',
},
{
prop: 'people',
label: '部门人数',
width: '100',
},
{
prop: 'establishedTime',
label: '成立时间',
type: 'date',
formatString: 'YYYY-MM-DD',
},
]
const initForm = () => {
return {
id: '',
name: '',
number: '',
parentId: 0,
parentName: '无',
_level: 1,
establishedTime: initNow(),
user: {
id: '',
name: '',
},
}
}
const initDtoForm = () => {
return {
id: '',
name: '',
number: '',
userId: '',
parentId: 0,
_level: 1,
establishedTime: initNow(),
}
}
const toDeptForm = (row) => {
const newForm = mergeByFirst(initForm(), row)
if (!newForm.user.id) {
newForm.user = {
id: '',
name: '',
}
}
return newForm
}
const toNewParentForm = (row) => {
return mergeByFirst(initForm(), {
parentId: row.id || 0,
parentName: row.name || '无',
})
}
const toDtoForm = (row) => {
const newForm = mergeByFirst(initDtoForm(), row)
newForm.userId = row.user.id
return newForm
}
const initSearchForm = () => {
return {
name: '',
sex: '',
}
}
const initmoveForm = () => {
return {
name: '',
sex: '',
}
}
const initaddForm = () => {
return {
superiorDepartment: '',
departmentNumber: '',
departmentName: '',
departmentHead: '',
creartedTime: '',
}
}
const initmergeForm = () => {
return {
name: '',
sex: '',
}
}
export {
dictsMap,
columnsMap,
initForm,
initSearchForm,
initmoveForm,
initaddForm,
initmergeForm,
toDeptForm,
toNewParentForm,
toDtoForm,
}
<file_sep>/src/views/conm/SpecialManagement/options.js
const dictsMap = {
status: {
0: '禁用',
1: '正常',
},
}
const initForm = () => {
return {
title: '', //专题名称
specialId: '',
description: '',//描述
relations: '',
articleIds: [],//选择文章
}
}
const columnsMap = [
{
prop: 'specialId',
label: '专题id',
},
{
prop: 'title',
label: '专题名称',
},
]
const initSearchForm = () => {
return {
}
}
const rules = {
title: [{
required: true,
message: '请输入',
trigger: 'blur',
}],
}
const selfRules = {
...rules,
}
export { dictsMap, columnsMap, initForm, initSearchForm, rules, selfRules }<file_sep>/src/views/mlms/mymessage/inform/options.js
// org config options
const dictsMap = {
isOpen: {
0: '开',
1: '关',
},
status: {
0: '审核通过',
1: '待审核',
2: '审核驳回',
},
}
const columnsMap = [
{
prop: '性别',
label: '性别',
width: 55,
hidden: false,
},
{
prop: '部门',
label: '部门',
hidden: false,
},
{
prop: '入职时间',
label: '入职时间',
hidden: false,
},
{
prop: '员工状态',
label: '员工状态',
hidden: false,
},
{
prop: '岗位',
label: '岗位',
hidden: false,
},
{
prop: '身份证号码',
label: '身份证号码',
minWidth: 120,
hidden: true,
},
]
const initOrgForm = () => {
return {
name: '',
isOpen: false,
intro: '',
}
}
const initSearchForm = () => {
return {
name: '',
sex: '',
organization: '',
department: '',
job_category: '',
job_name: '',
status: '',
position: '',
job_title: '',
entry_time: '',
}
}
export { dictsMap, columnsMap, initOrgForm, initSearchForm }<file_sep>/src/views/wenjuan/util/setData.js
import {getDicAll} from '@/views/wenjuan/util/dic'
import mergeWith from 'lodash/mergeWith'
/**
* 数据格式
* 如:
* [
* {
label: '中文名称',
prop: 'chName',
span: 24,
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
type: 'input',
multiple: true,
dicName: 'IS_NOT', 字典名
}
* ]
*
*/
export function setAvueData ({data = [], options = [], tableParam = {}, formParam = {}}) {
let avueData = {
table: {
addBtn: false,
editBtn: false,
delBtn: false,
header: false,
column: [],
},
form: {
labelWidth: '150',
menuBtn: false,
column: [],
},
detail: {
option: [
{
column: [],
},
],
},
}
avueData.table = mergeWith(avueData.table, tableParam)
avueData.form = mergeWith(avueData.form, formParam)
let dicList = getDicAll().concat(options)
for (let i = 0, len = data.length; i < len; i++) {
avueData.table.column.push(getColumn(data[i], dicList, 'table'))
avueData.form.column.push(getColumn(data[i], dicList, 'form'))
avueData.detail.option[0].column.push(getColumn(data[i], dicList, 'detail'))
}
return avueData
}
function getColumn (data, options, type) {
let column = {}
if (type === 'table' || type === 'detail') {
column.label = data.label
column.prop = data.prop
if (data.dicName) {
column.type = 'dic'
column.dicData = options[data.dicName]
}
if (type === 'detail') {
column.span = data.span || 24
}
} else if (type === 'form') {
let currentData = Object.assign({}, data)
if (data.dicName) {
column.dicData = options[data.dicName]
}
delete currentData.dicName
column = mergeWith(column, currentData)
}
return column
}
<file_sep>/src/api/exam/testStatistics/totalStatistics.js
/**
* 新增考试统计中总体统计接口
*/
import request from '@/router/axios'
/**
* 获取考卷管理列表页
* @param {Object} params 参数
*/
export function getTotal (params) {
return request({
url: 'exms/iepexaminationstatistics/general',
method: 'get',
params: params,
})
}<file_sep>/src/api/mlms/material/report/organize.js
import request from '@/router/axios'
const prefixUrl = '/mlms/orgreport'
export function getTableData (params) {
return request({
url: `${prefixUrl}/list`,
method: 'post',
data: params,
})
}
export function createData (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function updateData (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
// 关联纪要
export function getSummaryList (obj) {
return request({
url: '/mlms/meeting/summary/list',
method: 'get',
params: obj,
})
}
// 关联产品
export function getProductList (obj) {
return request({
url: '/cpms/product/page',
method: 'get',
params: obj,
})
}
// 本组织下成员周月报
export function getWeekMonthReportByOrg (obj) {
return request({
url: '/mlms/weekmonthreport/report/page',
method: 'get',
params: obj,
})
}
<file_sep>/src/api/daemon/sys-job.js
import request from '@/router/axios'
export function fetchList (query) {
return request({
url: '/job/sys-job/page',
method: 'get',
params: query,
})
}
export function getJobLogList (query) {
return request({
url: '/job/sys-job/job-log',
method: 'get',
params: query,
})
}
export function shutdownJobsRa () {
return request({
url: '/job/sys-job/shutdown-jobs',
method: 'post',
})
}
export function startJobsRa () {
return request({
url: '/job/sys-job/start-jobs',
method: 'post',
})
}
export function refreshJobsRa () {
return request({
url: '/job/sys-job/refresh-jobs',
method: 'post',
})
}
export function startJobRa (jobId) {
return request({
url: '/job/sys-job/start-job/' + jobId,
method: 'post',
})
}
export function shutDownJobRa (jobId) {
return request({
url: '/job/sys-job/shutdown-job/' + jobId,
method: 'post',
})
}
export function addObj (obj) {
return request({
url: '/job/sys-job',
method: 'post',
data: obj,
})
}
export function getObj (id) {
return request({
url: '/job/sys-job/' + id,
method: 'get',
})
}
export function delObj (id) {
return request({
url: '/job/sys-job/' + id,
method: 'delete',
})
}
export function putObj (obj) {
return request({
url: '/job/sys-job',
method: 'put',
data: obj,
})
}
export function isValidTaskName (query) {
return request({
url: '/job/sys-job/is-valid-task-name',
method: 'get',
params: query,
})
}
<file_sep>/src/api/hrms/title_system.js
import request from '@/router/axios'
const prefixUrl = '/hrms/title_system'
// @/api/hrms/title_system
export function getTitlePage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
export function postTitle (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function putTitle (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function deleteTitleById (id) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: [id],
})
}
export function deleteTitleBatch (ids) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}<file_sep>/src/views/wenjuan/router/page/index.js
import Layout from '@/page/index/'
export default [
{
path: '/login',
name: '登录页',
component: () => import('@/page/login/index'),
meta: {
keepAlive: true,
},
},
{
path: '/404',
component: () => import('@/page/error-page/404'),
name: '404',
},
{
path: '/403',
component: () => import('@/page/error-page/403'),
name: '403',
},
{
path: '/500',
component: () => import('@/page/error-page/500'),
name: '500',
},
{
path: '/',
name: 'main',
redirect: '/index',
meta: {
title: '主页',
},
},
{
path: '/index',
name: 'index',
component: () => import('@/page/main-index/index'),
meta: {
title: '主页面',
},
},
{
path: '/myiframe',
component: Layout,
redirect: '/myiframe',
children: [{
path: ':routerPath',
name: 'iframe',
component: () => import('@/page/iframe/main'),
props: true,
}],
},
{
path: '*',
redirect: '/404',
// hidden: true,
},
]
<file_sep>/src/views/goms/UnionManagement/MemberManagement/options.js
const initForm = () => {
return {
assetOrg: '',
phone: '',
realName: '',
staffNo: '',
userId: 0,
role: [],
roleOrg: [],
}
}
const toDtoForm = (row) => {
const newForm = { ...row }
delete newForm.assetOrg
return newForm
}
export { initForm, toDtoForm }<file_sep>/src/views/mlms/material/datum/configure/option.js
export const dictsMap = {
type: {
1: '类型1',
2: '类型2',
},
}
export const tableOption = {
props: [
{ label: '分类名称', prop: 'levelName', slot: true },
{ label: '优先级', prop: 'sort', slot: true },
{ label: '编码', prop: 'number', slot: true },
{ label: '创建时间', prop: 'createTime', slot: true },
{ label: '操作', prop: 'menu', slot: true,width: '150'},
],
}
export const initFormData = () => {
return {
parentId: 0,
levelName: '',
sort: '',
number: '',
}
}
export const rules = {
name: [
{ required: true, message: '请输入组织名称', trigger: 'blur' },
],
}
<file_sep>/src/api/hrms/talent_pool.js
import request from '@/router/axios'
const prefixUrl = '/hrms/talent_pool'
// @/api/hrms/talent_pool
// 人才库
export function getTalentPoolPage (query) {
return getPage(query, 1)
}
// 简历库
export function getResumeLibraryPage (query) {
return getPage(query, 2)
}
// 黑名单
export function getResumeBlacklistPage (query) {
return getPage(query, 3)
}
function getPage (query, type) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: {
...query,
type,
},
})
}
export function postTalentPool (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function putTalentPool (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}
export function postResumeBlacklist (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
params: {
isBlacklist: true,
},
data: obj,
})
}
export function getTalentPoolById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function postToResume (obj) {
return request({
url: `${prefixUrl}/to_resume`,
method: 'post',
data: obj,
})
}
export function postToBlacklist (obj) {
return request({
url: `${prefixUrl}/to_blacklist`,
method: 'post',
data: obj,
})
}
export function postToTalent (ids) {
return request({
url: `${prefixUrl}/to_talent`,
method: 'post',
data: ids,
})
}
export function deleteTalentPoolById (id) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: [id],
})
}
export function deleteTalentPoolBatch (ids) {
return request({
url: `${prefixUrl}/delete/batch`,
method: 'post',
data: ids,
})
}
export function changeTalentPoolStatus (ids, status) {
return request({
url: `${prefixUrl}/status/batch`,
method: 'post',
data: {
ids,
status,
},
})
}<file_sep>/src/views/mlms/mymessage/native/MeHave/options.js
// org config options
const pagedTable = [
{
id: 1,
sendman:'邵万炯',
theme:'2019年2月21日18:00-19:00的内网更新维护公告',
time:'2019-02-15 09:39',
},
{
id: 2,
sendman:'崔颖',
theme:'关于20190221李柱微信培训的通知',
time:'2019-02-15 09:39',
},
{
id: 3,
sendman:'邵万炯',
theme:'2019年2月21日18:00-19:00的内网更新维护公告',
time:'2019-02-15 09:39',
},
{
id: 4,
sendman:'崔颖',
theme:'关于20190221李柱微信培训的通知',
time:'2019-02-15 09:39',
},
{
id: 5,
sendman:'崔颖',
theme:'2019年2月21日18:00-19:00的内网更新维护公告',
time:'2019-02-15 09:39',
},
{
id: 6,
sendman:'邵万炯',
theme:'关于20190221李柱微信培训的通知',
time:'2019-02-15 09:39',
},
{
id: 7,
sendman:'崔颖',
theme:'2019年2月21日18:00-19:00的内网更新维护公告',
time:'2019-02-15 09:39',
},
]
const initSearchForm = () => {
return {
sendman: '',
}
}
export { pagedTable, initSearchForm }<file_sep>/src/api/app/cpms/custom_product.js
import request from '@/router/axios'
export const prefixUrl = '/cpms/custom_product'
export function putCustomProdect (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function getExaminePage () {
return request({
url: `${prefixUrl}/examine_page`,
method: 'get',
})
}
export function getMyPage () {
return request({
url: `${prefixUrl}/my_page`,
method: 'get',
})
}
export function deleteCustomById (id) {
return request({
url: `${prefixUrl}/delete/${id}`,
method: 'post',
})
}
export function adoptCustomById (id) {
return request({
url: `${prefixUrl}/adopt/${id}`,
method: 'post',
})
}
export function refuseCustomById (id) {
return request({
url: `${prefixUrl}/refuse/${id}`,
method: 'post',
})
}
export function getListById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}<file_sep>/src/views/hrms/TrainingAssessment/AssessmentManagement/detail/options.js
export const initFormData = () => {
return {
list: [],
kpiVOs: [],
}
}
export const dictsMap = {
scoringMethod: {
1: '平均分',
2: '去掉最高最低平均分',
},
}
export const initTableColumn = () => {
return [
{
label: '考核指标项',
value: 'checkName',
fixed: true,
width: '150px',
},
{
label: '考核指标说明',
value: 'checkExplan',
width: '220px',
},
{
label: '权重(%)',
value: 'weight',
width: '100px',
},
]
}<file_sep>/src/api/govdata/policy_analyzing.js
/**
* 新增政策库政策解读API请求接口
*/
import request from '@/router/axios'
const prefixUrl = '/gc'
// 查看政策解读分页
export function getExplainPage (params) {
return request({
url: `${prefixUrl}/policy/explain/pageConsole`,
method: 'get',
params: params,
headers: {
isNoNeed: true,
},
})
}
// 政策中心里根据不同的条件的政策解读分页
export function getAnalysisCenterPage (params) {
return request({
url: `${prefixUrl}/policy/explain/page`,
method: 'get',
params: params,
headers: {
isNoNeed: true,
},
})
}
/**
* 政策中心里根据id查询政策解读
*/
export function getAnalysisCenterById (id) {
return request({
url: `${prefixUrl}/policy/explain/${id}`,
method: 'get',
headers: {
isNoNeed: true,
},
})
}
// 根据id查看政策解读
export function getExplainById (id) {
return request({
url: `${prefixUrl}/policy/explain/infoForConsole/${id}`,
method: 'get',
headers: {
isNoNeed: true,
},
})
}
// 删除政策解读(批量)
export function deleteExplainBatch (ids) {
return request({
url: `${prefixUrl}/policy/explain`,
method: 'delete',
data: ids,
headers: {
isNoNeed: true,
},
})
}
/**
* 新增并提交政策
* @param {Object} obj 表单参数
*/
export function postExplainAndCommit (params) {
return request({
url: `${prefixUrl}/policy/explain/createAndCommit`,
method: 'post',
data: params,
headers: {
isNoNeed: true,
},
})
}
/**
* 修改并提交政策
* @param {Object} obj 表单参数
*/
export function putExplainAndCommit (params) {
return request({
url: `${prefixUrl}/policy/explain/updateAndCommit`,
method: 'post',
data: params,
headers: {
isNoNeed: true,
},
})
}
// 暂存(添加)
export function postExplain (params) {
return request({
url: `${prefixUrl}/policy/explain/create`,
method: 'post',
data: params,
headers: {
isNoNeed: true,
},
})
}
// 暂存(修改)
export function putExplain (params) {
return request({
url: `${prefixUrl}/policy/explain/update`,
method: 'post',
data: params,
headers: {
isNoNeed: true,
},
})
}<file_sep>/src/views/wenjuan/components/govDetailForm/README.md
## 通用详情
> 基础
``` html
<gov-form-detail :data="data" :option="option"></gov-form-detail>
<!-- 自定义 -->
<gov-form-detail :data="data" :option="option">
<template slot="hobby" slot-scope="scope">
{{scope.data.hobbyForShow}}
</template>
</gov-form-detail>
<!--
dicData: [] // 字典数据
hobby: [] // 真实数据
hobbyForShow: '' // 获取字典的中文名 -->
```
### 属性/方法/回调
> 属性
|参数|说明|类型|可选值|默认值|
|:--:|--|--|:--:|:--:|
|option|参数|Object|||
|data|数据|Object|||
> option参数
|参数|说明|类型|可选值|默认值|
|:--:|--|--|:--:|:--:|
|column|每列行数|Number||1|
|labelWidth|label宽度|String|Number||100|
|option|参数|Array|||
>option-option参数
|参数|说明|类型|可选值|默认值|
|:--:|--|--|:--:|:--:|
|label|主标题|String||’‘(可无)|
|column|表单参数|Array|||
> option-option-column参数
|属性|说明|类型|可选值|默认值|
|:--:|--|--|:--:|:--:|
|prop|字段名|String|||
|props||Object||{label: 'name',value: 'id',children: 'children'}|
|label|中文名|String|||
|show|是否显示|Boolean|true/false|true|
|type|是否需要取字典值|String|||'dic'|
|dicData|字典值|Array||||
|slot|是否自定义|Boolean||false|
|slotLabel|label是否自定义|Boolean||false|
|callback|判断条件是否显示|Function(row){}|||
|span|表单栅列|Number||24|<file_sep>/src/views/hrms/TrainingAssessment/AssessmentManagement/ExaminationTab/options.js
const dictsMap = {
status: {
0: '考核中',
1: '考核完成',
2: '已过期',
},
scoringMethod: {
1: '平均分',
2: '去掉最高最低平均分',
},
}
const columnsMap = [
{
prop: 'userName',
label: '被考核人',
},
{
prop: 'kpiName',
label: '考核名称',
},
{
prop: 'time',
label: '考核时间',
},
{
prop: 'status',
label: '考核状态',
type: 'dict',
width: '200px',
},
{
prop: 'score',
label: '考核分值',
width: '200px',
},
]
const initFormData = () => {
return {
coverId: '',
kpiType: 1,
score: '',
evaluate: '',
kpiRelations: [], // checkId score
}
}
const rules = {
score: [
{ required: true, message: '必填', trigger: 'blur' },
],
evaluate: [
{ required: true, message: '必填', trigger: 'blur' },
],
}
const initSearchForm = () => {
return {
name: '',
assessName: '',
}
}
export { dictsMap, columnsMap, initFormData, initSearchForm, rules }<file_sep>/src/views/goms/BasicConfiguration/DictionaryManagement/options.js
const columnsMap = [
{
prop: 'id',
label: '序号',
width: '55',
},
{
prop: 'code',
label: '字典编码',
},
{
prop: 'name',
label: '字典名称',
},
{
prop: 'system',
label: '所属系统',
},
{
prop: 'createTime',
label: '创建时间',
},
{
prop: 'updateTime',
label: '更新时间',
},
]
const _initRow = (id) => {
return {
dictId: id,
parentId: null,
id: null,
sort: 1,
label: '',
value: '',
}
}
const initMemberForm = () => {
return {
code: '',
createTime: '',
id: '',
name: '',
system: '',
updateTime: '',
}
}
const initSearchForm = () => {
return {
code: '',
name: '',
system: '',
}
}
export { columnsMap, initMemberForm, _initRow, initSearchForm }<file_sep>/src/views/hrms/OrganizationalStructure/JobTitleSystem/JobSystem/options.js
const columnsMap = [
{
prop: 'name',
label: '职务名称',
width: 200,
},
{
prop: 'description',
label: '职务说明',
},
{
prop: 'priority',
label: '优先级',
width: 100,
},
]
const initForm = () => {
return {
id: '',
name: '',
description: '',
priority: '',
}
}
const initSearchForm = () => {
return {
name: '',
}
}
export { columnsMap, initForm, initSearchForm }
<file_sep>/src/api/conm/index.js
import request from '@/router/axios'
const prefixUrl = '/cms/info_site'
// @/api/conm/index
//站点管理控制器
export function getPageById (id) {
return request({
url: `${prefixUrl}/${id}`,
method: 'get',
})
}
export function getStationManagementPage () {
return request({
url: `${prefixUrl}/page`,
method: 'get',
})
}
export function postStationManagementCreate (obj) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: obj,
})
}
export function deleteStationManagement (id) {
return request({
url: `${prefixUrl}/delete/${id}`,
method: 'post',
})
}
export function updateStationManagement (obj) {
return request({
url: `${prefixUrl}/update`,
method: 'post',
data: obj,
})
}<file_sep>/src/api/goms/union_album.js
import request from '@/router/axios'
const prefixUrl = '/admin/union/album'
// 组织相册
export function getAlbumPage (query) {
return request({
url: `${prefixUrl}/page`,
method: 'get',
params: query,
})
}
// 修改
export function putAlbum (data) {
return request({
url: '/admin/org_album/update',
method: 'post',
data: data,
})
}
// 新增
export function postAlbum (data) {
return request({
url: `${prefixUrl}/create`,
method: 'post',
data: data,
})
}
// 删除
export function deleteAlbum (id) {
return request({
url: `/admin/org_album/delete/${id}`,
method: 'post',
})
}
<file_sep>/src/api/fams/statistics.js
import request from '@/router/axios'
const prefixUrl = '/fams/statistics'
// @/api/fams/statistics
export function getAssetsByDate (obj) {
return request({
url: `${prefixUrl}/assets`,
method: 'post',
data: obj,
})
}
export function getGroupAssetsByDate (obj) {
return request({
url: `${prefixUrl}/group/assets`,
method: 'post',
data: obj,
})
}
export function getPendingPage (query) {
return request({
url: `${prefixUrl}/pending/page`,
method: 'get',
params: query,
})
}
// 取 3 条
export function getBudgetList () {
return request({
url: `${prefixUrl}/budget/list`,
method: 'get',
})
}
export function getBossBudgetList (id) {
return request({
url: `${prefixUrl}/all/budget/list/${id}`,
method: 'get',
})
}
// 取 3 条
export function getOrgBudgetList (type) {
return request({
url: `${prefixUrl}/org/budget/list/${type}`,
method: 'get',
})
}
// 现金财务日记账
export function getCashDiaryList (query) {
return request({
url: `${prefixUrl}/org/cash/diary/list`,
method: 'get',
params: query,
})
}
// 银行财务日记账
export function getBankDiaryList (query) {
return request({
url: `${prefixUrl}/org/bank/diary/list`,
method: 'get',
params: query,
})
}
// 支出 统计 类型 1-月 2-季 3-年
export function getExpenditureList (type) {
return function (query) {
return request({
url: `${prefixUrl}/org/expenditure/list`,
method: 'post',
data: {
...query,
type,
},
})
}
}
// 收入 统计 类型 1-月 2-季 3-年
export function getIncomeList (type) {
return function (query) {
return request({
url: `${prefixUrl}/org/income/list`,
method: 'post',
data: {
...query,
type,
},
})
}
}
export function getProjectPage (query) {
return request({
url: `${prefixUrl}/project/page`,
method: 'get',
params: query,
})
}
export function getProjectPageByOrgId (orgId) {
return function (query) {
return request({
url: `${prefixUrl}/project/page/${orgId}`,
method: 'get',
params: query,
})
}
}
// TODO:联盟项目核算
export function getAllOrgProjectPage () {
return request({
url: `${prefixUrl}/all/project/page`,
method: 'get',
})
}
export function getContractPage (query) {
return request({
url: `${prefixUrl}/contract/page`,
method: 'get',
params: query,
})
}
export function getProjectDetailById (id) {
return request({
url: `${prefixUrl}/project/detail/${id}`,
method: 'get',
})
}
export function getProjectDetailPageById (id, isIncome) {
return request({
url: `${prefixUrl}/project/detail/page/${id}`,
method: 'get',
params: {
isIncome,
},
})
}
export function getProjectInformationById (id) {
return request({
url: `fams/iepProjectInformation/${id}`,
method: 'get',
})
}
export function getUnionProjectPage (query) {
return request({
url: `${prefixUrl}/business_index/page`,
method: 'get',
params: query,
})
}
export function getOrgProjectPage (query) {
return request({
url: `${prefixUrl}/business_index/org/page`,
method: 'get',
params: query,
})
}
export function putUnionProject (obj) {
return request({
url: `${prefixUrl}/update/business_index`,
method: 'post',
data: obj,
})
}
export function createUnionProject (year) {
return request({
url: `${prefixUrl}/create/business_index/${year}`,
method: 'get',
})
}
// 组织资产
export function getAssetsList () {
return request({
url: `${prefixUrl}/org/assets/list`,
method: 'get',
})
}
export function getAssetDataById (id) {
return request({
url: `${prefixUrl}/org/assets/${id}`,
method: 'get',
})
}
// 组织资产统计排名
export const getOrgAssetsById = (id) => {
return request({
url: `${prefixUrl}/org/assets_ranking/${id}`,
method: 'get',
})
}
// 组织资产统计排名
export const getOrgProfits = (orgId, year) => {
return request({
url: `${prefixUrl}/org/profits/losses`,
method: 'get',
params: {
orgId,
year,
},
})
}
// 集团资产统计排名
export const getUnionProfits = (year, month) => {
return request({
url: `${prefixUrl}/group/profits/losses`,
method: 'get',
params: {
month,
year,
},
})
}
// 集团货币基金公司
export const getCompanyCurrencyFund = (yearMonth) => {
return request({
url: `${prefixUrl}/company/balance`,
method: 'get',
params: {
month: yearMonth,
},
})
}
// 集团货币基金公司详情
export const getCompanyCurrencyFundDetail = (id) => {
return request({
url: `${prefixUrl}/company/detail`,
method: 'get',
params: {
companyId: id,
},
})
}
// 集团货币基金账户
export const getBankCurrencyFund = (yearMonth) => {
return request({
url: `${prefixUrl}/bank/balance`,
method: 'get',
params: {
month: yearMonth,
},
})
}
// 集团货币基金账户详情
export const getBankCurrencyFundDetail = (id) => {
return request({
url: `${prefixUrl}/bank/detail`,
method: 'get',
params: {
accountId: id,
},
})
}
// 个人账户分页
export const getPersonalPage = (query) => {
return request({
url: `${prefixUrl}/personal/page`,
method: 'get',
params: query,
})
}
// 组织账户分页
export const getOrgAccountList = () => {
return request({
url: `${prefixUrl}/org/statistics/list`,
method: 'get',
})
}
// 费用明细
export const getCostListByOrgId = (query) => {
return request({
url: `${prefixUrl}/org/cost/list`,
method: 'get',
params: query,
})
}<file_sep>/src/api/crms/contact.js
import request from '@/router/axios'
const crmsUrl = '/crm/contact'
export function fetchList (query) {
return request({
url: `${crmsUrl}/page`,
method: 'get',
params: query,
})
}
export function createData (obj) {
return request({
url: `${crmsUrl}/create`,
method: 'post',
data: obj,
})
}
export function updateData (obj) {
return request({
url: `${crmsUrl}/update`,
method: 'post',
data: obj,
})
}
export function deleteDataById (id) {
return request({
url: `${crmsUrl}/delete/batch/${id}`,
method: 'post',
})
}
export function getContactById (id) {
return request({
url: `${crmsUrl}/${id}`,
method: 'get',
})
}
export function getContactAssociate (query) {
return request({
url: `${crmsUrl}/associate`,
method: 'get',
params: query,
})
}
|
038e1d14d34fe77e49771816173f3e1c1bbcc8ba
|
[
"JavaScript",
"Markdown",
"Shell"
] | 337 |
JavaScript
|
Lanseria/iep-ui
|
6a569e49d1f3c9cd027b314d3f0c3ba6e5f0fc71
|
7cd33dcd653dd1fb097796fbd1f4403645405c7e
|
refs/heads/00_simple
|
<repo_name>MIPSfpga/schoolMIPS<file_sep>/scripts/init_linux.sh
#!/bin/bash
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
TOP_BOARD=$SCRIPTPATH/../board
TOP_PROGRAM=$SCRIPTPATH/../program
for board in $TOP_BOARD/*
do
if [ -d $board ] && [ "$TOP_BOARD/program" != "$board" ]; then
rm -f $board/*.bat
cp $SCRIPTPATH/board/common/*.sh $board
chmod a+x $board/*.sh
fi
done
for program in $TOP_PROGRAM/*
do
if [ -d $program ]; then
rm -f $program/*.bat
cp $SCRIPTPATH/program/common/*.sh $program
chmod a+x $program/*.sh
fi
done
<file_sep>/board/marsohod_3/make_project.sh
#!/bin/bash
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
PROJECTPATH=$SCRIPTPATH/project
rm -rf $PROJECTPATH
mkdir $PROJECTPATH
cp $SCRIPTPATH/*.qpf $PROJECTPATH
cp $SCRIPTPATH/*.qsf $PROJECTPATH
cp $SCRIPTPATH/*.sdc $PROJECTPATH
<file_sep>/program/00_counter/03_simulate_with_modelsim.sh
#!/bin/bash
rm -rf sim
mkdir sim
cd sim
cp ../*.hex .
vsim -novopt -do ../modelsim_script.tcl
cd ..
<file_sep>/README.md
# schoolMIPS
A small MIPS CPU core originally based on Sarah L. Harris MIPS CPU ("Digital Design and Computer Arhitecture" by <NAME> and <NAME>). The first version of schoolMIPS was written for [Young Russian Chip Architects](http://www.silicon-russia.com/2017/06/09/arduino-and-fpga/) summer school.
Next version of schoolMIPS is based on RISC-V architecture: [schoolRISCV](https://github.com/zhelnio/schoolRISCV)
The CPU have several versions (from simple to complex). Each of them is placed in the separate git branch:
- **00_simple** - the simplest CPU without data memory, programs compiled with GNU gcc;
- **01_mmio** - the same but with data memory, simple system bus and peripherals (pwm, gpio, als);
- **01_mmio_sv_dpi** - the same but with data memory, simple system bus and peripherals (pwm, gpio, als);
- **02_irq** - data memory, system timer, interrupts and exceptions (CP0 coprocessor);
- **03_pipeline** - the pipelined version of the simplest core with data memory
- **04_pipeline_irq** - the pipelined version of 02_irq
Examples of using this kernel as an element of a multiprocessor system:
1. <NAME>, <NAME>, <NAME>, Development of multiprocessor system-on-chip based on soft processor cores schoolMIPS, J. Phys. Conf. Ser. 1163 (2019) 012026. [doi:10.1088/1742-6596/1163/1/012026](https://iopscience.iop.org/article/10.1088/1742-6596/1163/1/012026).
2. [Innovate FPGA 2019 project: EM028 » NoC-based multiprocessing system prototype](http://www.innovatefpga.com/cgi-bin/innovate/teams.pl?Id=EM028)
For docs and CPU diagrams please visit the project [wiki](https://github.com/MIPSfpga/schoolMIPS/wiki)

<file_sep>/board/rz_easyFPGA_A2.1/README.md
# RZ-EasyFPGA A2.1 (Altera Cyclone IV)
Thanks to [@woodywitch](https://github.com/woodywitch) and [@Dluzhnevsky](https://github.com/Dluzhnevsky) for this port.
## Used pins
Pin | Name | Description
--- | ---- | -----------
pin_23 | CLK100MHZ | system clock
pin_25 | KEY0 | system reset
pin_88 | KEY1 | clock enable
pin_87:84 | LED1-LED4 | system output
## Board photo

## Board pinout

<file_sep>/doc/README.md
For docs and CPU diagrams please visit the project [wiki](https://github.com/MIPSfpga/schoolMIPS/wiki)
<file_sep>/program/01_fibonacci/02_compile_to_hex_with_mars.sh
#!/bin/bash
java -jar ../../scripts/bin/Mars4_5.jar nc a dump .text HexText program.hex main.S
<file_sep>/scripts/program/common/00_clean_all.sh
#!/bin/bash
rm -rf sim
rm -f program.hex
<file_sep>/scripts/program/common/04_simulate_with_icarus.sh
#!/bin/bash
rm -rf sim
mkdir sim
cd sim
cp ../*.hex .
# default simulation params
SIMULATION_CYCLESS=120
# read local simulation params
source ../icarus.cfg
# compile
iverilog -g2005 -D SIMULATION -D ICARUS -I ../../../src -I ../../../testbench -s sm_testbench ../../../src/*.v ../../../testbench/*.v
# simulation
vvp -la.lst -n a.out -vcd
# output
gtkwave dump.vcd
cd ..
<file_sep>/board/max_10_evkit/README.md
# MAX 10 FPGA Evaluation Kit
## Описание платы
Max 10 FPGA Evaluation Kit отладочная плата компании Intel начального уровня. В плате используется микросхема 10M08SAE144C8G серии MAX 10.

Плата включает следующие компоненты:
- Микросхема серии MAX10 FPGA
- Intel Enpirion® EP5388QI DC-DC понижающий преобразователь
- JTAG разъем для программирования платы
- Тактовый генератор на 50МГц
- АЦП встроенный в микросхему MAX 10
- Переключатели, кнопки, перемычки и сигнальные светодиоды
- Пробная точка для измерения питания микросхемы
- Разъемы формата Arduino UNO для подключения переферии
- Отверстия GPIO для подключения переферии
- Mini-USB разъем для питания платы

Для программирования платы используется внешний программатор, подключаемый через JTAG разъем.

## Ссылки
1. [Страница с описание платы MAX 10 FPGA Evaluation Kit на сайте Intel](https://www.intel.com/content/www/us/en/programmable/products/boards_and_kits/dev-kits/altera/kit-max-10-evaluation.html#Contents)
2. [Руководство пользователя платы MAX 10 FPGA Evaluation Kit](https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/ug/ug_max10_eval_10m80.pdf)
<file_sep>/scripts/program/common/05_copy_program_to_board.sh
#!/bin/bash
rm -f ../../board/program/program.hex
cp ./program.hex ../../board/program
<file_sep>/program/01_fibonacci/01_run_mars.sh
#!/bin/bash
java -jar ../../scripts/bin/Mars4_5.jar &
<file_sep>/board/de0_nano/README.md
# Terasic DE0-Nano (Altera Cyclone IV)
Thanks to [@dbkudryavtsevEduHSE](https://github.com/dbkudryavtsevEduHSE) for this port.
## Used pins
Pin | Name | Description
--- | ---- | -----------
pin_r8 | FPGA_CLK1_50 | system clock
pin_j15 | KEY0 | system reset
pin_e1 | KEY1 | clock enable
pin_a15, a13, b13, a11, s1, f3, b1, l3 | LED0-LED7 | system output
pin_m1, t8, b9, m15|SW0-SW3|
## Board photo

## Board pinout


|
6f517dd0c3652a26a646a47dcb3e94a17ae42ff7
|
[
"Markdown",
"Shell"
] | 13 |
Shell
|
MIPSfpga/schoolMIPS
|
4d0432678cc80d952801fb184c99121355a2f379
|
ecc0045624411684d145c987677091e9519c7e75
|
refs/heads/master
|
<repo_name>GUZHIYAO1234/Tjombol<file_sep>/app/src/main/java/com/example/tjombol/SignupStep1Fragment.java
package com.example.tjombol;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
public class SignupStep1Fragment extends Fragment {
EditText nameEditText;
EditText emailEditText;
EditText passwordEditText;
Button signupButton;
Button goToLoginButton;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
ViewGroup view = (ViewGroup) inflater.inflate(R.layout.fragment_signup_step1, container, false);
goToLoginButton = view.findViewById(R.id.goToLoginButton);
goToLoginButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getActivity(), Login.class);
startActivity(intent);
}
});
signupButton = view.findViewById(R.id.signupButton);
signupButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewPager vp = getActivity().findViewById(R.id.nonSwipeViewPager);
vp.setCurrentItem(vp.getCurrentItem()+1);
}
});
String text = "<font color=#ffffff>Already have an account? </font> <font color=#67d6d3>Log In</font>";
goToLoginButton.setText(Html.fromHtml(text));
nameEditText = view.findViewById(R.id.nameSignupEditText);
emailEditText = view.findViewById(R.id.emailSignupEditText);
passwordEditText = view.findViewById(R.id.passwordSignupEditText);
return view;
}
}
<file_sep>/app/src/main/java/com/example/tjombol/SignupStep2Fragment.java
package com.example.tjombol;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
public class SignupStep2Fragment extends Fragment {
Button signup2Button;
Button backButtonSignup2;
EditText mobileNumberSignupEditText;
EditText nricSignupEditText;
EditText bankNumberSignupEditText;
EditText companyIdSignupEditText;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
ViewGroup view = (ViewGroup) inflater.inflate(R.layout.fragment_signup_step2, container, false);
mobileNumberSignupEditText = view.findViewById(R.id.mobileNumberSignupEditText);
nricSignupEditText = view.findViewById(R.id.nricSignupEditText);
bankNumberSignupEditText = view.findViewById(R.id.bankNumberSignupEditText);
companyIdSignupEditText = view.findViewById(R.id.bankNumberSignupEditText);
signup2Button = view.findViewById(R.id.signup2Button);
signup2Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewPager vp = getActivity().findViewById(R.id.nonSwipeViewPager);
vp.setCurrentItem(vp.getCurrentItem()+1);
}
});
backButtonSignup2 = view.findViewById(R.id.backButtonSignup2);
backButtonSignup2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewPager vp = getActivity().findViewById(R.id.nonSwipeViewPager);
vp.setCurrentItem(vp.getCurrentItem()-1);
}
});
return view;
}
}
<file_sep>/app/src/main/java/com/example/tjombol/SignupStep3Fragment.java
package com.example.tjombol;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
public class SignupStep3Fragment extends Fragment {
Button signup3Button;
Button backButtonSignup3;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
ViewGroup view = (ViewGroup) inflater.inflate(R.layout.fragment_signup_step3, container, false);
signup3Button = view.findViewById(R.id.signup3Button);
signup3Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewPager vp = getActivity().findViewById(R.id.nonSwipeViewPager);
vp.setCurrentItem(vp.getCurrentItem()+1);
}
});
backButtonSignup3 = view.findViewById(R.id.backButtonSignup3);
backButtonSignup3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewPager vp = getActivity().findViewById(R.id.nonSwipeViewPager);
vp.setCurrentItem(vp.getCurrentItem()-1);
}
});
return view;
}
}
|
c5a23b9cd961a1aac95ce349ee5e4b95e7c1173e
|
[
"Java"
] | 3 |
Java
|
GUZHIYAO1234/Tjombol
|
8e99e0c2f1e949a59b30f70c01858892d09a2c69
|
e55c2f53589da8cf9baebea0d54e84ac4d643128
|
refs/heads/master
|
<repo_name>DavidRandell/BerlinClock-js<file_sep>/src/BerlinClock.js
var BerlinClock = {
tick: function(){
var time = new Date(),
second = time.getSeconds();
BerlinClock.updateSeconds(second);
},
updateSeconds: function(second){
var secondsDiv = document.getElementById("seconds").children[0];
secondsDiv.classList.add("yellow");
},
updateHours: function(hour){
},
updateMinutes: function(minute){
},
updateClock: function(hour, minute, second){
},
reset: function(){
}
}
|
0341a7374611d31da59ed96326d2779f16a0a1bb
|
[
"JavaScript"
] | 1 |
JavaScript
|
DavidRandell/BerlinClock-js
|
04b8ea3ae5cfd38efc90b4f91b6aca02e3d51cb6
|
4f89f0e1f12b7042c0a2d05f3ff6dac2f0803394
|
refs/heads/master
|
<file_sep>package io.github.hashim.workoutTrainer.Activities;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.InterstitialAd;
import com.google.android.gms.ads.MobileAds;
import com.squareup.picasso.Picasso;
import androidx.appcompat.app.AppCompatActivity;
import io.github.hashim.workoutTrainer.ArmWorkout.ArmInstructionsActivity;
import io.github.hashim.workoutTrainer.ArmWorkout.ListOfArmExerciseActivity;
import io.github.hashim.workoutTrainer.ButtWorkout.ButtInstructionsActivity;
import io.github.hashim.workoutTrainer.ButtWorkout.ListOfButtExerciseActivity;
import io.github.hashim.workoutTrainer.ClassicWorkout.ClassicInstructionsActivity;
import io.github.hashim.workoutTrainer.ClassicWorkout.ListOfExerciseActivity;
import io.github.hashim.workoutTrainer.LegWorkout.LegInstructionsActivity;
import io.github.hashim.workoutTrainer.LegWorkout.ListOfLegExerciseActivity;
import io.github.hashim.workoutTrainer.R;
import io.github.hashim.workoutTrainer.AbsWorkout.AbsInstructionsActivity;
import io.github.hashim.workoutTrainer.AbsWorkout.ListOfAbsExercisesActivity;
public class MainActivity extends AppCompatActivity {
private InterstitialAd mInterstitialAd;
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MobileAds.initialize(this, "ca-app-pub-7407537444619255~6230610124");
mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.setAdUnitId("ca-app-pub-7407537444619255/2377079305");
mInterstitialAd.loadAd(new AdRequest.Builder().build());
AdView mAdView = findViewById(R.id.adMainView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
ImageView imageView = findViewById(R.id.imageView);
Picasso.get().load(R.drawable.workout).into(imageView);
ImageView absImage =findViewById(R.id.absImg);
Picasso.get().load(R.drawable.absworkout).into(absImage);
ImageView armImage =findViewById(R.id.armImg);
Picasso.get().load(R.drawable.arms).into(armImage);
ImageView buttImage =findViewById(R.id.ButtImg);
Picasso.get().load(R.drawable.butts).into(buttImage);
ImageView LegImage =findViewById(R.id.legImg);
Picasso.get().load(R.drawable.leg_workout).into(LegImage);
androidx.appcompat.widget.Toolbar toolbar =findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle("8 MINUTES");
toolbar.setTitleTextColor(Color.parseColor("#ffffff"));
Button btnClassicInstructions =findViewById(R.id.btnInstructions);
btnClassicInstructions.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this,ClassicInstructionsActivity.class);
startActivity(intent);
}
});
Button btnStart = findViewById(R.id.btnStart);
btnStart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
mInterstitialAd.setAdListener(new AdListener(){
@Override
public void onAdClosed() {
Intent intent = new Intent(MainActivity.this, ListOfExerciseActivity.class);
startActivity(intent);
}
});
} else {
Intent intent = new Intent(MainActivity.this, ListOfExerciseActivity.class);
startActivity(intent);
}
}
});
Button btnAbsInstructions = findViewById(R.id.btnAbsInstructions);
btnAbsInstructions.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this, AbsInstructionsActivity.class);
startActivity(intent);
}
});
Button btnAbsStart = findViewById(R.id.btnAbsStart);
btnAbsStart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
mInterstitialAd.setAdListener(new AdListener(){
@Override
public void onAdClosed() {
Intent intent = new Intent(MainActivity.this, ListOfAbsExercisesActivity.class);
startActivity(intent);
}
});
} else {
Intent intent = new Intent(MainActivity.this, ListOfAbsExercisesActivity.class);
startActivity(intent);
}
}
});
Button btnArmStart = findViewById(R.id.btnArmStart);
btnArmStart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
mInterstitialAd.setAdListener(new AdListener(){
@Override
public void onAdClosed() {
Intent intent = new Intent(MainActivity.this, ListOfArmExerciseActivity.class);
startActivity(intent);
}
});
} else {
Intent intent = new Intent(MainActivity.this, ListOfArmExerciseActivity.class);
startActivity(intent);
}
}
});
Button btnArmInstructions = findViewById(R.id.btnArmInstructions);
btnArmInstructions.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this, ArmInstructionsActivity.class);
startActivity(intent);
}
});
Button btnButtStart = findViewById(R.id.btnButtStart);
btnButtStart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) { if (mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
mInterstitialAd.setAdListener(new AdListener(){
@Override
public void onAdClosed() {
Intent intent = new Intent(MainActivity.this, ListOfButtExerciseActivity.class);
startActivity(intent);
}
});
} else {
Intent intent = new Intent(MainActivity.this, ListOfButtExerciseActivity.class);
startActivity(intent);
}
}
});
Button btnButtInstructions = findViewById(R.id.btnButtInstructions);
btnButtInstructions.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this, ButtInstructionsActivity.class);
startActivity(intent);
}
});
Button btnLegStart = findViewById(R.id.btnLegStart);
btnLegStart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
mInterstitialAd.setAdListener(new AdListener(){
@Override
public void onAdClosed() {
Intent intent = new Intent(MainActivity.this, ListOfLegExerciseActivity.class);
startActivity(intent);
}
});
} else {
Intent intent = new Intent(MainActivity.this, ListOfLegExerciseActivity.class);
startActivity(intent);
}
}
});
Button btnLegInstructions = findViewById(R.id.btnLegInstructions);
btnLegInstructions.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this, LegInstructionsActivity.class);
startActivity(intent);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.options_menus,menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.instructions:
Intent intent = new Intent(MainActivity.this
, AllInstructionsActivity.class);
startActivity(intent);
return true;
case R.id.about:
Intent intent1 = new Intent(MainActivity.this
, AboutUsActivity.class);
startActivity(intent1);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}
<file_sep>package io.github.hashim.workoutTrainer.ClassicWorkout;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.media.MediaPlayer;
import android.os.CountDownTimer;
import android.speech.tts.TextToSpeech;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ProgressBar;
import android.widget.TextView;
import java.util.Locale;
import io.github.hashim.workoutTrainer.R;
import pl.droidsonroids.gif.GifImageView;
public class ClassicExerciseActivity extends AppCompatActivity implements TextToSpeech.OnInitListener {
int progress;
TextToSpeech textToSpeech;
public String tempSpeech;
public TextView num;
public ImageButton skip;
public TextView ready;
public TextView exeName;
public ProgressBar progressBar;
public int exeRestNum = 0;
public int exeNum = 0;
public MediaPlayer mp ;
int hash=0;
Boolean goToInstructions = false ;
CountDownTimer countDownTimer;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_classic_exercise);
androidx.appcompat.widget.Toolbar toolbar =findViewById(R.id.classicToolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle("Classic");
toolbar.setTitleTextColor(Color.parseColor("#ffffff"));
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AlertDialogCreate();
}
});
textToSpeech = new TextToSpeech(ClassicExerciseActivity.this, ClassicExerciseActivity.this);
setUpUI(16000);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.instructions_menu, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_instructions:
AlertDialogCreate();
goToInstructions = true;
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@Override
public void onDestroy() {
countDownTimer.cancel();
textToSpeech.shutdown();
super.onDestroy();
}
@Override
public void onBackPressed() {
AlertDialogCreate();
}
public void setUpUI(final long startTime)
{
exeName = findViewById(R.id.exerciseName);
num = findViewById(R.id.tvNum);
ready = findViewById(R.id.ready);
skip = findViewById(R.id.skip);
progressBar = findViewById(R.id.progressBar);
GifImageView gifImageView = findViewById(R.id.gifImageView);
progressBar.setProgress(0);
final long time = startTime;
if (startTime == 16000)
{
if (exeRestNum == 0) {
ready.setText("Make Yourself Ready !");
setTempSpeech("Make yourself ready . exercise 1 of 13 Jumping jacks ");
speek();
} else if (exeRestNum == 1) {
ready.setText("Make Yourself Ready !");
exeName.setText("2/13 WALL SIT");
gifImageView.setImageResource(R.drawable.wallsit1);
setTempSpeech("Take Rest Make yourself ready . exercise 2 of 13 wall sit");
speek();
} else if (exeRestNum == 2) {
ready.setText("Make Yourself Ready !");
exeName.setText("3/13 PUSH UPS");
gifImageView.setImageResource(R.drawable.pushup);
setTempSpeech("Take rest Make yourself ready . exercise 3 of 13 push ups");
speek();
} else if (exeRestNum == 3) {
ready.setText("Make Yourself Ready !");
gifImageView.setImageResource(R.drawable.abdominalescrunch);
exeName.setText("4/13 Abdominal Crunchs");
setTempSpeech("Take rest Make yourself ready . exercise 4 of 13 Abdominal Crunchs");
speek();
} else if (exeRestNum == 4) {
ready.setText("Make Yourself Ready !");
gifImageView.setImageResource(R.drawable.stepup);
exeName.setText("5/13 STEP UP's");
setTempSpeech("take rest Make yourself ready . exercise 5 of 13 Step ups you can use chair");
speek();
} else if (exeRestNum == 5) {
ready.setText("Make Yourself Ready !");
exeName.setText("6/13 SQUATS");
gifImageView.setImageResource(R.drawable.squats);
setTempSpeech("take rest Make yourself ready . exercise 6 of 13 squats");
speek();
} else if (exeRestNum == 6) {
ready.setText("Make Yourself Ready !");
exeName.setText("7/13 TRICEPS DIPS");
gifImageView.setImageResource(R.drawable.tricepsdips);
setTempSpeech("take rest Make yourself ready . exercise 7 of 13 triceps dips");
speek();
} else if (exeRestNum == 7) {
ready.setText("Make Yourself Ready !");
exeName.setText("8/13 PLANK");
gifImageView.setImageResource(R.drawable.plank);
setTempSpeech("take rest Make yourself ready . exercise 8 of 13 Plank");
speek();
} else if (exeRestNum == 8) {
ready.setText("Make Yourself Ready !");
exeName.setText("9/13 HIGH STEPPING");
gifImageView.setImageResource(R.drawable.highknees);
setTempSpeech("take rest Make yourself ready . exercise 9 of 13 high stepping");
speek();
} else if (exeRestNum == 9) {
ready.setText("Make Yourself Ready !");
exeName.setText("10/13 LUNGES");
gifImageView.setImageResource(R.drawable.lunge);
setTempSpeech("take rest Make yourself ready . exercise 10 of 13 lunges");
speek();
} else if (exeRestNum == 10) {
ready.setText("Make Yourself Ready !");
exeName.setText("11/13 PUSH-UP & ROTATION");
gifImageView.setImageResource(R.drawable.pushuprotaion);
setTempSpeech("take rest Make yourself ready . exercise 11 of 13 Push ups and rotation");
speek();
} else if (exeRestNum == 11) {
ready.setText("Make Yourself Ready !");
exeName.setText("12/13 SIDE PLANK RIGHT");
gifImageView.setImageResource(R.drawable.sideplankright);
setTempSpeech("Make yourself ready . exercise 12 of 13 Side plank right");
speek();
} else if (exeRestNum == 12) {
ready.setText("Make Yourself Ready !");
exeName.setText("13/13 SIDE PLANK LEFT");
gifImageView.setImageResource(R.drawable.sideplank);
setTempSpeech("Make yourself ready . exercise 13 of 13 side plank left");
speek();
} else {
CongoDialogCreate();
}
}
if (startTime == 31000) {
mp = MediaPlayer.create(getApplicationContext(), R.raw.whistle_sound);
mp.start();
}
countDownTimer = new CountDownTimer(time, 1000)
{
private void endSpeeking(){
cancel();
}
@Override
public void onTick(long l) {
skip.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
hash=1;
}
});
if(hash==1){
cancel();
onFinish();
}
if(hash != 1) {
num.setText("" + l / 1000);
if (time == 16000) {
progress = (int) (progress + 6.7);
progressBar.setProgress(progress);
if (l / 1000 == 3) {
setTempSpeech("3");
speek();
}
if (l / 1000 == 2) {
setTempSpeech("2");
speek();
}
if (l / 1000 == 1) {
setTempSpeech("1");
speek();
}
} else {
if (l / 1000 == 15) {
setTempSpeech("half the time");
speek();
}
if (l / 1000 == 3) {
setTempSpeech("3");
speek();
}
if (l / 1000 == 2) {
setTempSpeech("2");
speek();
}
if (l / 1000 == 1) {
setTempSpeech("1");
speek();
}
progress = (int) (progress + 3.5);
progressBar.setProgress(progress);
}
}
}
@Override
public void onFinish() {
hash=0;
if (time == 16000) {
ready.setText("Start Exercise");
exeRestNum++;
num.setText("0");
progressBar.setProgress(100);
progress = 0;
setUpUI(31000);
}
if (time == 31000) {
ready.setText("Make Yourself Ready !");
exeNum++;
num.setText("0");
progressBar.setProgress(100);
progress = 0;
setUpUI(16000);
}
}
}.start();
}
public void speek() {
TextToSpeechFunction();
}
public void TextToSpeechFunction() {
String speech = getTempSpeech();
textToSpeech.speak(speech, TextToSpeech.QUEUE_FLUSH, null);
speech = "";
}
@Override
public void onInit(int Text2SpeechCurrentStatus) {
if (Text2SpeechCurrentStatus == TextToSpeech.SUCCESS) {
textToSpeech.setLanguage(Locale.US);
TextToSpeechFunction();
}
}
public String getTempSpeech() {
return tempSpeech;
}
public void setTempSpeech(String tempSpeech1) {
tempSpeech = tempSpeech1;
}
public void CongoDialogCreate(){
LayoutInflater factory = LayoutInflater.from(ClassicExerciseActivity.this);
final View view = factory.inflate(R.layout.sample, null);
new AlertDialog.Builder(ClassicExerciseActivity.this)
.setView(view)
.setPositiveButton("OK",null)
.setPositiveButton("ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
countDownTimer.cancel();
finish();
}
}).show();
}
public void AlertDialogCreate(){
new AlertDialog.Builder(ClassicExerciseActivity.this)
.setIcon(R.mipmap.ic_launcher)
.setTitle("8 MINUTES")
.setMessage("Are you sure Exit 8 MINUTES Workout ? ")
.setPositiveButton("OK", null)
.setNegativeButton("Cancel", null)
.setPositiveButton("OK", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
setTempSpeech("");
if (mp != null )
{
mp.stop();
mp.pause();
}
countDownTimer.cancel();
finish();
if (goToInstructions.booleanValue() == true ){
goToInstructions= false;
Intent intent = new Intent(ClassicExerciseActivity.this, ClassicInstructionsActivity.class);
startActivity(intent);
}
}
})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
}
}).show();
}
}
<file_sep>package io.github.hashim.workoutTrainer.ButtWorkout;
import android.content.Intent;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import io.github.hashim.workoutTrainer.R;
public class ListOfButtExerciseActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list_of_butt_exercise);
final AdView mAdView = findViewById(R.id.adButtView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
mAdView.setAdListener(new AdListener(){
@Override
public void onAdLoaded() {
mAdView.setVisibility(View.VISIBLE);
}
});
Button btnGo = findViewById(R.id.btnButtGO);
btnGo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(ListOfButtExerciseActivity.this,ButtExerciseActivity.class);
startActivity(intent);
finish();
}
});
}
}
<file_sep>package io.github.hashim.workoutTrainer.ButtWorkout;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.media.MediaPlayer;
import android.os.CountDownTimer;
import android.speech.tts.TextToSpeech;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ProgressBar;
import android.widget.TextView;
import java.util.Locale;
import io.github.hashim.workoutTrainer.R;
import pl.droidsonroids.gif.GifImageView;
public class ButtExerciseActivity extends AppCompatActivity implements TextToSpeech.OnInitListener {
int progress;
TextToSpeech textToSpeech;
public String tempSpeech;
public TextView num;
public ImageButton skip;
public TextView ready;
public TextView exeName;
public ProgressBar progressBar;
public int exeRestNum = 0;
public int exeNum = 0;
public MediaPlayer mp ;
int hash=0;
Boolean goToInstructions = false ;
CountDownTimer countDownTimer;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_butt_exercise);
androidx.appcompat.widget.Toolbar toolbar =findViewById(R.id.buttToolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle("Butt Workout");
toolbar.setTitleTextColor(Color.parseColor("#ffffff"));
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AlertDialogCreate();
}
});
textToSpeech = new TextToSpeech(ButtExerciseActivity.this, ButtExerciseActivity.this);
setUpUI(16000);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.instructions_menu, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_instructions:
AlertDialogCreate();
goToInstructions = true;
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@Override
public void onDestroy() {
countDownTimer.cancel();
textToSpeech.shutdown();
super.onDestroy();
}
@Override
public void onBackPressed() {
AlertDialogCreate();
}
public void setUpUI(final long startTime)
{
exeName = findViewById(R.id.buttExerciseName);
num = findViewById(R.id.tvButtNum);
ready = findViewById(R.id.buttReady);
skip = findViewById(R.id.buttSkip);
progressBar = findViewById(R.id.buttProgressBar);
GifImageView gifImageView = findViewById(R.id.gifButtImageView);
progressBar.setProgress(0);
final long time = startTime;
if (startTime == 16000)
{
if (exeRestNum == 0) {
ready.setText("Make Yourself Ready !");
exeName.setText("1/12 Squats");
gifImageView.setImageResource(R.drawable.squats);
setTempSpeech("Make yourself ready . exercise 1 of 12 squats ");
speek();
} else if (exeRestNum == 1) {
ready.setText("Make Yourself Ready !");
exeName.setText("2/12 Froggy Glute Lifts");
gifImageView.setImageResource(R.drawable.froggy_glute_lifts);
setTempSpeech("Take Rest Make yourself ready . exercise 2 of 12 froggy glute lifts");
speek();
} else if (exeRestNum == 2) {
ready.setText("Make Yourself Ready !");
exeName.setText("3/12 Lunges");
gifImageView.setImageResource(R.drawable.lunge);
setTempSpeech("Take rest Make yourself ready . exercise 3 of 12 lunges");
speek();
} else if (exeRestNum == 3) {
ready.setText("Make Yourself Ready !");
gifImageView.setImageResource(R.drawable.butt_bridge);
exeName.setText("4/12 Butt Bridge");
setTempSpeech("Take rest Make yourself ready . exercise 4 of 12 Butt Bridge");
speek();
} else if (exeRestNum == 4) {
ready.setText("Make Yourself Ready !");
gifImageView.setImageResource(R.drawable.donkey_kick);
exeName.setText("5/12 Donkey Kick Left");
setTempSpeech("take rest Make yourself ready . exercise 5 of 12 donkey kick left");
speek();
} else if (exeRestNum == 5) {
ready.setText("Make Yourself Ready !");
exeName.setText("6/12 Donkey Kick Right");
gifImageView.setImageResource(R.drawable.donkey_kick);
setTempSpeech("take rest Make yourself ready . exercise 6 of 12 donkey kick right");
speek();
} else if (exeRestNum == 6) {
ready.setText("Make Yourself Ready !");
exeName.setText("7/12 Split Squat Right");
gifImageView.setImageResource(R.drawable.split_squats);
setTempSpeech("take rest Make yourself ready . exercise 7 of 12 split squat right");
speek();
} else if (exeRestNum == 7) {
ready.setText("Make Yourself Ready !");
exeName.setText("8/12 Split Squat Left");
gifImageView.setImageResource(R.drawable.split_squats);
setTempSpeech("take rest Make yourself ready . exercise 8 of 12 split squat left");
speek();
} else if (exeRestNum == 8) {
ready.setText("Make Yourself Ready !");
exeName.setText("9/12 Booty Squeeze Left");
gifImageView.setImageResource(R.drawable.booty_squeeze);
setTempSpeech("take rest Make yourself ready . exercise 9 of 12 booty squeeze left");
speek();
} else if (exeRestNum == 9) {
ready.setText("Make Yourself Ready !");
exeName.setText("10/12 booty squeeze right");
gifImageView.setImageResource(R.drawable.booty_squeeze);
setTempSpeech("take rest Make yourself ready . exercise 10 of 12 booty squeeze right");
speek();
} else if (exeRestNum == 10) {
ready.setText("Make Yourself Ready !");
exeName.setText("11/12 Plie Squats");
gifImageView.setImageResource(R.drawable.plie_squats);
setTempSpeech("take rest Make yourself ready . exercise 11 of 12 plie squats");
speek();
} else if (exeRestNum == 11) {
ready.setText("Make Yourself Ready !");
exeName.setText("12/12 Sumo Squat Calf Raises");
gifImageView.setImageResource(R.drawable.sumo_squat_calf_raises);
setTempSpeech("Make yourself ready . exercise 12 of 12 sumo squat calf raises");
speek();
}
else {
CongoDialogCreate();
}
}
if (startTime == 31000) {
mp = MediaPlayer.create(getApplicationContext(), R.raw.whistle_sound);
mp.start();
}
countDownTimer = new CountDownTimer(time, 1000)
{
private void endSpeeking(){
cancel();
}
@Override
public void onTick(long l) {
skip.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
hash=1;
}
});
if(hash==1){
cancel();
onFinish();
}
if(hash != 1) {
num.setText("" + l / 1000);
if (time == 16000) {
progress = (int) (progress + 6.7);
progressBar.setProgress(progress);
if (l / 1000 == 3) {
setTempSpeech("3");
speek();
}
if (l / 1000 == 2) {
setTempSpeech("2");
speek();
}
if (l / 1000 == 1) {
setTempSpeech("1");
speek();
}
} else {
if (l / 1000 == 15) {
setTempSpeech("half the time");
speek();
}
if (l / 1000 == 3) {
setTempSpeech("3");
speek();
}
if (l / 1000 == 2) {
setTempSpeech("2");
speek();
}
if (l / 1000 == 1) {
setTempSpeech("1");
speek();
}
progress = (int) (progress + 3.5);
progressBar.setProgress(progress);
}
}
}
@Override
public void onFinish() {
hash=0;
if (time == 16000) {
ready.setText("Start Exercise");
exeRestNum++;
num.setText("0");
progressBar.setProgress(100);
progress = 0;
setUpUI(31000);
}
if (time == 31000) {
ready.setText("Make Yourself Ready !");
exeNum++;
num.setText("0");
progressBar.setProgress(100);
progress = 0;
setUpUI(16000);
}
}
}.start();
}
public void speek() {
TextToSpeechFunction();
}
public void TextToSpeechFunction() {
String speech = getTempSpeech();
textToSpeech.speak(speech, TextToSpeech.QUEUE_FLUSH, null);
speech = "";
}
@Override
public void onInit(int Text2SpeechCurrentStatus) {
if (Text2SpeechCurrentStatus == TextToSpeech.SUCCESS) {
textToSpeech.setLanguage(Locale.US);
TextToSpeechFunction();
}
}
public String getTempSpeech() {
return tempSpeech;
}
public void setTempSpeech(String tempSpeech1) {
tempSpeech = tempSpeech1;
}
public void CongoDialogCreate(){
LayoutInflater factory = LayoutInflater.from(ButtExerciseActivity.this);
final View view = factory.inflate(R.layout.sample, null);
new AlertDialog.Builder(ButtExerciseActivity.this)
.setView(view)
.setPositiveButton("OK",null)
.setPositiveButton("ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
countDownTimer.cancel();
finish();
}
}).show();
}
public void AlertDialogCreate(){
new AlertDialog.Builder(ButtExerciseActivity.this)
.setIcon(R.mipmap.ic_launcher)
.setTitle("8 MINUTES")
.setMessage("Are you sure Exit 8 MINUTES Workout ? ")
.setPositiveButton("OK", null)
.setNegativeButton("Cancel", null)
.setPositiveButton("OK", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
setTempSpeech("");
if (mp != null )
{
mp.stop();
mp.pause();
}
countDownTimer.cancel();
finish();
if (goToInstructions.booleanValue() == true ){
goToInstructions= false;
Intent intent = new Intent(ButtExerciseActivity.this, ButtInstructionsActivity.class);
startActivity(intent);
}
}
})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
}
}).show();
}
}
<file_sep>package io.github.hashim.workoutTrainer.Activities;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import io.github.hashim.workoutTrainer.R;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.Toast;
import com.firebase.ui.auth.AuthUI;
import com.firebase.ui.auth.IdpResponse;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import java.util.Arrays;
import java.util.List;
public class LoginActivity extends AppCompatActivity {
int RC_SIGN_IN = 1 ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
Button button = findViewById(R.id.btn_login_with_google);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Create and launch sign-in intent
List<AuthUI.IdpConfig> providers = Arrays.asList(
new AuthUI.IdpConfig.GoogleBuilder().build() );
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setIsSmartLockEnabled(false)
.setAvailableProviders(providers)
.build(),
RC_SIGN_IN);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
if (requestCode == RC_SIGN_IN){
IdpResponse response = IdpResponse.fromResultIntent(data);
if (resultCode == RESULT_OK) {
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
Log.i("HASH", user.getDisplayName());
Toast.makeText(LoginActivity.this, "User: " + user.getDisplayName(), Toast.LENGTH_LONG).show();
} else {
Log.i("HASH", "login failed");
Toast.makeText(LoginActivity.this, "Login failed", Toast.LENGTH_LONG).show();
}
}
}
}
<file_sep>package io.github.hashim.workoutTrainer.AbsWorkout;
import android.content.Intent;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import io.github.hashim.workoutTrainer.R;
public class ListOfAbsExercisesActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list_of_abs_exercises);
final AdView mAdView = findViewById(R.id.adAbsView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
mAdView.setAdListener(new AdListener(){
@Override
public void onAdLoaded() {
mAdView.setVisibility(View.VISIBLE);
}
});
Button btnGo = findViewById(R.id.btnAbsGO);
btnGo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(ListOfAbsExercisesActivity.this,AbsExerciseActivity.class);
startActivity(intent);
finish();
}
});
}
}
|
0fd33648f764006e34f428bdc5ea96bc8d0af19b
|
[
"Java"
] | 6 |
Java
|
hashimmirza/8-minutes
|
a908c52db8da12af877ec93dbe7bcec50e21a24e
|
230e942bf3886bc1241ccce0ce039ebd458fbfad
|
refs/heads/master
|
<file_sep>package com.company.shit;
public class PrintMatrix {
public static void main(String[] args) {
int[][] m = {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}};
for (int i = 0; i < m.length; i++) {
for (int j = 0; j < m[i].length; j++) {
System.out.print(m[i][j] + " ");
}
System.out.println();
}
}
}
/*
решение из серии "как вариант", но можно его улучшить, чтобы было более красиво,
попробуй сделать без массивов, тем более двумерных и с помощью одного цикла.
+ обрати внимание на текущий warning, как идея предлогает улучшить этот код
*/
|
b601ca9bf2fe5e82a045c3fb0eb3b8118fe1050c
|
[
"Java"
] | 1 |
Java
|
riwz/tasks
|
eace158d000d7432486a399ac85325b9a994ccc1
|
b20b05e8c15f0cdcb5b5ec7d443b323c7367da37
|
refs/heads/master
|
<repo_name>aaronarduino/templatestest<file_sep>/main.go
package main
import (
"bytes"
"fmt"
"html/template"
"io/ioutil"
"log"
)
type MainTemplate struct {
b bytes.Buffer
}
func (m *MainTemplate) exec(baseFile string, data PageData) {
t := template.New(baseFile)
t, err := t.ParseFiles("templates/" + baseFile)
if err != nil {
log.Println(err)
}
err = t.Execute(&m.b, data)
if err != nil {
log.Println(err)
}
}
func (m *MainTemplate) writeToBytes() []byte {
return m.b.Bytes()
}
func (m *MainTemplate) writeToString() string {
return m.b.String()
}
type PageData struct {
Message string
Title string
}
func main() {
data := PageData{Message: "Hello", Title: "title"}
mainTemp := MainTemplate{}
mainTemp.exec("index.html", data)
out := mainTemp.writeToBytes()
err := ioutil.WriteFile("index.html", out, 0644)
if err != nil {
log.Fatal(err)
}
log.Println("Done.")
fmt.Println()
fmt.Println(mainTemp.writeToString())
}
|
1fba3d668a46dd941ef444ea9c40a0e5a93129d1
|
[
"Go"
] | 1 |
Go
|
aaronarduino/templatestest
|
3f78c0c7914d8499661d5a01fef6339dee0d7c9f
|
d9c6655418f43623be9f9bec72668ccdb9d77892
|
refs/heads/master
|
<file_sep># Deployment of Machine learning models
## Introduction
This **Udemy** course is about how to migrate the models of Machine Learning models from the research stage to production so that they can be applied on live data to make predictions. This is called **Model Deployment**
## Motivation
At the level of a business, leveraging the power of Machine Learning models requires a full deployment in production.
Within a company **Model Deployment** requires the collaboration of:
* Data scientists
* IT teams
* Dev Ops
* Data engineers
* Software Developers
* Business professionals
As a **Junior Data Scientist**, I am taking this course to have an overview of the whole pipeline behind Machine Learning involving collaboration of different jobs within a company.
I will allow me to go through the entire life cycle of a machine learning models from research to production:
1. Building a model in notebooks
2. Change this code to production code
3. Discover several deployment solutions: **Paas**, **Iaas**
## Course steps
1. Machine Learning - **Pipeline Overview**
2. Machine Learning - **System Architecture**
3. Building a **reproducible ML pipeline**: from Jupyter notebooks to Production code
4. Course **setup and key tools**: environment, version control...
5. **ML Pipeline application** (Exercise using 3.)
6. Serving the Model via REST API: using **Flask**
7. **Continuous Integration and Deployment** using CicleCI
8. Differential **testing**
9. Deploy on a **PaaS**: **Heroku**
10. **Containerize the application** using **Docker**
11. Deploy on a **IaaS**:
**AWS**
12. Deploy with **Big Data** with **Deep Learning**
<file_sep># Procedural programming
Procedural programming, procedures, also known as routines, subroutines or functions, are carried out as a series of computational steps.
For us, it refers to writing the series of feature creation, feature transformation, model training and data scoring steps, as functions, that then we can call and run one after the other.
## Organization of the code
In procedural programming, the code is divided in three scripts:
1. **the functions (or procedures):** to create and transform features, and to train and save the models and make the predictions
2. **the training script:** calls the previous functions in order to train and save the models
3. **the scoring script:** calls the previous functions in order, to score new data
In addition to these three scripts, we typically include a yaml file where we gather:
- hard coded variables to engineer, and values to use to transform features
- hard coded paths to retrieve and store data
By changing these values, we ca re-adjust our models.
Let's make and overview of the advantages and disadvantages of **Procedural Programming**
## Advantages
- Straightforward from jupyter notebook
- No software development skills required
- Easy to manually check if it reproduces the original model
## Disadvantages
- The code is really prone to errors
- Difficult to test it
- Difficult to build a software on top of it
- Need to save a lot of intermediate fils to store the transformation parameters<file_sep># Section 11: Deploying with Containers (Docker)
## Plan
In this section, we are going to cover:
- What are containers? What is Docker?
- Why do we use Containers and Docker?
- Installing Docker
- Configuring Docker
- Basic Docker Demo Locally
- Deploying Docker Images to Heroku to enhance our already existing deployment process
## What is a Container?
A container is a standard unit of software that packages up code andd all its dependencies so the application runs quickly and reliably from one computing environment to another.
It is a sort of Operating System virtualization. The container includes everything we need to run our application.
## What is Docker?
- Docker is a tool to make creating, deploying, and running containers easy
- Docker is open source
- It has been released in 2013
- A Docker container is a standardized unit of software development, containing everything that your software application needs to run: code, runtime, system tools, system libraries, etc...
- Containers are created from a read-only template called an **image**: first we set up the instructions to create the image and then from that image, we create and run containers
## Containers VS Virtual Machines
The main difference between those two is that containers are more light-weight. You can more easily run many containers on your own operating machine.
## Why do we use containers
We use them for:
- **Reproducibility:** you know the steps for creating a given container, because of its **image** and the **Docker file** that gives us information about the dependencies, how the run time was created and what the settings are
- **Isolation:** you can easily tear down and speed back up containers
- **Simplicity of environment management:** Great for making staging and to check if UAT (User Acceptance Testing) matches production.
- **Continuous integration**: deploy quickly taking down existing containers, replacing them on a rolling basis
- Much faster and more **lightweight** than a Virtual Machine: Easy to speed them up
- **Container orchestration options**: for example Kubernetes. It allows to move containers in response to auto scaling events in response to deployment and if you have failures. In section 12, we will be working with AWS managed orchestration solution: the **elastic container service**
- Docker is the most popular tool for creating and running containers
## Key Learning Points
- Containerizing your applications brings a number of benefits: reproducibility, isolation, ease of environment management and more
- Containerization is not a silver bullet - not suitable for every use case (e.g. complex multiple OS requirements)
- Integrate your image building and deployments into you CI pipeline is important
## Resources
**DockerHub**: Docker platform with open source images
- We need to create an account
- We can check how the images are built
<file_sep># Section 12: Deploying with (aaS (AWS ECS)
## What we will be covering
- Overview of IaaS/AWS
- Risks and costs of using AWS
- Overview of the Elastic Container Service (ECS)
- Create the AWS account and permissions: identity and access management
- Upload Docker images to the Elastic container registry (ECR)
- Configure your ECS Cluster
- Deploy your cluster
- Automate the CI pipeline
## What is Infrastructure as a Service (IaaS)?
Compared to the Platform as a Service (PaaS) (ex: Heroku), with the IaaS, we are going to manage more things:
- Run time
- Middleware
- Operating System
Pros:
- Configure every aspect that is needed
- Scale to almost limitless size
Cons:
- Spend more time on configuration
## What is Amazon Web Services?
This is the cloud computing services owned by Amazon. It is the largest provider of cloud computing globally. They offer a vast range of services.
## AWS Elastic Container Service (ECS)
### What ECS?
"Amazon Elastic Container Service (Amazon ECS) is a highly scalable, fast, container management service that makes it easy to run, stop, and manage Docker containers on a cluster"
Docker encourages to split applications up into individual components and ECS is optimize for this pattern.
What are these components?
1. The **Container definition** inside
2. The **Task definition** inside
3. A **service** that manages it inside
4. A **cluster**
### ECS Task Definitions and Tasks
What is a task?
An instance of containers working together.<br>
A task definition is like a blueprint for your application (a bit like a Dockerfile). <br>
In this step, you will specify a task definition so that Amazon ECS knows:
- which Docker images to use for containers
- how many containers to use in the task
- the resource allocation for each container
- how much CPU and memory you want to use for each task
- the logging configuration to use
- whether a task should continue to run if the container finishes or fails
- the command the container should run when it is starts
- ...
You entire application stack does not need to exist on a single task definition, and in most cases it should not.
***Note:***
*Within th AWS free tier, you need to leave the number of tasks configured to the default value: 1. That will copy 1 copy of your task.*
### ECS Services
Amazon ECS allows you to run and maintain a specified number of instances of a tak definition simultaneously, in an Amazon ECS cluster. That is called a **service**.
You can scale your application up and down by changing the number of containers you want your service to run.
You can update your application by changing its definition or using a new image.
If any of your tasks should fail or stop for any reason, the Amazon ECS service scheduler kills it and launches another instance of your task to replace it and maintain the desired count of tasks in the service depending on the scheduling strategy used.
## ECS Cluster
This is the parent grouping of **tasks** or **services**.
There are two main launch types:
1. **Fargate**: it allows you to run your containerized applications without the need to provision and manage the backend infrastructure.
**Amazon ECS** uses containers by farget automatically scale, load balance and manage scheduling of your containers for availability. It provides an easier way to build and operate containerized applications.
When you're architecting your application using Farget launch type for your tasks, the main question is: **Should you put multiple containers into the same task definition OR deploy containers separately in multiple task definitions?**
2. **EC2**: it allows you to run your containerize.d application on a cluster of Amazon EC2 instances that you manage "manually"
To summarize, **Farget** tasks are more expensive but there is less to manage and configure. Whereas if your require greater control of your instances, perhaps a support compliance and governance requirements, **EC2** launch method is more appropriate.
### Why ECS?
#### What are your options
- Containerization has transformed how we deploy software. Container orchestration is all about managing the life cycles of containers especially in large dynamic environments
- Other Container orchestrion engine options: **Kubernetes**, **ECS**, **Docker Swarm**
- **Kubernetes** is the container orchestration engine of choice developed by Google.
- it has the most complex setup and management
- it is self-managed. You can deploy it on premises in private clouds or public clouds compared to **ECS** that is managed by **AWS**
- New player: **Amazon Elastic Container Service for Kubernetes (EKS)**
## Wrap-up
### Key learning points
We saw throughout the section that:
- There are a large range of container orchestration engines as well as manged or self-managed options to consider, each one with pros and cons
- Deploying to IaaS has far greater configuration complexity compared to PaaS: security, resource consumption for our containers
- IaaS can scale to virtually any needs our business may have
### IaaS Next Steps
- Explore other AWS services: S3, Load Balancing, new ELK.
In this section, we didn't setup a custom domain or a fixed IP address. To do that on ECS, we need to work with the AWS Load Balancing Options
- Explore other IaaS Providers: MS Azure, Google Compute Engine.
- Explore other container orchestration engines: Kubernetes, Docker Swarm
<file_sep># Section 7: Serving the model prediction
In this section, we will be looking at serving our model prediction via a REST API.
In the previous sections, we looked at things like:
- Preparing our training data
- Feature extraction
- Building our model package
Now, we are going to see how to serve our model prediction and that where our **REST API** comes in.
## What is a REST API?
REST stands for ***Representational State Transfer***
API stands for ***Application Programming Interface***
A **REST API** means that the server will **send to the client a representation of the state of the requested result**. In our case, it will be a prediction from our model.
The client could be anything form a website to mobile device.
The **RESTs** are quite popular due to their simplicity
## Why does this matter?
Serving our model via a REST API allows us to:
- Serve predictions on the fly to multiple clients: requests from websites, mobile devises, other APIs...
- Decouple our model development from the client facing layer: it is a problem we can face with large apps. We tend to do all the packaging, training, making a REST API in one application. So, decoupling and having a thin REST API allows teams to work independently
- Potentially combine multiple models at different API end points
- Scale by adding more instances of the application behind a load balancer
## Flask overview
Throughout this section, we will be using the **Flask micro framework** to build our API.
- Popular choice for Python microservices (40K stars + on github)
- Lightweight and flexible and has great documentation
- Alternatives include: Django, Pyramid, Bottle, Sanic, Tornado, API Star...
The steps of this section can be tracked in the following [repo](https://github.com/lohiermichael/public-repo-deployment-ml-models.git) that I forked from the course template.
## Wrap-up
### Key Learning Points
- **Make your API a thin layer**: the idea is to avoid having code logics for your models spread across two different applications which can increase the chance to forget to update one.
- **Validate inputs carefully**: consider using a schema.
- **Log all key inputs, outputs and errors**: for reproducibility and to simplify potential debugging and audits
- **Test your API**
<file_sep># Introduction to Tox
**Tox** is a generic virtual environment management test command line tool.
It can create isolated environments for **running tests**.
It allows to test over different versions of Python and it is cross-platform compatible.
Tox can be set up with different file formats. In this part, we will be working `tox.ini` type format.
For installation, run: <br>
```pip install tox```<file_sep># Run from the ROOT
set -a # automatically export all variables
source .env
set +a<file_sep>from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
import preprocessors as pp
import config
titanic_pipe = Pipeline(
[
('extract_first_letter', pp.ExtractFirstLetter(variables=config.CABIN)),
('missing_indicator', pp.MissingIndicator(variables=config.NUMERICAL_VARS)),
('numerical_imputer', pp.NumericalImputer(variables=config.NUMERICAL_VARS)),
('categorical_imputer', pp.CategoricalImputer(
variables=config.CATEGORICAL_VARS)),
('rare_label_encoder',
pp.RareLabelCategoricalEncoder(
tol=0.01,
variables=config.CATEGORICAL_VARS)),
('categorical_encoder', pp.CategoricalEncoder(
variables=config.CATEGORICAL_VARS)),
('scaler', StandardScaler()),
('logistic_regression_model', LogisticRegression(C=0.0005, random_state=0))
]
)
<file_sep># production requirements
pandas>=0.25.3,<0.26.0
numpy>=1.18.1,<1.19.0
scikit-learn>=0.22.1,<0.23.0
Keras==2.1.3
opencv-python==4.0.0.21
h5py==2.9.0
Theano==0.9.0
matplotlib
seaborn
# packaging
setuptools>=41.4.0,<42.0.0
wheel>=0.33.6,<0.34.0
mkl-service
# testing requirements
pytest==4.0.2
# fetching datasets
kaggle>=1.5.6,<1.6.0<file_sep># Section 8: Continuous Integration and Deployment (CI/CD)
CD also referred to as **Continuous Delivery**
## What is CI/CD?
Fundamentally it is about **automating the stages of development** The different stages built refer to preparing everything needed to run your code. So in the case of Python, that's:
1. **CI (Continuous integration)**:
- **Build**
- Installing dependencies in your requirements
- Making sure that the operating system which is going to run your code is set up
- The virtual machine or docker container is built and ready to go
- **Test**: Automatically testing your code
- **Merge**: merge in a feature branch
2. **CD (Continuous delivery)**: as soon as the code is merged, automatically release to either production or a testing environnement
## Why does this matter?
Testing and deploying our applications according to the CI/CD method means:
- The system is always in a releasable state
- Faster, regular release cycles
- Building and testing is automated
- Delivery and deployments are automated (at least to some extent)
- Visibility across the company (and audit log)
In our architecture, we will refer to CI/CD as a pipeline.
## Why CircleCI?
In this course, we are going to use a CI/CD platform called: **CircleCI**
We chose **CircleCI** because:
- They have a hosted platform: we don't have install and set up CircleCI on our own servers
- They have a fairly easy GitHub integration to set up
- They offer one free project: a GitHub repo
- Many great features
- Used by many top companies
## Alternatives to CircleCI
There are many awesome CI/CD platforms:
- Jenkins
- Travis CI
- Bamboo
- Gitlab CI
- Team City
- etc.
We must use on CI/CD platform, it doesn't matter which one...
## Key Learning Points
- **Make sure you use a CI/CD pipeline:** when working in team it makes you save a huge amount of time. It also helps with reducing the issues in production and outages
- **Train your models in the pipeline**
- **Deploy your models in the pipeline**
- **Test your models via the pipeline**
<file_sep># Section 2: Machine Learning Pipeline - Research Environment
## 1. Overview
A typical Machine Learning pipeline is made of the following steps:
1. **Gathering the data**: coming from different area of the business or from third-parties. The objective is to make the data available to the **data scientist** so that he can start analyzing it.
2. **Data analysis**: as soon as we get the data, we want to know:
* identify the variables
* understand how they are related to each other
* know what we want to predict: supervised, unsupervised...
* know what variables we can use
3. **Feature Engineering**: transforming the data before passing them through a ML algorithm:
* filling missing values
* dealing with categorical variables
* ...
4. **Feature selection**: finding the variables that are the most predictive ones. Only the chosen variables will be used to build the model
5. **Machine Learning Model building**: trying different algorithms, analyzing their performance and choosing the one or the few ones that perform the bert results. Evaluation is based on relevant **statistical metrics**: MSE, accuracy...
6. **Model building Business uplift evaluation**: the statistical metrics are not enough to evaluate the performance of a ML model in the context of business. We calculate the uplift in **Business value**
After all these steps, we can move towards **model deployment**.
We need to deploy at least the steps 3, 4 and 5 to the **Cloud**. It is not simply a model that we deploy but an entire pipeline.
## 2. Feature Engineering
* **Missing data**: Absence of values for certain observations within a variable.
*Reasons:*
* It can be lost or not stored properly
* The value doesn't exist in the first place
* **Labels**: Variables for which the value is a String an not numerical. These are **categorical variables**
*Issues*:
* **Cardinality**: the number of values the categorical variable can take. High cardinality can be an issue because it will dominate other low-cardinality variables
* **Rare labels**: variables that don't often appear. For instance if the value appear on the test set and not on the train set, we don't know how to deal with them
* **Categories**: they are String and thus need to be encoded
* **Distribution**: For numerical variables. Is the data following a Gaussian curve or is it skewed
* **Outliers**: For some algorithm, the presence of outliers may be detrimental: values that are too high or too low compared to the other values
* **Feature magnitude**: if the scale values the variables are not the same, it may affect the outcome of some algorithms. For instance, the following algorithms are sensitive to feature scaling:
* Linear regression
* Neural Networks
* PCA
* ...
## 3. Feature selection
It is the action of keeping a fewer number of features that are more predictive to build our model.
### Motivation
Why do we select features in a business?
1. Simple models are easier to interpret by the end user
2. Reduce the training times
3. Enhance generalization by reducing overfitting
4. Easier to integrate by the Software Developers in production: smaller json messages sent to the model
5. Reduce the risk of data errors during the use of the model: less code for error handling
6. Less information to log
7. Reduce feature engineering code
### Variable Redundancy
There are 4 main types of variable redundancy
1. **Constant variables**: only one value per variable
2. **Quasi-constant variables**: >99% constant
3. **Duplication**: Same variable repeated several times in the same dataset
4. **Correlation**: The correlated variables provide the same information
## Methods
There are there main kind of methods for feature selection on data:
1. **Filter methods**
* Independent of the ML algorithm
* Based only on variable characteristics
*PROS*:
* Quick and easy method
* Fast
* Model agnostic
*CONS*:
* Doesn't capture redundancy
* Doesn't capture feature interaction
2. **Wrapper methods**
* Consider ML algorithm
* Evaluate features by groups
*PROS*:
* Considers feature interaction
* Best performance
* Best feature subset for a given algorithm
*CONS*:
* Not model agnostic
* Computation expensive
* Often impracticable
3. **Embedded methods**
Feature selection during training of ML algorithm
*PROS*:
* Good model performance
* Capture feature interaction
* Better than filter
* Faster than wrapper
*CONS*:
* Not model agnostic
In this course, we will try to remove **feature selection** from the pipeline to aim efficiency. We will then select the feature ahead of the pipeline and then pass a list of the features to keep for the model.
<file_sep># Section 6: Creating a ML Pipeline Application
In this section, we will be covering everything from:
- Preparing the training data
- Feature engineering
- Training the model
- Performing prediction within the model package
We will be **packaging the model** so that we can make an easy use of it in other applications
## What will be new?
Key Differences with the code already covered will include:
- Work within a Github repository
- Introduce Tooling (such as Tox)
- Adding Prediction Module
- Introduce Testing
- Versioning
- Logging
- Packaging
## Why does this matter?
Build your models in a way that allows you to:
- Reproduce any prediction
- Reduce the risk of errors
- Debug problems in the code base
- Elegantly handle errors
- Have a modular structure
The steps of this section can be tracked in the following [repo](https://github.com/lohiermichael/public-repo-deployment-ml-models.git) that I forked from the course template.
## Wrap-up
### Key Learning Points
- **Package your model for reproducibility with effective use of versioning (including data)**
We have talked a lot about versioning. We did not only versioned the ML model but also the training data and the dependencies.
- **Clearly organize you preprocessing and feature engineering steps**
This is going to make any adjustment and adaptation to the model much simpler. Every time you change a preprocessing step or an engineering step, one should be incrementing the model version for the sake of differentiation of versions
- **Persist your predictions**
That includes both inputs and outputs. In section 6, we did that through logs. If we are in a regulated
or environment where you might be audited, you should be persisting to **databases** to make sure that we never loose that information.
- **Abstract model details in config**
Make the config file easily readable so that updates are simple
- **Validate your data**
The input we receive is not going to be necessarily of the format we except. The good practice is to use schemas and always plan a layer of safety
<file_sep># Section 9: Differential Testing
## Introduction
In the context of Machine Learning applications, **differential tests** are particularly useful
## What is Differential Test?
It is a type of test that compares the differences in execution from one system version to the next (two successive versions of the work) when the inputs are the same.
- They are sometimes called **"back-to-back"** testing
- They are very useful for detecting machine learning subtle system errors that do not raise exceptions
- Turning them is a balancing act: it depends on business requirements
- It can prevent very painful mistakes that are not detected for long periods of time
Example of mistakes that differential tests can spot:
1. You forget to include a preprocessing step to your data transformation pipeline
2. You have an incorrect feature
If you release your code as is, some tests will pass without raising any system errors. But the predictions that we make will change. **Differential Tests** will catch these changes and alert us before the code goes to production.
## Key Learning points
- Differential tests can protect you from costly mistakes
- Run them like any other tests in your CI pipeline
- Accessing the ol version with the model required a sort of hacking. Once we use Docker, things will become easier. It will just be comparing images
## Other kinds of tests
- If a prediction and/or training speed is a key metric for you, consider implementing **benchmark tests** to compare the speed of functions from one system version to the next.
- A great framework for doing this is **pytest-benchmark**
- In complex microservice environments, you may also wish to consider **API contract testing**
- A great framework for this is **Pact**
<file_sep>import pytest
from my_module import square
@pytest.mark.parametrize(
'inputs', [2, 3, 4.5]
# The last test will fail
)
def test_square_return_value_is_int(inputs):
# When
subject = square(inputs)
# Then
assert isinstance(subject, int)
<file_sep># Section 4: Writing Production Code for Machine Learning Deployment
## Overview
In section 2, we have been through different steps of the ML pipeline with code written in Jupyter Notebooks. Three of these steps must be kept to write production code from:
1. Data pre-processing: feature engineering
2. Variable selection
3. Machine Learning model building
We want to write **Production code** to:
* Create and Transform features
* Incorporate the feature selection
* Build Machine Learning Models
* Score new data
**Production code** is not written in Jupyter notebooks but rather in script, for instance Python script.
**How to write production code for an entire ML pipeline?**
There are 3 main ways:
1. **Procedural Programming**: write a sequence of functions similarly to what we did in Jupyter Notebooks
2. **Custom Pipeline Code:** Calls the procedure in order with OOP
3. **Third-party pipeline:** using for instance the scikit-learn pipeline
We will finally discuss **feature selection**.
## Feature selection in CI/CD
Should it be part of the ML automated pipeline?
In production, we want to build a pipeline that is:
* fully integrated
* continuously deployed
In practice:
1. We build a model once
2. We build the entire **deployment pipeline**
3. We create **tests** for the continuous integration
4. Once those tests are fulfilled, the model is automatically deployed
5. It is made available to the other systems to make calls to it
As we are in a **continuous deployment framework**, When the model is updated:
1. it is retrained
2. the pipeline will automatically run the tests
3. if passed, it will automatically be redeployed
This system has advantages and disadvantages
### Advantages
- Reduced overhead in teh implementation of the new model
- The new model is almost immediately available to the business systems
### Disadvantages
- Lack of versatility: as the pipeline is built from one dataset, it can't accept potential new variables from other data sources
- No additional data can be fed through the pipeline, as the entire processes are based on the first data on which it was built
**Including a feature selection algorithm as part of the pipeline**
- ensures that from all the available features only the most useful ones are selected to train the model
- Potentially avoids overfitting
- enhances model interpretability
**However,**
- we would need to deploy code to engineer all available features in the dataset, regardless of whether they will be finally used by the model
- error handling and unit testing for all the code to engineering features
**Suitable, if...**
- Model build and refresh on same data
- Model build and refresh on smaller datasets
**Not suitable, if...**
- Model is built using datasets with a high feature space, as it will involve a big piece of production code to engineer and handle errors.
- Model is constantly enriched with new data sources. In this case, we'd better focus on the R&D part of the code to select the features carefully
<file_sep># Section 13: A Deep Learning Model with Big Data
## Introduction
In this section, we will deploy a **CNN** (Convolutional Neural Network) that was trained on a large dataset and also needs large data to make its predictions.
We will cover some of the challenges and things to consider when deploying models that consume large datasets.
### What is big data
**Big data** is used to talk about large volume of data in business, most of the time in **analytics** and **machine learning**
Data can be:
- Structured
- Semi-structured
- Unstructured
Although **Big Data** doesn't equate to any specific volume of data, the term is ofter use to describe: **terabytes**, **petabytes** or even bigger datasets.
In business, the most likely scenarios that involves big datasets are those that contain:
- **text**: large documents
- **images**
- **time series**: complex enough to be solved with **LSTM** (Long Short-Term Memory Network)
**Note:** *LSTM is a type of recurrent neural network capable of remembering the past information and while predicting the future values, it takes the past information into account.*
For these types of problems, **deep learning** models are the most usually built. These DL models will contain various **layers** and thousands of **parameters** that need to be determined.
### Challenges of using big data in ML
- Neural networks can be extremely compute heavy
- **Training** takes up a lot of compute power
- **Scoring** can also take a lot of computing power
- Neural Networks are difficult to scale
- Neural Networks normally rely on **GPUs**
- **GPUs** can be scarce and expensive
### Deployment pipeline for CNN
- Coding Challenges
- Deployment Challenges
## V2 Plant Seedlings: dataset description
In this part, we will present the dataset that we are going to use to build and compute the expensive ML model.
TH **V2 Plant Seedlings** dataset comes from Kaggle.
It consists of:
- **5539 images** of
- **crop and weed seeds** belonging to
- **12 different species**
The challenge is:<br>
Given an image of the plant, **predict which specie it belongs to**.
We choose this dataset because:
- it is big enough to cover some of the challenges of deploying a machine learning model built on a large dataset
- it is small enough to follow the videos along while running
After this section, we should be able to apply what we learnt utilizing these dataset to larger datasets and more complex models.
## Reproducibility in Neural Networks
We are going to cover the common problems encountered when trying to obtain reproducible results with Keras and how to try and avoid them.
### Reminder: why does reproducibility matter?
- Reproducibility ensures that models' gains in performance are genuine: they won't come out of nowhere.
This is particularly relevant for NN as they have a multitude of parameters that need to be fit an many of them rely on random initialization.
- Reproducibility reduces or eliminates variations when re-running experiments: it is essential for testing, continuous integration and iterative refinement of models
This is crucial when we are looking to improve a previous model that we have already in-house because without reproducible results we wouldn't be sure whether the increase in performance is real or cost by the intrinsic randomness
- Reproducibility is increasingly important as sophisticated models and real-time data streams push us towards distributed training across clusters of GPUs: more sources of non determinism behavior during model training
### What causes non-reproducibility in Neural Networks?
- **Random initialization of layer weights:** the weights of the different layers are initialized randomly
- **Shuffling of datasets:** the dataset is randomly shuffled for example if we leave 10% of the samples for cross-validation without model fit
- **Noisy hidden layers:** dropout layers, which exclude the contribution of a particular neuron, are initialized randomly
- **Changes in ML frameworks:** different versions of mL libraries can lead to different behaviors
- **Non-deterministic GPU floating point calculations:** if using GPUs, certain functions in cuDNN, the Nvidia DEEp Neural Networks library for GPUs, are stochastic, which means that they are initialized randomly at each run.
- **CPU multi-threading:** CPU parallelization when using Tensorflow can also introduce non-reproducibility
### How to control for random initialization
- **Keras** gets its source of randomness from the **numpy random number generator.
Therefore, seeding the numpy random generator both for Therano or TensorFlow backend
- Tensorflow uses multiple threads, which may cause non-reproducible results.
Force TensorFlow to use single thread. This decision is a trade-off between reproducibility and speed
- **In Python 3, you need to set a flag before running your script**
PYTHONHASHSEED=0
- Set the cuDNN as deterministic
## Wrap up
### Training in CI: Speed and Memory Considerations
We have seen in this section that we are bound to scenarios where:
- Data is too huge to be included in packaged: in this cases, it is still important to keep a reference and a version of the dataset no matter where it is stored for the sake of reproducibility
- Data can't fit in memory: in this case there are particular techniques: loading and training by batch with Keras for instance.
Training demanding model issues relying on big datasets have the following issue:
- You are likely to need more powerful machines for training neural network: we might consider using GPUs and pay extra for that
### Key Learning points
- Even with larger datasets, you still need to think about reproducibility
- Training in CI is more important and beneficial than ever with deep learning as the cloud server can be more powerful than a local one
- Be sure to tune your machines consider using GPUs
- Reproducibility in Neural Networks has some particular challenges
<file_sep># Custom Machine Learning Pipeline
We will discuss how to write production code to create a custom ML Pipeline utilizing **Object oriented programming**.
In Procedural Programming, we need to:
- **hard-code** the engineering parameters.
*ex:* the mapping labels in the (previous section)
- **save** multiple objects and data structures. *ex:* the scaler model.
A slight change from the `config.py` file can impact the code. To keep a control on the output, we will then need to track the changes in this file. This can be cumbersome if we want to update or refresh a model frequently.
We can instead write production code with objects that can **learn** these parameters from data and store them as part of their attributes. That how **OOP** comes into play.
## Object Oriented Programming - OOP
In **Object Oriented Programming (OOP)**, we write code in the form of objects.
These "objects" can store **data**, and can also store instructions or **procedures** to modify that data
- The **data** is an **attribute** of the object
- **Instructions** or **procedures** are methods of the object
## Custom ML Pipeline
In OOP the "objects" can learn and store these parameters.
- Parameters get automatically refreshed every time the model is retrained.
- No need of manual hard-coding
- The **methods** widely used in the field of ML are:
- **Fit**: to learn parameters
- Saves the parameter in object attribute
- Transform: to transform data with the learnt parameters
- Calls to the object attribute to recall the parameters
- The **attributes** and variables in which are stored the learnt parameters.
A **pipeline** is a set of data processing steps connected in series where typically, the output of one element is input of the next one until we make our prediction.
The elements of the pipeline can be executed in parallel or in time sliced fashion. This last method is useful when we require the use of big data, or high computing power, e.g., for neural networks.
A **Custom ML Pipeline** is therefor a sequence of steps, aimed at loading and transforming the data to get it ready for training or scoring.
In custom ML pipelines:
- we write the **preprocessing steps** as objects (OOP)
- we write **the sequence**, i.e., the pipeline objects (OOP)
We save one object, the pipeline, as a Python pickle, with all the information needed to transform the raw inputs and get the predictions.
***Note:*** *There is no standard way to custom a pipeline and each organization can make the pipeline the way it will best suit their needs.*
## Advantages
The custom pipeline is well designed from the start so:
- it can be tested, versioned, tracked and controlled
- we can build additional code on top of it for future models
- it is a good software developer practice
- it can be built to satisfy different business needs
## Disadvantages
- Requires a team of software developers to build and maintain the code
- it can cost time for DS to familiarize with the code for debugging or adding on future models
- it may not be reusable and would require to re-write Processor class for each new ML model
<file_sep># Section 10: Deploying to a PaaS (Heroku) without Containers
## What is a Platform as a Service (PaaS)?
**Paas:** A cloud-based service that provides a platform allowing customers to develop, run, and manage applications without the complexity of building and maintaining the infrastructure typically associated with developing and launching an application
### Range of Possibilities
1. **On-Premises:** you manage everything on your own
**Situation:** you go out and buy a computer that you turn into servers, you plug the cables in, you install the Operating System (OS), the middleware...
This solution is getting rarer and rarer these days. Nowadays, it is really the realm of companies operating legacy software or with very high security requirements.
#### Cloud options
2. **Infrastructure as a Service (IaaS):** Dealt with in section 12
3. **Platform as a Service (PaaS):** It requires that you manage less. The Operating system or the middleware are managed by someone else. You just need to focus on your **application code** and your **data**
4. **Software as a Service (SaaS):** Everything is managed somewhere else
### PaaS Pros and Cons
#### Pros
- Simple to set up, maintain and deploy
- Easy to scale to moderate size. It's just a question of setting up th platform, scaling options or manually adding more instances
- Allows Developers to focus on apps. They don't have to do any sys/admin tasks
- Easy creation of dev/test environments that exactly match you production environment
#### Cons
- Hard/Impossible to scale to a very large size
- Tends to be more expensive than IaaS
- Vulnerable to PaaS downtime
- Limitations on configuration
### Examples of PaaS
- AWS Elastic Beanstalk
- Windows Azure
- Heroku
- Force.com
- Google App Engine
- Apache Stratos
- PythonAnywhere
- ... and many more
In this course, we are going to choose **Heroku**
### Why Heroku in the Course?
***Note:*** *In the IaaS section, we will use AWS ECS*
- Heroku is very easy to use
- We can use one Heroku Dyno (Virtual Machine Instance) for free
- Nice 3rd Party add-on options
- Works with Docker
- Great Documentation
- Supports multiple languages not only Python
## Key Learning Points
- Integrate your deployment steps into the CI pipeline
- Deployments can be easy
- Get used to checking deployments and logs: debugging in production is an important skill
## Heroku scaling
- On a paid plan, you can manually change the number of Heroku "dynos" to scale your app
- On Performance Tier Dynos, you can enable and configure autoscaling
## Heroku next steps
- You can add databases, message queues and caches very easily
- It's worth exploring the heroku add-ons
- If you want to deploy multiple services from a monorepo, this is also possible with Heroku
<file_sep># Third Party Machine Learning Pipeline
This part is about writing production code to build Machine Learning Pipeline leveraging the power of a third party pipeline. In this case this third party pipeline will be **Scikit-Learn**.
## Why Scikit-Learn
- Scikit-Learn is a Python library that provides a solid implementation of a range of ML algorithms.
- Scikit-Learn provides efficient versions of a large number of common algorithms.
- Scikit-Learn is characterized by a clean, uniform, and streamlined API.
- Scikit-Learn is written so that most of its algorithms follow that same functionality.
- Once the basic use syntax of Scikit- Learn is understood for one type of model, switching to a new model or algorithm is very straightforward.
- Scikit-Learn provides useful and complete online documentation that allows to understand both what the algorithm is about and how to use it from Scikit-Learn
- Scikit-Learn is so well established in the community, that new packages are typically designed following Scikit-Learn functionality to be quickly adopted by end user, e.g., Keras, MLXtend
## Scikit-Learn organization
Scikit-Learn has three main types of objects:
- **Transformers:** class that aims to transform the data. They typically have: `fit` and `transform` methods. Among them, we find:
* Scalers
* Feature selectors
* One hot encoders
- **Predictors:** class that makes predictions. They carry the `fit` and the `predict` methods. This includes all the ML algorithms:
* Lasso
* Decision trees
* SVM
* etc...
- **Pipeline:** class that allows you to list and run transformers and predictors in sequence. The characteristics are that:
* You can list as many transformers as you want
* The last step of the pipeline should be a predictor
## In practice
We don't need to write a **custom pipeline** because Scikit-Learn took care of that part.
Instead, we need to write code for all of our engineering steps in the way that can be used by the Scikit-Learn Pipeline.
We need to build individual transformers that allow the `fit-transform` Scikit-Learn functionality so we can integrate the Transformers as part of the Scikit-Learn Pipeline.
Scikit Learn already has **templates** for the transformers. So, we need to call the templates, **inherit** all the methods and adjust the `fit` and `transform` parts of it
## Advantages
- It can be tested, versioned, tracked and controlled
- One can build future models on top
- It follows good software developer practices
- It leverages the power of an acknowledge API like Scikit-Learn
- Data scientists are familiar with Pipeline use, so it can reduce over-head
- Engineering steps can be packaged and re-used in future ML models
## Disadvantages
- It requires software development skills to build and maintain the code
- It can be an overhead for software developers that need to familiarize with code for sklearn API. For instance, it may be challenging to debug
<file_sep>from my_module import square
def test_square_gives_correct_value():
# When
subject = square(4)
# Then
assert subject == 16
<file_sep># Section 3: Machine Learning System Architecture
## *And why it matters*
A **System** is composed of:
* **Infrastructure:** from hardware to operating system
* **Applications:** Programs performing specific tasks
* **Data**
* **Documentation**
* **Configuration**
**Architecture** is the term used to describe **Systems**.
**Architecture**: the way software components are arranged and the interactions between them.
As of ML Systems, developing them is fast and cheap but **maintaining** overtime them is challenging.
## Key principles and challenges of ML Systems
* Need for **reproducibility**: how to duplicate ML exactly. It is needed fo research, model improvement, audits...
* **Entanglement**: *ex:* if we change the input feature, further elements in the pipeline may change as well. This refers to the ***"Changing anything, changing everything principle***
* **Data dependencies**: the two inputs of an ML pipeline are code and data. However, some data inputs are unstable.
* **Configuration issues**: need for incrementing models and experimenting
* **Data and feature engineering**: putting the code in an adequate format for certain libraries such as sklearn of Tensorflow can require a lot of code which is challenging to maintain
* **Model errors can be hard to detect with traditional test**: alternative test such as differential tests can be useful
* Separation of expertise: ML System contributors are:
* DevOps
* Software engineering
* Data Science
* Business people
If the full process is not understood it may lead to errors and lost of time.
The ke Principles for ML System architecture are:
* **reproducibility**: have the ability to replicate a given ML prediction
* **Automation**: retrain, update, deploy models as part of an automated pipeline
* **Extensibility**: have the ability to easily add and update models
* **Modularity**: preprocessing/feature engineering code used in training should be organized into clear pipelines
* **Scalability**: ability to serve model predictions to large numbers of customers (within time constraints)
* **Testing**: test variation between model versions
## Design Approaches to ML System Architecture
There are 4 general ML Architectures (Inexhaustible list):
1. **Train by batch, predict on the fly, serve via REST API**.
*ex:* a model train persisted off line, loaded in a Web application about houses in real time when details about a given house are posted by a client to a REST API
2. **Train by batch, predict by batch, serve through a database**.
*ex:* a user upload a CSV of houses with the input details. Then, he receives an email 30 minutes later to check the website to see the results. This application will perform the batch prediction with an asynchronous task queue and those results will be saved to a shared database which can be accessed by a web application.
3. **Train, predict by streaming**
*ex:* our application could read a prediction from a distributed queue or an updated model from this distributed queue and easily load it
4. **Train by batch, predict on mobile**
*ex:* No backend service is needed to make the prediction. It could be made on device
## Architecture Component Breakdown
We are going to breakdown the **1. Train by batch, predict on the fly** method that we are going to investigate later in the course.
The high level architecture is composed as followed:
* **Data Layer**: provides access to all our data sources to train our models. It also simplifies the challenge of data reproducibility
* **Feature Layer**: is responsible for generating feature data in a transparent, reusable, and scalable manner
* **Scoring Layer**: transforms feature into predictions. We often use scikit-learn as the industry standard for this layer. Other libraries are Xgboost and Keras for Neural Networks
* **Evaluation Layer**: monitors the equivalence of different models. This layer can be used to check how closely the predictions on live traffic matches the training predictions for example
## Building a Reproducible ML Pipeline
What is reproducibility in Machine Learning?
Reproducibility is the ability to duplicate a machine learning model exactly, such that given the same raw data, both models return the same output.
To ensure reproducibility between research and production we need to ensure it for the different steps of the pipeline:
1. **Gathering data:**
This is potentially the most difficult step to ensure reproducibility.
Problems occur if the training dataset can't be reproduced at a latter stage.
*ex1:* The databases are constantly updated and overwritten, therefore values present at a certain time point differ from values later on.
*ex2:* The order of data during data loading is random, for instance when retrieving the rows with SQL.
**How to ensure reproducibility when we inject our data?**
* Save a snapshot of training data (either the actual data, or a reference to a storage location such as AWS S3)
- PRO: if the data is not pulled from too many different and if it is not too big
- CONS: it may not be allowed to store the data on another platform because of regulations and if too big, not been able to store it somewhere else
* Design the data sources with accurate timestamps, so that a view of the data at any point in time can be retrieved
- PRO: it works in the ideal situation
- CONS: it may require a real effort to re-design the data sources
For SQL randomness, we can ***"order by"***
2. **Data preprocessing and variable selection:** feature creation
**Lack of reproducibility may arise from:**
* Replacing missing data with random extract values
* Removing labels based on percentages of observations
* Calculating statistical values like the mean to use for missing value replacement
* More complex equations to extract features, e.g., aggregating over time
**How to ensure reproducibility?**
By adopting a few code practices, it is easy to minimize the lack of reproducibility.
* Code on how a feature is generated should be tracked under **version control** and published with auto incremented or timestamp hashed versions.
* Many of the parameters extracted for feature engineering depend on the data used for training. Therefore, we have to ensure that the data is reproducible in the first place.
* If replacing by extracting random samples, always set the seed.
3. **ML Model Building**
**How to ensure reproducibility?**
* Record the order of the features
* Record applied feature transformations, e.g., standardization
* Record the hyperparameters
* For models that require an element of randomness to be trained (decision trees, neural networks, gradient descent), always set the seed.
* If the final model is a stack of models, record the structure of the ensemble
4. **Model deployment:** Software environment and implementation
**How to ensure reproducibility?**
* For full reproducibility, the software versions should match exactly - applications should list all third party library dependencies and their versions.
* Use a container and track its specifications, such as image version ( which will include important information such as operating system version)
* Research, develop and deploy utilizing the same language, e.g., python
* Prior to building the model, understand how the model will be integrated in production -how the model will be consumed-, so you make sure the way it was designed can be fully integrated.
* Examples of partial deployment include, some data not being available at the time of consuming the model live
* Filters in place do not allow a certain cohort of data to be seen by the model
|
1fa1bcc1bf42f9c6d5addcd2ccc69018d148af72
|
[
"Markdown",
"Python",
"Text",
"Shell"
] | 21 |
Markdown
|
lohiermichael/deployment-of-machine-learning-models
|
153c0ae7bc6172d615e05e3fbcd41271126af44c
|
a473ec97c1ef523ab5d6dfacbf4469d394314146
|
refs/heads/master
|
<file_sep>public class Task {
private String name;
private double frequency;
private String comments;
private boolean done;
public Task(String title, boolean completed, double freq) throws InterruptedException {
this.name=title;
this.done=completed;
this.frequency=freq;
this.comments="";
TimerThread ti=new TimerThread(24*60*60*1000/freq, title, ". It is time for this task!");
ti.start();
ti.join(100);
ti.interrupt();
}
public String getName()
{
return this.name;
}
public void setName(String label){
this.name=label;
}
public boolean getComplete()
{
return done;
}
public void setComplete(boolean doneYet){
done=doneYet;
}
public double getFreq(){
return frequency;
}
public void setFreq(double howOften){
frequency=howOften;
}
}
<file_sep>import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
public final class Helper {
private Helper() {
}
/**
* InputStream for user commands--console.
*/
private static final java.io.InputStream InputStream = System.in;
/**
* Main method.
*
* @param args
* the command line arguments
* @throws IOException
* @throws InterruptedException
*/
public static void main(String[] args) throws IOException, InterruptedException {
BufferedReader in = new BufferedReader(new InputStreamReader(
InputStream));
PrintWriter out = new PrintWriter(System.out, true);
ArrayList<DataField>Metrics=new ArrayList<DataField>();
ArrayList<Task>ToDos=new ArrayList<Task>();
char exit = 'q';
char exiteer = 'Q';
//TESTY TESTY 1-2-3 TESTY TESTY 1-2-3
/*
out.println("First: a timer!");
TimerThread t = new TimerThread(5000, "so loooong", " ugh");
t.start();
t.join(1000);
t.interrupt();
//ach Gott
*/
//Ask the user intro questions. To be replaced by Ariane's slick + actual interface:
out.println("Would you like to create tasks (enter 0), or create metrics to follow (enter 1), or proceed to the main menu (enter 2)?");
int riposte=Integer.parseInt(in.readLine());
if(riposte==0){
createTasks(in, out, ToDos);
}
if(riposte==1){
createMetrics(in, out, Metrics);
}
if(riposte==2){
//GOTO Main Menu
}
//CHANGE VALUES MANUALLY VIA MENU
int replyToExitPrompt = 0;
int placeInArray=0;
while(replyToExitPrompt!=exit&&replyToExitPrompt!=exiteer){
out.println("Here are the things we're tracking. choose one:\n");
for (DataField ThisData: Metrics){
out.println(ThisData.getName() + " " + Metrics.indexOf(ThisData)+"\n");
}
int responseEntry=Integer.parseInt(in.readLine());
DataField ourData=Metrics.get(responseEntry);
out.println("choose an option from the following: \n1. View patient data\n");
out.println("2. Enter Measurement\n3. Change a max/min value\n4. Enter comments\n5. Check Off Task");
int choice=Integer.parseInt(in.readLine());
char response=1;
if(choice==1){
//show the graphs
out.println("chose output with index "+placeInArray);
displayStuff(ourData, in, out, placeInArray-1);
//to do list
}
else if (choice==2){
out.println("enter measurement\n");
double newMeasure=Double.parseDouble(in.readLine());
ourData.takeMeasurement(newMeasure, placeInArray);
placeInArray++;
//HEY ONLY SOMETIMES
ourData.setComplete(true);
}
else if (choice==3){
//CHANGING LIMITS N STUFF REALLY MORE OF A DOC THING BUT HE/SHE CAN CALL GRANDMA AND HAVE HER ALTER THE LIMS
out.println("change max(y/n)?");
response=in.readLine().charAt(0);
if(response=='y')
{
out.println("Please enter a new value.\n");
double newVal=Double.parseDouble(in.readLine());
ourData.setMax(newVal);
}
else {
out.println("change min(y/n)?");
response=in.readLine().charAt(0);
if(response=='y'){
out.println("Please enter a new value.\n");
double newVal=Double.parseDouble(in.readLine());
ourData.setMin(newVal);
}
}
out.println("change max slope?");
response=in.readLine().charAt(0);
if(response=='y')
{
double newVal=Double.parseDouble(in.readLine());
ourData.setMaxSlope(newVal);
}
else
{
out.println("change min slope?");
response=in.readLine().charAt(0);
if(response=='y')
{
double newVal=Double.parseDouble(in.readLine());
ourData.setMinSlope(newVal);
}
}
}
else if (choice==4){
out.println("OK go!\n");
String situation = in.readLine();
ourData.enterComments(situation);
}
else if (choice==5){
out.println("which task have you completed? Enter the accompanying integer");
for(Task thing : ToDos){
out.println(thing.getName() + " " + ToDos.indexOf(thing));
}
int sought=Integer.parseInt(in.readLine());
Task Modify = ToDos.remove(sought);
Modify.setComplete(true);
}
else
{
//probably a good idea to try to wrangle user errors
out.println("We'll bring you through to the next screen. You can get back to wherever you need to go from there.");
}
out.println("punch in q or Q to finish entering vitals, or anything else to go to main menu.");
replyToExitPrompt=in.readLine().charAt(0);
}
in.close();
}
private static void createMetrics(BufferedReader in, PrintWriter out, ArrayList<DataField>Metrix) throws InterruptedException, IOException {
char escape='p';
while(escape!='e'&&escape!='E'){
out.println("Hey let's create a health value to follow:");
String Named = in.readLine();
out.println("Please enter its max and min values, its max and min rates, and how many times per day to take the measurement. Press enter after each!");
double max = Double.parseDouble(in.readLine());
double min = Double.parseDouble(in.readLine());
double maxRate = Double.parseDouble(in.readLine());
double minRate=Double.parseDouble(in.readLine());
double frequency = Double.parseDouble(in.readLine());
boolean done=false;
double current=0;
//DEAR GOD I HOPE THAT WORKS//
DataField ourData=new DataField(Named, done, frequency, current, max, min, maxRate, minRate, 0);
Metrix.add(ourData);
out.println("punch in e or E to finish entering vitals, or anything else to go to main menu.");
escape=in.readLine().charAt(0);
}
}
private static void createTasks(BufferedReader in, PrintWriter out, ArrayList<Task> X) throws InterruptedException, NumberFormatException, IOException {
char escape='p';
while(escape!='e'&&escape!='E'){
out.println("Hey let's create a health value to follow:");
String Named = in.readLine();
out.println("Please enter how many times per day to take the measurement.");
double frequency = Double.parseDouble(in.readLine());
boolean done=false;
//DEAR GOD I HOPE THAT WORKS//
Task Duty=new Task(Named, done, frequency);
X.add(Duty);
out.println("punch in e or E to finish entering new tasks, or anything else to go to main menu.");
escape=in.readLine().charAt(0);
}
}
private static void displayStuff(DataField ourData, BufferedReader in, PrintWriter out, int place) {
String result="";
int wayback=1;
double val = ourData.getValue();
if(val>ourData.getmax()){
result=alarmNotice(1, 1);
out.println(result);
}
else if(val<ourData.getmin()){
result=alarmNotice(1, 0);
out.println(result);
}
boolean problem=false;
while(wayback<12&&wayback<ourData.getMeasurementCount()&&!problem){
double slopeOut=ourData.calcSlope(ourData.getTime()[place-wayback], ourData.getTime()[place], ourData.getValues()[place-wayback], ourData.getValues()[place]);
if(slopeOut>ourData.getmaxSlope()){
result=alarmNotice(0, 1);
out.println(result);
problem=true;
}
else if (slopeOut<ourData.getminSlope()){
result=alarmNotice(0, 0);
out.println(result);
problem=true;
}
wayback++;
}
}
private static String alarmNotice(int i, int j) {
String alarm = "There is an alarm";
if (i==0&&j==0)
{
alarm +=" because this metric is dropping faster than recommended.";
}
else if(i==0&&j==1){
alarm +=" because this metric is rising faster than recommended.";
}
else if(j==0){
alarm +=" because this metric is lower than recommended.";
}
else if (j==1){
alarm +=" because this metric is higher than recommended.";
}
return alarm;
}
}
<file_sep>
class TimerThread extends Thread {
private double howLong;
private String nameThing;
private String finalMsg;
TimerThread(double howLong, String nameThing, String finalMsg) {
this.howLong=howLong;
this.nameThing=nameThing;
this.finalMsg=finalMsg;
}
public void run() {
Alarm clockFace=new Alarm(howLong, nameThing, nameThing);
double start=System.currentTimeMillis();
double stop=start+howLong;
while(stop>System.currentTimeMillis()){
//NADA
}
clockFace.alarmWentOff();
}
}
|
437ba36166e6b1d6992f3dc75f99060955bb5c55
|
[
"Java"
] | 3 |
Java
|
FuseHackathon2014/Nana-s-Helper
|
28ca22843f2e3cfdd3809064b7c924a1e333b58c
|
f724f751868684f216494c7a95e5e835f22eb6d7
|
refs/heads/master
|
<file_sep>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package world;
import action.Action;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;
import state.State;
/**
*
* @author jonathan
*/
public abstract class World {
String name;
State state;
Action action;
HashMap<Integer,HashMap<Integer,String>> validMoves;
HashMap<Integer,HashMap<Integer,Double>> rewards;
public World(String name){
this.name = name;
validMoves = new HashMap<>();
rewards = new HashMap<>();
}
/**
* Configura el World con estados, acciones y movimientos validos.
* Debe llamarse despues de construir el objeto.
*/
public void setup(){
setStates();
System.out.println("World.setup::states set: "+getStates().getStateList());
setActions();
System.out.println("World.setup::actions set: "+getActions().getActionList());
setValidMoves();
System.out.println("World.setup::valid moves set: "+getValidMoves());
setRewards(0.0);
System.out.println("World.setup::default rewards set: "+getRewards());
}
public abstract void setStates();
public abstract void setActions();
public State getStates(){
return this.state;
}
public Action getActions(){
return this.action;
}
public HashMap<Integer,HashMap<Integer,Double>> getRewards(){
return this.rewards;
}
/**
* Debe inicializar validMoves
*/
public abstract void setValidMoves();
/**
* Asigna una recompensa r a cada uno de las transiciones validas
* @param r
*/
public void setRewards(Double r){
for(Integer j : validMoves.keySet()){
HashMap<Integer,Double> a = new HashMap<>();
for (Integer k : validMoves.get(j).keySet()){
a.put(k, r);
}
rewards.put(j, a);
}
}
/**
* Valida que la transicion j->k exista y le asigna la recompensa r
* @param j
* @param k
* @param r
*/
public void setOneReward(int j, int k, double r){
if(!rewards.containsKey(j)){
throw new IllegalArgumentException("state j: "+j+" does not exist");
}
if(!rewards.get(j).containsKey(k)){
throw new IllegalArgumentException("state k: "+k+" does not exist");
}
rewards.get(j).put(k, r);
}
public HashMap<Integer,HashMap<Integer,String>> getValidMoves(){
return this.validMoves;
}
public boolean isValidMove(Object current, Object next){
return (validMoves.containsKey(current) && validMoves.get(current).containsKey(next));
}
public boolean setTargetStates(ArrayList<Integer> targets, double reward) {
// Para cada uno de los posibles estados finales
for(Integer t : targets){
if(!this.stateExists(t)){
throw new IllegalArgumentException("state : " + t + " not in states");
}
Set keys = this.validMoves.get(t).keySet();
System.out.println(keys.iterator().next());
// Establece que la única transición válida es hacia sí mismo
HashMap<Integer,String> newMoves = new HashMap<>();
newMoves.put(t, this.validMoves.get(t).get(keys.iterator().next()));
this.validMoves.put(t, newMoves);
// Y establece la recompensa por hacer la transición
HashMap<Integer,Double> newRewards = new HashMap<>();
newRewards.put(t, reward);
this.rewards.put(t, newRewards);
}
return true;
}
public abstract float getReward(Object current, String action);
public boolean stateExists(Integer state){
return this.state.getStateList().keySet().contains(state);
}
}
<file_sep>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package helpers;
import java.util.ArrayList;
import java.util.HashMap;
/**
*
* @author jonathan
*/
public class General {
/**
* Helper: convierte HashMap<Object,ArrayList<Object>> a
* HashMap<String,ArrayList<String>> @param ob
*
* jects
*
* @return
*/
public static HashMap<String, HashMap<String, String>> objectToString(HashMap<Integer, HashMap<Integer, String>> objects) {
HashMap<String, HashMap<String, String>> list = new HashMap<>();
for (Object o : objects.keySet()) {
HashMap<String, String> a = new HashMap<>();
for (Object p : objects.get(o).keySet()) {
a.put(p.toString(), objects.get(o).get(p));
}
list.put(o.toString(), a);
}
return list;
}
/**
* Recibe un arraylist y regresa un arreglo 2D para graficarlo
*
* @param origin
* @return
*/
public static double[][] arrayListTo2DDouble(ArrayList origin) {
int numEvents = origin.size();
double[][] m = new double[2][numEvents];
for (int i = 1; i < numEvents; i++) {
m[0][i] = i;
m[1][i] = (double) origin.get(i);
}
return m;
}
public static ArrayList averageFromHashmap(HashMap<Integer, ArrayList<Double>> data) {
ArrayList<Double> average = new ArrayList<>();
int size = data.get(0).size();
for (int i = 0; i < size; i++) {
double current = 0.0;
for (Integer d : data.keySet()) {
current += data.get(d).get(i);
}
average.add(current / size);
}
return average;
}
public static ArrayList<Double> movingAverageFromArrayList(ArrayList<Double>list, int windowSize){
int size = list.size();
if(size<windowSize){
throw new IllegalArgumentException("arraylist shorter than window size");
}
ArrayList<Double> output = new ArrayList<>();
for(int i = 0; i<size; i++){
if(i == 0){
output.add(0.0);
}
else if(i<windowSize){
output.add(0.0);
}
else{
double localSum = 0.0;
for(int j=1; j<windowSize; j++){
localSum+=list.get(i-j);
}
localSum+=list.get(i);
output.add(localSum/windowSize);
}
}
return output;
}
}
<file_sep>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mdp;
import action.Action;
import java.util.ArrayList;
import state.State;
/**
*
* @author jonathan
*/
public abstract class MDP {
private final Object initState;
private final State states;
private final Action actions;
private ArrayList<String> actionLog = new ArrayList();
private ArrayList<Double> rewardLog = new ArrayList();
private ArrayList<Object> stateLog = new ArrayList();
private int updateCount;
public MDP(Object initState, State states, Action actions) {
this.initState = initState;
this.states = states;
this.actions = actions;
this.updateCount = 0;
}
/**
* Updates MDP: executed execAction and obtained reward, now in state
* newState. The MDP is updated only if the action and state exists
*
* @param execAction
* @param reward
* @param newState
* @return
*/
public void update(String execAction, double reward, Object newState) {
actionLog.add(execAction);
rewardLog.add(reward);
stateLog.add(newState);
updateCount++;
}
public int getUpdateCount() {
return this.updateCount;
}
public ArrayList getRewardLog() {
return this.rewardLog;
}
public ArrayList getActionLog() {
return this.actionLog;
}
public String getCurrentAction() {
return (String) this.actionLog.get(this.updateCount - 1);
}
public Object getCurrentState() {
return this.stateLog.get(this.updateCount - 1);
}
public double getCurrentReward() {
return this.rewardLog.get(this.updateCount - 1);
}
}
<file_sep>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package action;
import java.util.ArrayList;
/**
*
* @author jonathan
*/
public class Action {
private ArrayList actionList;
public Action(ArrayList actionList) {
this.actionList = actionList;
}
public Action(){
actionList = new ArrayList<>();
}
public ArrayList getActionList() {
return this.actionList;
}
public void addAction(String action){
if(!this.actionList.contains(action)){
this.actionList.add(action);
}
}
}
|
570a547cbd887002c8565a29adbb841bec4e1525
|
[
"Java"
] | 4 |
Java
|
jonaths/learning
|
c94df3ad0c64397f9aa1100c3c3d4aecd85a8bf7
|
607c6b75c544bd19fb13f7d713bdbe5bfa0231fd
|
refs/heads/master
|
<repo_name>geuryroustand/Build-Week-LinkedIn-Clone<file_sep>/src/components/assets/fetch.js
const TOKEN =
"<KEY>"
const MY_ID = "60c70adc291930001560ab93"
// Profiles functions
export const getProfiles = async callback => {
try {
const response = await fetch(`${process.env.REACT_APP_BE_URL}/profile/`,
{
// headers: {
// Authorization: `Bearer ${TOKEN}`,
// },
}
)
const data = await response.json()
callback(data)
} catch (error) {
console.log(error)
}
}
export const getProfileById = async (id, callback) => {
try {
const response = await fetch(`${process.env.REACT_APP_BE_URL}/profile/${id}`,
{
// headers: {
// Authorization: `Bearer ${TOKEN}`,
// },
}
)
const data = await response.json()
callback(data)
} catch (error) {
console.log(error)
}
}
export const editProfile = async (payload, pictureFile = null) => {
try {
await fetch(`${process.env.REACT_APP_BE_URL}/profile/`,
{
method: "PUT",
// headers: {
// "Content-Type": "application/json",
// Authorization: `Bearer ${TOKEN}`,
// },
body: JSON.stringify(payload),
})
if (pictureFile) {
const imgResponse = await fetch(`${process.env.REACT_APP_BE_URL}/profile/${MY_ID}/picture`,
{
method: "POST",
// headers: {
// Authorization: `Bearer ${TOKEN}`,
// },
body: pictureFile,
})
console.log(imgResponse)
}
} catch (error) {
console.log(error)
}
}
// Experiences functions
export const addExperience = async payload => {
try {
const response = await fetch(`${process.env.REACT_APP_BE_URL}/profile/${MY_ID}/experiences`,
{
method: "POST",
// headers: {
// "Content-Type": "application/json",
// Authorization: `Bearer ${TOKEN}`,
// },
body: JSON.stringify(payload),
})
const data = await response.json()
console.log(data)
} catch (error) {
console.log(error)
}
}
export const addEditExperience = async (experienceId = "", payload, pictureFile = null) => {
try {
const response = await fetch(`${process.env.REACT_APP_BE_URL}/profile/${MY_ID}/experiences/${experienceId}`,
{
method: experienceId ? "PUT" : "POST",
// headers: {
// "Content-Type": "application/json",
// Authorization: `Bearer ${TOKEN}`,
// },
body: JSON.stringify(payload),
})
const data = await response.json()
if (pictureFile) {
const imgResponse = await fetch(`${process.env.REACT_APP_BE_URL}/profile/${MY_ID}/experiences/${data._id}/picture`,
{
method: "POST",
// headers: {
// Authorization: `Bearer ${TOKEN}`,
// },
body: pictureFile,
})
console.log(imgResponse)
}
} catch (error) {
console.log(error)
}
}
export const getExperiencesById = async (id, callback) => {
const userId = id === "me" ? MY_ID : id
try {
const response = await fetch(`${process.env.REACT_APP_BE_URL}/profile/${userId}/experiences`,
{
// headers: {
// Authorization: `Bearer ${TOKEN}`,
// },
})
const data = await response.json()
callback(data)
} catch (error) {
console.log(error)
}
}
export const deleteExperience = async experienceId => {
try {
await fetch(`${process.env.REACT_APP_BE_URL}/profile/${MY_ID}/experiences/${experienceId}`,
{
method: "DELETE",
// headers: {
// Authorization: `Bearer ${TOKEN}`,
// },
})
} catch (error) {
console.log(error)
}
}
// Posts functions
export const addPost = async (textPayload, imgPayload = null) => {
try {
const textResponse = await fetch(`${process.env.REACT_APP_BE_URL}/posts/`,
{
method: "POST",
// headers: {
// "Content-Type": "application/json",
// Authorization: `Bearer ${TOKEN}`,
// },
body: JSON.stringify(textPayload),
})
const data = await textResponse.json()
console.log(data)
if (imgPayload) {
const imgResponse = await fetch(`${process.env.REACT_APP_BE_URL}/posts/${data._id}`,
{
method: "POST",
// headers: {
// Authorization: `Bearer ${TOKEN}`,
// },
body: imgPayload,
})
console.log(imgResponse)
}
} catch (error) {
console.log(error)
}
}
export const getPosts = async callback => {
try {
const response = await fetch(`${process.env.REACT_APP_BE_URL}/posts/`,
{
// headers: {
// Authorization: `Bearer ${TOKEN}`,
// },
}
)
const data = await response.json()
callback(data)
} catch (error) {
console.log(error)
}
}
export const getPostById = async (postId, callback) => {
try {
const response = await fetch(`${process.env.REACT_APP_BE_URL}/posts/${postId}`,
{
// headers: {
// Authorization: `Bearer ${TOKEN}`,
// },
}
)
const data = await response.json()
callback(data)
} catch (error) {
console.log(error)
}
}
export const editPost = async (postId, payload, imgFile = null) => {
try {
await fetch(`${process.env.REACT_APP_BE_URL}/posts/${postId}`, {
method: "PUT",
// headers: {
// "Content-Type": "application/json",
// Authorization: `Bearer ${TOKEN}`,
// },
body: JSON.stringify(payload),
})
if (imgFile) {
const imgResponse = await fetch(`${process.env.REACT_APP_BE_URL}/posts/${postId}`,
{
method: "POST",
// headers: {
// Authorization: `Bearer ${TOKEN}`,
// },
body: imgFile,
})
console.log(imgResponse)
}
} catch (error) {
console.log(error)
}
}
export const deletePost = async postId => {
try {
await fetch(`${process.env.REACT_APP_BE_URL}/posts/${postId}`,
{
method: "DELETE",
// headers: {
// Authorization: `Bearer ${TOKEN}`,
// },
})
} catch (error) {
console.log(error)
}
}
|
b9d1bd1dcf253ac9fde3028f60b5db46859e7e5a
|
[
"JavaScript"
] | 1 |
JavaScript
|
geuryroustand/Build-Week-LinkedIn-Clone
|
41dcac6b853ac5bb442442c5d29f65b85ddcb2ef
|
a3f0eb5572026459fe95c0a415f76bee23b9ee77
|
refs/heads/master
|
<repo_name>iAJTin/iSMBIOS<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType006 [Memory Module Information (Type 6, Obsolete)].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Memory Module Information (Type 6, Obsolete) structure.<br/>
/// For more information, please see <see cref="SmbiosType006"/>.
/// </summary>
internal sealed class DmiType006 : DmiBaseType<SmbiosType006>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType006"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType006(SmbiosType006 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
properties.Add(DmiProperty.MemoryModule.SocketDesignation, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryModule.SocketDesignation));
properties.Add(DmiProperty.MemoryModule.BankConnections, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryModule.BankConnections));
object currentSpeedProperty = SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryModule.CurrentSpeed);
if (currentSpeedProperty != null)
{
byte currentSpeed = (byte)currentSpeedProperty;
if (currentSpeed != 0x00)
{
properties.Add(DmiProperty.MemoryModule.CurrentSpeed, currentSpeed);
}
}
properties.Add(DmiProperty.MemoryModule.CurrentMemoryType, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryModule.CurrentMemoryType));
properties.Add(DmiProperty.MemoryModule.InstalledSize, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryModule.InstalledSize));
properties.Add(DmiProperty.MemoryModule.EnabledSize, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryModule.EnabledSize));
properties.Add(DmiProperty.MemoryModule.ErrorStatus, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryModule.ErrorStatus));
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemReset/TimerInterval.md
# DmiProperty.SystemReset.TimerInterval property
Gets a value representing the key to retrieve the property value.
Number of minutes to use for the watchdog timer If the timer is not reset within this interval, the system reset timeout begins.
Key Composition
* Structure: SystemReset
* Property: TimerInterval
* Unit: None
Return Value
Type: UInt16
```csharp
public static IPropertyKey TimerInterval { get; }
```
## See Also
* class [SystemReset](../DmiProperty.SystemReset.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.CoolingDevice.md
# DmiProperty.CoolingDevice class
Contains the key definitions available for a type 027 [CoolingDevice] structure.
```csharp
public static class CoolingDevice
```
## Public Members
| name | description |
| --- | --- |
| static [CoolingUnitGroup](DmiProperty.CoolingDevice/CoolingUnitGroup.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Description](DmiProperty.CoolingDevice/Description.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [NominalSpeed](DmiProperty.CoolingDevice/NominalSpeed.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [OemDefined](DmiProperty.CoolingDevice/OemDefined.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [TemperatureProbeHandle](DmiProperty.CoolingDevice/TemperatureProbeHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static class [DeviceTypeAndStatus](DmiProperty.CoolingDevice.DeviceTypeAndStatus.md) | Contains the key definition for the Device Type And Status section. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiStructureCollection/Item.md
# DmiStructureCollection indexer
Gets the element with the specified key.
```csharp
public DmiStructure this[DmiStructureClass resultKey] { get; }
```
## Exceptions
| exception | condition |
| --- | --- |
| InvalidEnumArgumentException | |
## Remarks
If the element does not exist, null is returned.
## See Also
* class [DmiStructure](../DmiStructure.md)
* enum [DmiStructureClass](../DmiStructureClass.md)
* class [DmiStructureCollection](../DmiStructureCollection.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType046 [String Property].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 046: String Property.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 46 String Property |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE 9 Length of the structure. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies Handle, or instance number, associated with the |
// | structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h String WORD Varies Please see GetPropertyId() function |
// | Property ID |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h String BYTE STRING String number. |
// | Property |
// | Value |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h Parent handle WORD Varies Handle corresponding to the structure this string |
// | property applies to. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the String Property (Type 46) structure.
/// </summary>
internal sealed class SmbiosType046 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType046"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType046(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private readonly properties
#region 3.5
/// <summary>
/// Gets a value representing the <b>Property Value</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string PropertyValue => GetString(0x06);
/// <summary>
/// Gets a value representing the <b>Property Id</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort PropertyId => (ushort)Reader.GetWord(0x04);
/// <summary>
/// Gets a value representing the <b>Parent Handle</b> field.
/// </summary>
/// <value>
/// Parent Handle.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ParentHandle => (ushort)Reader.GetWord(0x07);
#endregion
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
#region version 3.5
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v35)
{
properties.Add(SmbiosProperty.StringProperty.PropertyId, GetPropertyId(PropertyId));
properties.Add(SmbiosProperty.StringProperty.PropertyValue, PropertyValue);
properties.Add(SmbiosProperty.StringProperty.ParentHandle, ParentHandle);
}
#endregion
}
#endregion
#region BIOS Specification 3.5.0 (15/09/2021)
/// <summary>
/// Gets a string representing the Property Id.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// Property Id.
/// </returns>
private static string GetPropertyId(ushort code)
{
switch (code)
{
case 0:
return "Reserved";
case 1:
return "UEFI device path";
default:
if (code >= 2 && code <= 32767)
{
return "Reserved for future DMTF use";
}
else if (code >= 32768 && code <= 49151)
{
return "Reserved for BIOS vendor use";
}
else
{
return "Reserved for OEM";
}
}
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiChassisContainedElementCollection.md
# DmiChassisContainedElementCollection class
Represents a collection of objects ChassisContainedElement.
```csharp
public sealed class DmiChassisContainedElementCollection :
ReadOnlyCollection<DmiChassisContainedElement>
```
## Public Members
| name | description |
| --- | --- |
| override [ToString](DmiChassisContainedElementCollection/ToString.md)() | Returns a class String that represents the current object. |
## See Also
* class [DmiChassisContainedElement](./DmiChassisContainedElement.md)
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType023 [System Reset].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the System Reset (Type 23) structure.<br/>
/// For more information, please see <see cref="SmbiosType023"/>.
/// </summary>
internal sealed class DmiType023 : DmiBaseType<SmbiosType023>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType023"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType023(SmbiosType023 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion < DmiStructureVersion.Latest)
{
return;
}
ushort resetCount = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.SystemReset.ResetCount);
if (resetCount != 0xffff)
{
properties.Add(DmiProperty.SystemReset.ResetCount, resetCount);
}
ushort resetLimit = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.SystemReset.ResetLimit);
if (resetLimit != 0xffff)
{
properties.Add(DmiProperty.SystemReset.ResetLimit, resetLimit);
}
ushort timerInterval = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.SystemReset.TimerInterval);
if (timerInterval != 0xffff)
{
properties.Add(DmiProperty.SystemReset.TimerInterval, timerInterval);
}
ushort timeOut = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.SystemReset.Timeout);
if (timeOut != 0xffff)
{
properties.Add(DmiProperty.SystemReset.Timeout, timeOut);
}
properties.Add(DmiProperty.SystemReset.Capabilities.Status, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemReset.Capabilities.Status));
properties.Add(DmiProperty.SystemReset.Capabilities.BootOption, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemReset.Capabilities.BootOption));
properties.Add(DmiProperty.SystemReset.Capabilities.BootOptionOnLimit, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemReset.Capabilities.BootOptionOnLimit));
properties.Add(DmiProperty.SystemReset.Capabilities.WatchdogTimer, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemReset.Capabilities.WatchdogTimer));
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemReset/ResetLimit.md
# DmiProperty.SystemReset.ResetLimit property
Gets a value representing the key to retrieve the property value.
Number of consecutive times the system reset is attempted.
Key Composition
* Structure: SystemReset
* Property: ResetLimit
* Unit: None
Return Value
Type: UInt16
```csharp
public static IPropertyKey ResetLimit { get; }
```
## See Also
* class [SystemReset](../DmiProperty.SystemReset.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType042 [Management Controller Host Interface].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Management Controller Host Interface (Type 42) structure.<br/>
/// For more information, please see <see cref="DmiType042"/>.
/// </summary>
internal sealed class DmiType042: DmiBaseType<SmbiosType042>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType042"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType042(SmbiosType042 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
properties.Add(DmiProperty.ManagementControllerHostInterface.InterfaceType, SmbiosStructure.GetPropertyValue(SmbiosProperty.ManagementControllerHostInterface.InterfaceType));
object interfaceTypeSpecificData = SmbiosStructure.GetPropertyValue(SmbiosProperty.ManagementControllerHostInterface.InterfaceTypeSpecificData);
if (interfaceTypeSpecificData != null)
{
properties.Add(DmiProperty.ManagementControllerHostInterface.InterfaceTypeSpecificData, interfaceTypeSpecificData);
}
object protocols = SmbiosStructure.GetPropertyValue(SmbiosProperty.ManagementControllerHostInterface.Protocols);
if (protocols != null)
{
properties.Add(DmiProperty.ManagementControllerHostInterface.Protocols, new DmiManagementControllerHostInterfaceProtocolRecordsCollection((ManagementControllerHostInterfaceProtocolRecordsCollection)protocols));
}
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.FirmwareInventoryInformation/FirmwareState.md
# DmiProperty.FirmwareInventoryInformation.FirmwareState property
Gets a value representing the key to retrieve the property value.
Firmware state information.
Key Composition
* Structure: FirmwareInventoryInformation
* Property: FirmwareState
* Unit: None
Return Value
Type: String
Remarks
3.5
```csharp
public static IPropertyKey FirmwareState { get; }
```
## See Also
* class [FirmwareInventoryInformation](../DmiProperty.FirmwareInventoryInformation.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor.md
# DmiProperty.Processor class
Contains the key definitions available for a type 004 [Processor Information] structure.
```csharp
public static class Processor
```
## Public Members
| name | description |
| --- | --- |
| static [AssetTag](DmiProperty.Processor/AssetTag.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [CoreCount](DmiProperty.Processor/CoreCount.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [CoreCount2](DmiProperty.Processor/CoreCount2.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [CoreEnabled](DmiProperty.Processor/CoreEnabled.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [CoreEnabled2](DmiProperty.Processor/CoreEnabled2.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [CurrentSpeed](DmiProperty.Processor/CurrentSpeed.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ExternalClock](DmiProperty.Processor/ExternalClock.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Family](DmiProperty.Processor/Family.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [L1CacheHandle](DmiProperty.Processor/L1CacheHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [L2CacheHandle](DmiProperty.Processor/L2CacheHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [L3CacheHandle](DmiProperty.Processor/L3CacheHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MaximumSpeed](DmiProperty.Processor/MaximumSpeed.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [PartNumber](DmiProperty.Processor/PartNumber.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ProcessorId](DmiProperty.Processor/ProcessorId.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ProcessorManufacturer](DmiProperty.Processor/ProcessorManufacturer.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ProcessorType](DmiProperty.Processor/ProcessorType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ProcessorVersion](DmiProperty.Processor/ProcessorVersion.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SerialNumber](DmiProperty.Processor/SerialNumber.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SocketDesignation](DmiProperty.Processor/SocketDesignation.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ThreadCount](DmiProperty.Processor/ThreadCount.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ThreadCount2](DmiProperty.Processor/ThreadCount2.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ThreadEnabled](DmiProperty.Processor/ThreadEnabled.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [UpgradeMethod](DmiProperty.Processor/UpgradeMethod.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static class [Characteristics](DmiProperty.Processor.Characteristics.md) | Contains the key definition for the Characteristics section. |
| static class [Status](DmiProperty.Processor.Status.md) | Contains the key definition for the Status section. |
| static class [Voltage](DmiProperty.Processor.Voltage.md) | Contains the key definition for the Voltage section. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType045 [Firmware Inventory Information].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Firmware Inventory Information (Type 45) structure.<br/>
/// For more information, please see <see cref="SmbiosType045"/>.
/// </summary>
internal sealed class DmiType045: DmiBaseType<SmbiosType045>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType045"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType045(SmbiosType045 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
#region version 3.5
properties.Add(DmiProperty.FirmwareInventoryInformation.FirmwareComponentName, SmbiosStructure.GetPropertyValue(SmbiosProperty.FirmwareInventoryInformation.FirmwareComponentName));
properties.Add(DmiProperty.FirmwareInventoryInformation.FirmwareVersion, SmbiosStructure.GetPropertyValue(SmbiosProperty.FirmwareInventoryInformation.FirmwareVersion));
properties.Add(DmiProperty.FirmwareInventoryInformation.FirmwareVersionFormat, SmbiosStructure.GetPropertyValue(SmbiosProperty.FirmwareInventoryInformation.FirmwareVersionFormat));
properties.Add(DmiProperty.FirmwareInventoryInformation.FirmwareId, SmbiosStructure.GetPropertyValue(SmbiosProperty.FirmwareInventoryInformation.FirmwareId));
properties.Add(DmiProperty.FirmwareInventoryInformation.FirmwareIdFormat, SmbiosStructure.GetPropertyValue(SmbiosProperty.FirmwareInventoryInformation.FirmwareIdFormat));
properties.Add(DmiProperty.FirmwareInventoryInformation.FirmwareReleaseDate, SmbiosStructure.GetPropertyValue(SmbiosProperty.FirmwareInventoryInformation.FirmwareReleaseDate));
properties.Add(DmiProperty.FirmwareInventoryInformation.FirmwareManufacturer, SmbiosStructure.GetPropertyValue(SmbiosProperty.FirmwareInventoryInformation.FirmwareManufacturer));
properties.Add(DmiProperty.FirmwareInventoryInformation.LowestSupportedFirmwareVersion, SmbiosStructure.GetPropertyValue(SmbiosProperty.FirmwareInventoryInformation.LowestSupportedFirmwareVersion));
properties.Add(DmiProperty.FirmwareInventoryInformation.FirmwareImageSize, SmbiosStructure.GetPropertyValue(SmbiosProperty.FirmwareInventoryInformation.FirmwareImageSize));
properties.Add(DmiProperty.FirmwareInventoryInformation.FirmwareCharacteristics, SmbiosStructure.GetPropertyValue(SmbiosProperty.FirmwareInventoryInformation.FirmwareCharacteristics));
properties.Add(DmiProperty.FirmwareInventoryInformation.FirmwareState, SmbiosStructure.GetPropertyValue(SmbiosProperty.FirmwareInventoryInformation.FirmwareState));
var numberOfAssociatedComponents = (byte)SmbiosStructure.GetPropertyValue(SmbiosProperty.FirmwareInventoryInformation.NumberOfAssociatedComponents);
properties.Add(DmiProperty.FirmwareInventoryInformation.NumberOfAssociatedComponents, numberOfAssociatedComponents);
if (numberOfAssociatedComponents != 0)
{
properties.Add(DmiProperty.FirmwareInventoryInformation.AssociatedComponentHandles, SmbiosStructure.GetPropertyValue(SmbiosProperty.FirmwareInventoryInformation.AssociatedComponentHandles));
}
#endregion
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType005 [Memory Controller Information (Obsolete)].cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using iTin.Core;
using iTin.Core.Helpers.Enumerations;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 005: Memory Controller Information.
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length deviceProperty Description |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.0+ Type BYTE 5 Memory Controller Indicator |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.0+ Length BYTE Varies 0fh + (2 * x) for version 2.0 |
// | 10h + (2 * x) for version 2.1 and later |
// | Where x is the 0Eh field value. |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 2.0+ Handle WORD Varies |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 2.0+ Error Detecting BYTE ENUM Note: Please see, GetErrorDetectingMethod |
// | Method |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h 2.0+ Error BYTE Bit Field Note: Please see, GetErrorDetectingMethod |
// | Correcting |
// | Capability |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h 2.0+ Supported BYTE ENUM Note: Please see, GetControllerInterleave |
// | Interleave |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h 2.0+ Current Interleave BYTE ENUM Note: Please see, GetControllerInterleave |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h 2.0+ Maximum BYTE Varies (n) The size of the largest memory module |
// | Memory supported (per slot), specified as n, |
// | Module Size where 2**n is the maximum size in MB. |
// | The maximum amount of memory supported by |
// | this controller is that deviceProperty times |
// | the number of slots, as specified in offset |
// | 0Eh of this structure. |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 09h 2.0+ Supported Speeds WORD Bit Field Note: Please see, GetControllerSupportedSpeeds |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Bh 2.0+ Supported WORD Bit Field Note: Please see, GetControllerSupportedTypes |
// | Memory Types |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Dh 2.0+ Memory BYTE Bit Field This field describes the requiered voltages |
// | Module for every memory module. |
// | Voltage |
// | Bits 07:03 - Reserved, must be zero |
// | Bit 02 - 2.9V |
// | Bit 01 - 3.3V |
// | Bit 00 - 5V |
// | |
// | Setting of multiple bits indicates that |
// | the sockets are configurable. |
// | Note: Please see, GetControllerModuleVoltage |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Eh 2.0+ Number of BYTE Varies Defines how many of the Memory Module |
// | Associated Information blocks are controlled by this |
// | Memory Slots controller. |
// | (x) |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Fh to 2.0+ Memory x Varies A list of memory information structure |
// | 0Fh + Module WORDs handles controlled by this controller. |
// | (2*x)-1 Configuration deviceProperty in offset 0Eh (x) defines the |
// | Handles count. |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Fh + 2.1+ Enabled Error BYTE Bit Field Identifies the error-correcting |
// | (2*x) Correcting capabilities that were enabled when the |
// | Capabilities structure was built. |
// | Note: Please see, GetErrorCorrectingCapability |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Memory Controller Information (Type 5, Obsolete) structure.
/// </summary>
internal sealed class SmbiosType005 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType005"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType005(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private readonly properties
/// <summary>
/// Gets a value representing the <b>Error Detecting Method</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ErrorDetectingMethod => Reader.GetByte(0x04);
/// <summary>
/// Gets a value representing the <b>Error Correcting Capabilities</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ErrorCorrectingCapabilities => Reader.GetByte(0x05);
/// <summary>
/// Gets a value representing the <b>Supported Interleave</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte SupportedInterleave => StructureInfo.RawData[0x06];
/// <summary>
/// Gets a value representing the <b>Current Interleave</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte CurrentInterleave => Reader.GetByte(0x07);
/// <summary>
/// Gets a value representing the <b>Maximum Memory Module Size</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int MaximumMemoryModuleSize => (int)Math.Pow(2, Reader.GetByte(0x08));
/// <summary>
/// Gets a value representing the <b>Supported Speeds</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort SupportedSpeeds => (ushort)Reader.GetWord(0x09);
/// <summary>
/// Gets a value representing the <b>Supported Memory Types</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort SupportedMemoryTypes => (ushort)Reader.GetWord(0x0b);
/// <summary>
/// Gets a value representing the <b>Memory Module Voltages</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte MemoryModuleVoltages => Reader.GetByte(0x0d);
/// <summary>
/// Gets a value representing the '<b>Number Memory Slots</b>'.
/// </summary>
/// <deviceProperty>
/// Property value.
/// </deviceProperty>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte NumberMemorySlots => StructureInfo.RawData[0x0e];
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.v20)
{
return;
}
properties.Add(SmbiosProperty.MemoryController.ErrorDetectingMethod, GetErrorDetectingMethod(ErrorDetectingMethod));
properties.Add(SmbiosProperty.MemoryController.ErrorCorrectingCapabilities, GetErrorCorrectingCapability(ErrorCorrectingCapabilities));
properties.Add(SmbiosProperty.MemoryController.SupportedInterleave, GetControllerInterleave(SupportedInterleave));
properties.Add(SmbiosProperty.MemoryController.CurrentInterleave, GetControllerInterleave(CurrentInterleave));
properties.Add(SmbiosProperty.MemoryController.MaximumMemoryModuleSize, MaximumMemoryModuleSize);
properties.Add(SmbiosProperty.MemoryController.SupportedSpeeds, GetControllerSupportedSpeeds(SupportedSpeeds));
properties.Add(SmbiosProperty.MemoryController.SupportedMemoryTypes, GetControllerSupportedTypes(SupportedMemoryTypes));
properties.Add(SmbiosProperty.MemoryController.MemoryModuleVoltages, GetControllerModuleVoltages(MemoryModuleVoltages));
var n = NumberMemorySlots;
properties.Add(SmbiosProperty.MemoryController.NumberMemorySlots, n);
if (n == 0x00)
{
return;
}
var m = n << 1;
var containedElementsArray = StructureInfo.RawData.Extract(0x0f, m).ToArray();
var containedElements = GetContainedMemoryModules(containedElementsArray);
properties.Add(SmbiosProperty.MemoryController.ContainedMemoryModules, new MemoryControllerContainedElementCollection(containedElements));
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v21)
{
properties.Add(SmbiosProperty.MemoryController.EnabledErrorCorrectingCapabilities, GetErrorCorrectingCapability(StructureInfo.RawData[0x0f + m]));
}
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets a string representing the interpolation method.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// The interpolation method.
/// </returns>
private static string GetControllerInterleave(byte code)
{
string[] deviceProperty =
{
"Other", // 0x01
"Unknown",
"1 way",
"2 way",
"4 way",
"8 way",
"16 way" // 0x07
};
if (code >= 0x01 && code <= 0x07)
{
return deviceProperty[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets the list of memory devices that control this memory controller.
/// </summary>
/// <param name="rawdevicePropertyArray">Raw information.</param>
/// <returns>
/// Collection of items contained in this memory controller.
/// </returns>
private static IEnumerable<int> GetContainedMemoryModules(IList<byte> rawdevicePropertyArray)
{
var containedElements = new Collection<int>();
for (byte i = 0; i < rawdevicePropertyArray.Count; i++)
{
containedElements.Add(rawdevicePropertyArray.ToArray().GetWord(i));
i++;
}
return containedElements;
}
/// <summary>
/// Returns a collection of voltages supported by the memory device.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// Collection of voltages supported by the memory device.
/// </returns>
private static ReadOnlyCollection<string> GetControllerModuleVoltages(byte code)
{
string[] deviceProperty =
{
"5.0", // 0
"3.3",
"2.9" // 2
};
var items = new List<string>();
bool isLegacyMode = code.CheckBit(Bits.Bit07);
if (isLegacyMode)
{
double voltage = (double)(code & 0x7f) / 10;
items.Add($"{voltage}");
}
else
{
for (byte i = 0; i <= 2; i++)
{
bool addVoltage = code.CheckBit(i);
if (addVoltage)
{
items.Add(deviceProperty[i]);
}
}
}
return items.AsReadOnly();
}
/// <summary>
/// Gets a collection of supported speeds.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// Gets a collection of supported speeds.
/// </returns>
private static ReadOnlyCollection<string> GetControllerSupportedSpeeds(int code)
{
string[] deviceProperty =
{
"Other", // 0x00
"Unknown",
"70",
"60",
"50" // 0x04
};
List<string> items = new List<string>();
for (byte i = 0x00; i <= 0x04; i++)
{
bool addSpeed = code.CheckBit(i);
if (addSpeed)
{
items.Add(deviceProperty[i]);
}
}
return items.AsReadOnly();
}
/// <summary>
/// Gets a collection of supported memory types.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// Collection of supported memory types.
/// </returns>
private static ReadOnlyCollection<string> GetControllerSupportedTypes(int code)
{
string[] deviceProperty =
{
"Other", // 0x00
"Unknown",
"Standard",
"Fast Page Mode",
"EDO",
"Parity",
"ECC",
"SIMM",
"DIMM",
"Burst EDO",
"SDRAM" // 0x0a
};
List<string> items = new List<string>();
for (byte i = 0x00; i <= 0x0a; i++)
{
bool addType = code.CheckBit(i);
if (addType)
{
items.Add(deviceProperty[i]);
}
}
return items.AsReadOnly();
}
/// <summary>
/// Gets a string representing the error correction method.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// The error correction method.
/// </returns>
private static string GetErrorCorrectingCapability(byte code)
{
string[] items =
{
"Other", // 0x01
"Unknown",
"None",
"Single bit error correcting",
"Double bit error correcting",
"Error Scrubbing" // 0x05
};
string deviceProperty = string.Empty;
for (byte i = 0; i <= 0x05; i++)
{
bool addItem = code.CheckBit(i);
if (addItem)
{
deviceProperty = items[i];
}
}
return deviceProperty;
}
/// <summary>
/// Gets a string representing the error detection method.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// The error detection method.
/// </returns>
private static string GetErrorDetectingMethod(byte code)
{
string[] deviceProperty =
{
"Other", // 0x01
"Unknown",
"None",
"8-bit Parity",
"32-bit ECC",
"64-bit ECC",
"128-bit ECC",
"CRC" // 0x08
};
if (code >= 0x01 && code <= 0x08)
{
return deviceProperty[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType031 [Boot Integrity Services (BIS) Entry Point].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Boot Integrity Services (BIS) Entry Point (Type 31) structure.<br/>
/// For more information, please see <see cref="SmbiosType031"/>.
/// </summary>
internal sealed class DmiType031 : DmiBaseType<SmbiosType031>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType031"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType031(SmbiosType031 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion <= DmiStructureVersion.Latest)
{
return;
}
properties.Add(DmiProperty.BootIntegrityServicesEntryPoint.Checksum, SmbiosStructure.GetPropertyValue(SmbiosProperty.BootIntegrityServicesEntryPoint.Checksum));
properties.Add(DmiProperty.BootIntegrityServicesEntryPoint.BisEntryPointAddress16, SmbiosStructure.GetPropertyValue(SmbiosProperty.BootIntegrityServicesEntryPoint.BisEntryPointAddress16));
properties.Add(DmiProperty.BootIntegrityServicesEntryPoint.BisEntryPointAddress32, SmbiosStructure.GetPropertyValue(SmbiosProperty.BootIntegrityServicesEntryPoint.BisEntryPointAddress32));
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/RCDRevisionNumber.md
# DmiProperty.MemoryDevice.RCDRevisionNumber property
Gets a value representing the key to retrieve the property.
The RCD Revision Number indicates the revision of the RCD on memory device. This field shall be set to the value of the SPD Register Revision Number. A value of FF00h indicates the RCD Revision Number is unknown.
Key Composition
* Structure: MemoryDevice
* Property: RCDRevisionNumber
* Unit: None
Return Value
Type: UInt16
Remarks
3.7+
```csharp
public static IPropertyKey RCDRevisionNumber { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType011 [OEM Strings].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode OEM Strings (Type 11) structure.<br/>
/// For more information, please see <see cref="SmbiosType011"/>.
/// </summary>
internal sealed class DmiType011 : DmiBaseType<SmbiosType011>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType011"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType011(SmbiosType011 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
properties.Add(DmiProperty.OemStrings.Values, SmbiosStructure.GetPropertyValue(SmbiosProperty.OemStrings.Values));
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/Base/IDmiType.cs
using System.Collections.Generic;
using iTin.Core.Hardware.Common;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// The <b>DmiBaseType</b> class provides functions to analyze the properties associated with a structure <see cref="DMI"/>.
/// </summary>
public interface IDmiType
{
/// <summary>
/// Returns a list of implemented properties for a structure
/// </summary>
/// <returns>
/// A list of implemented properties for a structure.
/// </returns>
IEnumerable<IPropertyKey> ImplementedProperties { get; }
/// <summary>
/// Returns a value that indicates the implemented version of a <see cref="DMI"/> structure.
/// </summary>
/// <returns>
/// One of the values of the <see cref="DmiStructureVersion"/> enumeration.
/// </returns>
DmiStructureVersion ImplementedVersion { get; }
/// <summary>
/// Gets the properties available for this structure.
/// </summary>
/// <value>
/// Availables properties.
/// </value>
DmiClassPropertiesTable Properties { get; }
/// <summary>
/// Returns the value of specified property. Always returns the first appearance of the property.
/// </summary>
/// <param name="propertyKey">Key to the property to obtain</param>
/// <returns>
/// <para>
/// A <see cref="QueryPropertyResult"/> reference that contains the result of the operation, to check if the operation is correct, the <b>Success</b>
/// property will be <b>true</b> and the <b>Value</b> property will contain the value; Otherwise, the the <b>Success</b> property
/// will be false and the <b>Errors</b> property will contain the errors associated with the operation, if they have been filled in.
/// </para>
/// <para>
/// The type of the <b>Value</b> property is <see cref="PropertyItem"/>. Contains the result of the operation.
/// </para>
/// <para>
/// </para>
/// </returns>
QueryPropertyResult GetProperty(IPropertyKey propertyKey);
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.ProcessorAdditionalInformation/ReferencedHandle.md
# DmiProperty.ProcessorAdditionalInformation.ReferencedHandle property
Gets a value representing the key to retrieve the property value.
Handle, or instance number, associated with the processor structure (Type 004).
Key Composition
* Structure: ProcessorAdditionalInformation
* Property: ReferencedHandle
* Unit: None
Return Value
Type: UInt16
Remarks
3.3+
```csharp
public static IPropertyKey ReferencedHandle { get; }
```
## See Also
* class [ProcessorAdditionalInformation](../DmiProperty.ProcessorAdditionalInformation.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Specific/Risk-V-ProcessorSpecificData.cs
using System;
using System.Diagnostics;
using iTin.Core;
namespace iTin.Hardware.Specification.Smbios;
// Type 044: Processor Specific Block > RISC-V Processor-specific Data.
// For more information, please see: https://github.com/riscv/riscv-smbios/blob/master/RISCV-SMBIOS.md#risc-v_processor-specific_data.
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length Value Description |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 0100h Revision of RISC-V WORD 0100h Bit 15:08 Major revision |
// | (v1.0) Processor Specific Bit 07:00 Minor revision |
// | Block Specific The newer revision of RISC-V Processor- |
// | specific Block Structure is backward |
// | compatible with older version of this |
// | structure. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 0100h Structure BYTE 110 Length of Processor-specific Data. |
// | (v1.0) Length |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 03h 0100h Hart ID DQWORD Varies The ID of this RISC-V Hart. |
// | (v1.0) |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 13h 0100h Boot Hart BYTE Boolean 1: This is boot hart to boot system |
// | (v1.0) 0: This is not the boot hart |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 14h 0100h Machine DQWORD Varies The vendor ID of this RISC-V Hart |
// | (v1.0) Vendor ID |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 24h 0100h Machine DQWORD Varies Base microarchitecture of the hart. |
// | (v1.0) Architecture ID Value of 0 is possible to indicate the |
// | field is not implemented |
// | The combination of Machine Architecture |
// | ID and Machine Vendor ID should |
// | uniquely identify the type of hart |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 34h 0100h Machine DQWORD Varies Unique encoding of the version of the |
// | (v1.0) Implementation ID processor implementation. |
// | Value of 0 possible to indicate the |
// | field is not implemented. |
// | The Implementation value should reflect |
// | the design of the RISC-V Hart. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 44h 0100h Instruction set DWORD Bit Field Bit 25:00 encodes the presence of |
// | (v1.0) supported RISK-V standard extensions, |
// | which is equivalent to |
// | bits [25:0] in RISC-V |
// | Machine ISA Register |
// | (misa CSR). |
// | Bits set to one mean the |
// | certain extensions of |
// | instruction set are |
// | supported on this hart. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 48h 0100h Privilege Level BYTE Varies The privilege levels supported by this |
// | (v1.0) Supported RISC-V Hart. |
// | Bit 00: Machine Mode |
// | Bit 01: Reserved |
// | Bit 02: Supervisor Mode |
// | Bit 03: User Mode |
// | Bit 04:06 Reserved |
// | Bit 07 Debug Mode |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 49h 0100h Machine DQWORD Varies Bit set to one means the corresponding |
// | (v1.0) Exception Trap exception is delegated to supervisor |
// | Delegation execution environment. |
// | Information Otherwise, supervisor execution |
// | environment must register the event |
// | handler in Machine-Mode for the certain |
// | exceptions through environment call. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 59h 0100h Machine DQWORD Varies Bit set to one means the corresponding |
// | (v1.0) Interrupt Trap Interrupt is delegated to supervisor |
// | Delegation execution environment. |
// | Information Otherwise, supervisor execution |
// | environment must register the event |
// | handler in Machine-Mode for the certain |
// | Interrupts through environment call. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 69h 0100h The register BYTE ENUM The width of register supported by this |
// | (v1.0) width (XLEN) RISC-V Hart. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 6Ah 0100h The register BYTE ENUM The width (See below) of Machine Mode |
// | width (XLEN) native base integer ISA supported by |
// | this RISC-V Hart. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 6Bh 0100h Reserved BYTE ENUM Placeholder for Hypervisor Mode |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 6Ch 0100h Supervisor BYTE ENUM The width of Supervisor Mode native |
// | (v1.0) Mode native base integer ISA supported by this |
// | base integer RISC-V Hart. |
// | ISA width |
// | (S-XLEN) |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 6Dh 0100h User Mode BYTE ENUM The width of the User Mode native base |
// | (v1.0) native base integer ISA supported by this RISC-V |
// | integer ISA Hart. |
// | width (S-XLEN) |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// This class represents a processor specific block of the structure <see cref="SmbiosType044"/>.
/// </summary>
public class RiskVProcessorSpecificData : IProcessorSpecificData
{
#region private readonly memebrs
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly byte[] _data;
#endregion
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="RiskVProcessorSpecificData"/> class specifying the structure information.
/// </summary>
/// <param name="processorSpecificInformationBlockData">Untreated information of the current structure.</param>
internal RiskVProcessorSpecificData(byte[] processorSpecificInformationBlockData)
{
_data = processorSpecificInformationBlockData;
}
/// <summary>
/// Initializes a new instance of the <see cref="RiskVProcessorSpecificData"/> class.
/// </summary>
private RiskVProcessorSpecificData()
{
_data = Array.Empty<byte>();
}
#endregion
#region public static properties
/// <summary>
/// Returns a new <see cref="RiskVProcessorSpecificData"/> instance that indicates that it has not been implemented.
/// </summary>
/// <value>
/// A new <see cref="RiskVProcessorSpecificData"/> instance.
/// </value>
public static RiskVProcessorSpecificData NotImplemented => new RiskVProcessorSpecificData();
#endregion
#region private readonly properties
/// <summary>
/// Gets a value that represents the '<b>Revision</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int? Revision => _data.IsNullOrEmpty()
? null
: _data.GetWord(0x00);
/// <summary>
/// Gets a value that represents the '<b>Boot Hart</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool? BootHart => _data.IsNullOrEmpty()
? null
: _data[0x13] == 1;
#endregion
#region public readonly properties
/// <summary>
/// Gets a value that represents the '<b>Major Revision</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
public byte? MajorRevision => Revision == null
? null
: (byte?)((Revision & 0xf0) >> 7);
/// <summary>
/// Gets a value that represents the '<b>Minor Revision</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
public byte? MinorRevision => Revision == null
? null
: (byte?)(Revision & 0x0f);
/// <summary>
/// Gets a value that represents the '<b>Register Width (XLEN)</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
public byte? RegisterWidth => _data?[0x69];
/// <summary>
/// Gets a value that represents the '<b>Machine Mode</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
public string MachineMode => _data.IsNullOrEmpty()
? string.Empty
: GetRiscNativeBaseIntegerIsaWidth(_data[0x6a]);
/// <summary>
/// Gets a value that represents the '<b>Supervisor Mode</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
public string SupervisorMode => _data.IsNullOrEmpty()
? string.Empty
: GetRiscNativeBaseIntegerIsaWidth(_data[0x6c]);
#region [public] (string) UserMode: Gets a value that represents the 'User Mode' field
/// <summary>
/// Gets a value that represents the '<b>User Mode</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
public string UserMode => _data.IsNullOrEmpty()
? string.Empty
: GetRiscNativeBaseIntegerIsaWidth(_data[0x6d]);
#endregion
#endregion
#region public override methods
/// <summary>
/// Returns a class <see cref="string"/> that represents the current object.
/// </summary>
/// <returns>
/// Object <see cref="string"/> that represents the current <see cref="RiskVProcessorSpecificData"/> class.
/// </returns>
public override string ToString() => $"Revision = {MajorRevision}{MinorRevision}";
#endregion
#region private static methods
private static string GetRiscNativeBaseIntegerIsaWidth(byte code)
{
string[] value =
{
"Unsupported", // 0x00
"32-bit",
"64-bit",
"128-bit" // 0x03
};
if (code <= 0x03)
{
return value[code];
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.OnBoardDevices.md
# DmiProperty.OnBoardDevices class
Contains the key definitions available for a type 010, obsolete [OnBoardDevices Information] structure.
```csharp
public static class OnBoardDevices
```
## Public Members
| name | description |
| --- | --- |
| static [Description](DmiProperty.OnBoardDevices/Description.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [DeviceType](DmiProperty.OnBoardDevices/DeviceType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Enabled](DmiProperty.OnBoardDevices/Enabled.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.CoolingDevice.DeviceTypeAndStatus/Status.md
# DmiProperty.CoolingDevice.DeviceTypeAndStatus.Status property
Gets a value representing the key to retrieve the property value.
Cooling device status.
Key Composition
* Structure: CoolingDevice
* Property: Status
* Unit: None
Return Value
Type: String
Remarks
2.2+
```csharp
public static IPropertyKey Status { get; }
```
## See Also
* class [DeviceTypeAndStatus](../DmiProperty.CoolingDevice.DeviceTypeAndStatus.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType030 [Out-of-Band Remote Access].cs
using System.Diagnostics;
using iTin.Core;
using iTin.Core.Helpers.Enumerations;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 030: Out-of-Band Remote Access.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 30 Out-of-Band Remote Access indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE 06h Length of the structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies The handle, or instance number, associated with the |
// | structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Manufacturer BYTE STRING The number of the string that contains the |
// | Name manufacturer of the out-of-band access facility. |
// | Note: See Manufacturer |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Connections BYTE Bit Field Identifies the current remote-access connections: |
// | |
// | Bits 07:02 - Reserved for future definition by this |
// | specification; set to all zeros. |
// | |
// | Bit 01 - Outbound Connection Enabled. Identifies |
// | whether (1) or not (0) the facility is |
// | allowed to initiate outbound connections |
// | to contact an alert management facility |
// | when critical conditions occur. |
// | Note: See OutboundConnection |
// | |
// | Bit 00 - Inbound Connection Enabled. Identifies |
// | whether (1) or not (0) the facility is |
// | allowed to initiate outbound connections |
// | to receive incoming facility connections |
// | for the purpose of remote operations or |
// | problem management. |
// | Note: See InboundConnection |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Out-of-Band Remote Access (Type 30) structure.
/// </summary>
internal sealed class SmbiosType030 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType030"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType030(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Manufacturer Name</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string ManufacturerName => GetString(0x04);
/// <summary>
/// Gets a value representing the <b>Connections</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Connections => Reader.GetByte(0x05);
/// <summary>
/// Gets a value representing the <b>InBound Connection</b> feature of the <b>Connections</b> field
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string InBoundConnection => Connections.CheckBit(Bits.Bit00) ? "Enabled" : "Disabled";
/// <summary>
/// Gets a value representing the <b>OutBound Connection</b> feature of the <b>Connections</b> field
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string OutBoundConnection => Connections.CheckBit(Bits.Bit01) ? "Enabled" : "Disabled";
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.Latest)
{
return;
}
properties.Add(SmbiosProperty.OutOfBandRemote.Manufacturer, ManufacturerName);
properties.Add(SmbiosProperty.OutOfBandRemote.Connections.OutBoundConnection, OutBoundConnection);
properties.Add(SmbiosProperty.OutOfBandRemote.Connections.InBoundConnection, InBoundConnection);
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Cache/CacheSpeed.md
# DmiProperty.Cache.CacheSpeed property
Gets a value representing the key to retrieve the property value.
Cache module speed, in nanoseconds.
Key Composition
* Structure: Cache
* Property: CacheSpeed
* Unit: ns
Return Value
Type: Byte
Remarks
2.1+
```csharp
public static IPropertyKey CacheSpeed { get; }
```
## See Also
* class [Cache](../DmiProperty.Cache.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDeviceMappedAddress/StartingAddress.md
# DmiProperty.MemoryDeviceMappedAddress.StartingAddress property
Gets a value representing the key to retrieve the property value.
Physical starting address.
Key Composition
* Structure: MemoryDeviceMappedAddress
* Property: StartingAddress
* Unit: Bytes
Return Value
Type: UInt64
Remarks
2.1+, 2.7+
```csharp
public static IPropertyKey StartingAddress { get; }
```
## See Also
* class [MemoryDeviceMappedAddress](../DmiProperty.MemoryDeviceMappedAddress.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Specific/GroupAssociationElement.cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 014: Group Associations. Contained Elements
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Item Type BYTE Varies Item (Structure) Type of this member |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Item Handle WORD Varies Handle corresponding to this structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// This class represents an element of the structure <see cref="SmbiosType014"/>.
/// </summary>
public class GroupAssociationElement : SpecificSmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initialize a new instance of the class <see cref="GroupAssociationElement"/> specifying the information of the structure.
/// </summary>
/// <param name="groupAssociationElement">Untreated information of the current structure.</param>
internal GroupAssociationElement(byte[] groupAssociationElement) : base(groupAssociationElement)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value that represents the '<b>Handle</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort Handle => (ushort)GetWord(0x01);
/// <summary>
/// Gets a value that represents the '<b>ItemType</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private SmbiosStructure ItemType => (SmbiosStructure)GetByte(0x00);
#endregion
#region public override methods
/// <summary>
/// Returns a class <see cref="T: System.String"/> that represents the current object.
/// </summary>
/// <returns>
/// Object <see cref="string"/> that represents the current <see cref = "AdditionalInformationEntry"/> class.
/// </returns>
/// <remarks>
/// This method returns a string that includes the properties <see cref="ItemType"/>
/// and <see cref="Handle"/>.
/// </remarks>
public override string ToString() => $"Structure = {ItemType}, Handle = {Handle}";
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
properties.Add(SmbiosProperty.GroupAssociations.Items.Structure, ItemType);
properties.Add(SmbiosProperty.GroupAssociations.Items.Handle, Handle);
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.FirmwareInventoryInformation.md
# DmiProperty.FirmwareInventoryInformation class
Contains the key definitions available for a type 045 [FirmwareInventoryInformation] structure.
```csharp
public static class FirmwareInventoryInformation
```
## Public Members
| name | description |
| --- | --- |
| static [AssociatedComponentHandles](DmiProperty.FirmwareInventoryInformation/AssociatedComponentHandles.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [FirmwareCharacteristics](DmiProperty.FirmwareInventoryInformation/FirmwareCharacteristics.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [FirmwareComponentName](DmiProperty.FirmwareInventoryInformation/FirmwareComponentName.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [FirmwareId](DmiProperty.FirmwareInventoryInformation/FirmwareId.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [FirmwareIdFormat](DmiProperty.FirmwareInventoryInformation/FirmwareIdFormat.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [FirmwareImageSize](DmiProperty.FirmwareInventoryInformation/FirmwareImageSize.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [FirmwareManufacturer](DmiProperty.FirmwareInventoryInformation/FirmwareManufacturer.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [FirmwareReleaseDate](DmiProperty.FirmwareInventoryInformation/FirmwareReleaseDate.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [FirmwareState](DmiProperty.FirmwareInventoryInformation/FirmwareState.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [FirmwareVersion](DmiProperty.FirmwareInventoryInformation/FirmwareVersion.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [FirmwareVersionFormat](DmiProperty.FirmwareInventoryInformation/FirmwareVersionFormat.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [LowestSupportedFirmwareVersion](DmiProperty.FirmwareInventoryInformation/LowestSupportedFirmwareVersion.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [NumberOfAssociatedComponents](DmiProperty.FirmwareInventoryInformation/NumberOfAssociatedComponents.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.IpmiDevice.md
# DmiProperty.IpmiDevice class
Contains the key definitions available for a type 038 [IpmiDevice Information] structure.
```csharp
public static class IpmiDevice
```
## Public Members
| name | description |
| --- | --- |
| static [BaseAddress](DmiProperty.IpmiDevice/BaseAddress.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [I2CSlaveAddress](DmiProperty.IpmiDevice/I2CSlaveAddress.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [InterfaceType](DmiProperty.IpmiDevice/InterfaceType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [InterruptNumber](DmiProperty.IpmiDevice/InterruptNumber.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [NVStorageDeviceAddress](DmiProperty.IpmiDevice/NVStorageDeviceAddress.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SpecificationRevision](DmiProperty.IpmiDevice/SpecificationRevision.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static class [BaseAdressModifier](DmiProperty.IpmiDevice.BaseAdressModifier.md) | Contains the key definition for the Base Adress Modifier section. |
| static class [Interrupt](DmiProperty.IpmiDevice.Interrupt.md) | Definition of keys for the 'Interrupt' section. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType015 [System Event Log].cs
using System.Collections.ObjectModel;
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the System Event Log (Type 15) structure.<br/>
/// For more information, please see <see cref="SmbiosType015"/>.
/// </summary>
internal sealed class DmiType015 : DmiBaseType<SmbiosType015>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType015"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType015(SmbiosType015 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
#region 2.0+
if (ImplementedVersion >= DmiStructureVersion.v20)
{
object logAreaLength = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemEventLog.LogAreaLength);
if (logAreaLength != null)
{
properties.Add(DmiProperty.SystemEventLog.LogAreaLength, logAreaLength);
}
object logHeaderStartOffset = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemEventLog.LogHeaderStartOffset);
if (logHeaderStartOffset != null)
{
properties.Add(DmiProperty.SystemEventLog.LogHeaderStartOffset, logHeaderStartOffset);
}
object dataStartOffset = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemEventLog.DataStartOffset);
if (dataStartOffset != null)
{
properties.Add(DmiProperty.SystemEventLog.DataStartOffset, dataStartOffset);
}
object accessMethod = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemEventLog.AccessMethod);
if (accessMethod != null)
{
properties.Add(DmiProperty.SystemEventLog.AccessMethod, accessMethod);
}
object logStatus = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemEventLog.LogStatus);
if (logStatus != null)
{
properties.Add(DmiProperty.SystemEventLog.LogStatus, logStatus);
}
object accessMethodAddress = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemEventLog.AccessMethodAddress);
if (accessMethodAddress != null)
{
properties.Add(DmiProperty.SystemEventLog.AccessMethodAddress, accessMethodAddress);
}
object logChangeToken = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemEventLog.LogChangeToken);
if (logChangeToken != null)
{
properties.Add(DmiProperty.SystemEventLog.LogChangeToken, logChangeToken);
}
}
#endregion
#region 2.1+
if (ImplementedVersion >= DmiStructureVersion.v21)
{
object logHeaderFormat = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemEventLog.LogHeaderFormat);
if (logHeaderFormat != null)
{
properties.Add(DmiProperty.SystemEventLog.LogHeaderFormat, logHeaderFormat);
}
object supportedLogTypeDescriptors = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemEventLog.SupportedLogTypeDescriptors);
if (supportedLogTypeDescriptors != null)
{
properties.Add(DmiProperty.SystemEventLog.SupportedLogTypeDescriptors, supportedLogTypeDescriptors);
}
object listSupportedEventLogTypeDescriptors = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemEventLog.ListSupportedEventLogTypeDescriptors);
if (listSupportedEventLogTypeDescriptors != null)
{
var collection = new Collection<DmiSupportedEventLogTypeDescriptorElement>();
var items = (SupportedEventLogTypeDescriptorsCollection) listSupportedEventLogTypeDescriptors;
foreach (var item in items)
{
collection.Add(new DmiSupportedEventLogTypeDescriptorElement(item));
}
properties.Add(DmiProperty.SystemEventLog.ListSupportedEventLogTypeDescriptors, new DmiSupportedEventLogTypeDescriptorsCollection(collection));
}
}
#endregion
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/QueryPropertyCollectionResultExtensions.md
# QueryPropertyCollectionResultExtensions class
Static class than contains extension methods for types QueryPropertyCollectionResult.
```csharp
public static class QueryPropertyCollectionResultExtensions
```
## Public Members
| name | description |
| --- | --- |
| static [AsDictionaryResult](QueryPropertyCollectionResultExtensions/AsDictionaryResult.md)(…) | Converts a QueryPropertyCollectionResult instance into a new QueryPropertyDictionaryResult instance. |
## See Also
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification/DMI/SmbiosVersion.md
# DMI.SmbiosVersion property
Gets the SMBIOS version.
```csharp
public string SmbiosVersion { get; }
```
## Property Value
The SMBIOS version.
## See Also
* class [DMI](../DMI.md)
* namespace [iTin.Hardware.Specification](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/README.md
<p align="center">
<img src="https://cdn.rawgit.com/iAJTin/iSMBIOS/master/nuget/iSMBIOS.png"
height="32"/>
</p>
<p align="center">
<a href="https://github.com/iAJTin/iSMBIOS">
<img src="https://img.shields.io/badge/iTin-iSMBIOS-green.svg?style=flat"/>
</a>
</p>
***
# What is iSMBIOS?
iSMBIOS is a lightweight implementation that allows us to obtain the SMBIOS information. **Currently only works on Windows**
This library implements DMTF Specification 3.7.0 version and olders versions
For more information, please see [https://www.dmtf.org/standards/smbios](https://www.dmtf.org/standards/smbios)
# Install via NuGet
- From nuget gallery
<table>
<tr>
<td>
<a href="https://github.com/iAJTin/iSMBIOS">
<img src="https://img.shields.io/badge/-iSMBIOS-green.svg?style=flat"/>
</a>
</td>
<td>
<a href="https://www.nuget.org/packages/iSMBIOS/">
<img alt="NuGet Version"
src="https://img.shields.io/nuget/v/iSMBIOS.svg" />
</a>
</td>
</tr>
</table>
- From package manager console
```PM> Install-Package iSMBIOS```
# Install via PowerShell
Now if you want you can use iSMBIOS from PowerShell. It has the [iPowerShellSmbios] module available that contains a collection of Cmdlets that allow us to obtain the SMBIOS information. If you want to know more, please review the available documentation from [here].
- From PowerShellGallery
<table>
<tr>
<td>
<a href="https://github.com/iAJTin/iPowerShellSmbios">
<img src="https://img.shields.io/badge/-iPowerShellSmbios-green.svg?style=flat"/>
</a>
</td>
<td>
<a href="https://www.powershellgallery.com/packages/iPowerShellSmbios/">
<img alt="PowerShellGallery Version"
src="https://img.shields.io/powershellgallery/v/iPowerShellSmbios.svg?style=flat-square&label=iPowerShellSmbios" />
</a>
</td>
</tr>
</table>
- From PowerShell console
```PM> Install-Module -Name iPowerShellSmbios```
# Usage
#### Before
Call **DMI.Instance.Structures** for getting all SMBIOS structures availables.
#### Now
The **DMI.Instance** property now is mark as obsolete use **DMI.CreateInstance()** method instead
If you want to connect to a remote machine fill in an instance of the DmiConnectOptions object and use it
as the argument of the **DMI method.CreateInstance(optionsInstance)**.
For more info, please see [CHANGELOG] file.
## Examples
1. Gets and prints **SMBIOS** version.
Console.WriteLine($@" SMBIOS Version > {DMI.CreateInstance().SmbiosVersion}");
2. Gets and prints all **SMBIOS** availables structures.
DmiStructureCollection structures = DMI.CreateInstance().Structures;
foreach (DmiStructure structure in structures)
{
Console.WriteLine($@" {(int)structure.Class:D3}-{structure.FriendlyClassName}");
int totalStructures = structure.Elements.Count;
if (totalStructures > 1)
{
Console.WriteLine($@" > {totalStructures} structures");
}
}
3. Gets and prints the implemented **SMBIOS** structure version.
DmiStructureCollection structures = DMI.CreateInstance().Structures;
foreach (DmiStructure structure in structures)
{
Console.WriteLine($@" {(int)structure.Class:D3}-{structure.FriendlyClassName}");
DmiClassCollection elements = structure.Elements;
foreach (DmiClass element in elements)
{
Console.WriteLine($@" > Version > {element.ImplementedVersion}");
}
}
4. Gets a **single property** directly.
DmiStructureCollection structures = DMI.CreateInstance().Structures;
QueryPropertyResult biosVersion = structures.GetProperty(DmiProperty.Bios.BiosVersion);
if (biosVersion.Success)
{
Console.WriteLine($@" > BIOS Version > {biosVersion.Result.Value}");
}
QueryPropertyResult biosVendor = structures.GetProperty(DmiProperty.Bios.Vendor);
if (biosVendor.Success)
{
Console.WriteLine($@" > BIOS Vendor > {biosVendor.Result.Value}");
}
QueryPropertyResult currentSpeed = structures.GetProperty(DmiProperty.Processor.CurrentSpeed);
if (currentSpeed.Success)
{
Console.WriteLine($@" > Current Speed > {currentSpeed.Result.Value} {currentSpeed.Result.Key.PropertyUnit}");
}
QueryPropertyResult processorManufacturer = structures.GetProperty(DmiProperty.Processor.ProcessorManufacturer);
if (processorManufacturer.Success)
{
Console.WriteLine($@" > Processor Manufacturer > {processorManufacturer.Result.Value}");
}
5. Gets a property in **multiple** elements directly (Handle result as collection).
// Requires that the Slot Information structure exists in your system
DmiStructureCollection structures = DMI.CreateInstance().Structures;
QueryPropertyCollectionResult systemSlotsQueryResult = structures.GetProperties(DmiProperty.SystemSlots.SlotDesignation);
if (!systemSlotsQueryResult.Success)
{
Console.WriteLine($@" > Error(s)");
Console.WriteLine($@" {systemSlotsQueryResult.Errors.AsMessages().ToStringBuilder()}");
}
else
{
IEnumerable<PropertyItem> systemSlotsItems = systemSlotsQueryResult.Result.ToList();
bool hasSystemSlotsItems = systemSlotsItems.Any();
if (!hasSystemSlotsItems)
{
Console.WriteLine($@" > Sorry, The '{DmiProperty.SystemSlots.SlotId}' property has not implemented on this system");
}
else
{
int index = 0;
foreach (var systemSlotItem in systemSlotsItems)
{
Console.WriteLine($@" > System Slot ({index}) > {systemSlotItem.Value}");
index++;
}
}
}
6. Gets a property in **multiple** elements directly (Handle result as dictionary).
// Requires that the Slot Information structure exists in your system
DmiStructureCollection structures = DMI.CreateInstance().Structures;
QueryPropertyCollectionResult systemSlotsQueryResult = structures.GetProperties(DmiProperty.SystemSlots.SlotDesignation);
var systemSlotsQueryDictionayResult = systemSlotsQueryResult.AsDictionaryResult();
if (!systemSlotsQueryDictionayResult.Success)
{
Console.WriteLine($@" > Error(s)");
Console.WriteLine($@" {systemSlotsQueryDictionayResult.Errors.AsMessages().ToStringBuilder()}");
}
else
{
var systemSlotsItems = systemSlotsQueryDictionayResult.Result.ToList();
bool hasSystemSlotsItems = systemSlotsItems.Any();
if (!hasSystemSlotsItems)
{
Console.WriteLine($@" > Sorry, The '{DmiProperty.SystemSlots.SlotId}' property has not implemented on this system");
}
else
{
foreach (var systemSlotItemEntry in systemSlotsItems)
{
var itemIndex = systemSlotItemEntry.Key;
var itemValue = systemSlotItemEntry.Value;
Console.WriteLine($@" > System Slot ({itemIndex}) > {itemValue.Value}");
}
}
}
7. Prints all **SMBIOS** structures properties
DmiStructureCollection structures = DMI.CreateInstance().Structures;
foreach (DmiStructure structure in structures)
{
DmiClassCollection elements = structure.Elements;
foreach (DmiClass element in elements)
{
Console.WriteLine();
Console.WriteLine(element.ImplementedVersion == DmiStructureVersion.Latest
? $@" ———————————————————————————————————————————————————— {element.ImplementedVersion} ——"
: $@" ——————————————————————————————————————————————————————— {element.ImplementedVersion} ——");
Console.WriteLine($@" {(int)structure.Class:D3}-{structure.FriendlyClassName} structure detail");
Console.WriteLine(@" ——————————————————————————————————————————————————————————————");
IEnumerable<IPropertyKey> properties = element.ImplementedProperties;
foreach (var property in properties)
{
QueryPropertyResult queryResult = element.GetProperty(property);
PropertyItem propertyItem = queryResult.Result;
object value = propertyItem.Value;
string friendlyName = property.GetPropertyName();
PropertyUnit valueUnit = property.PropertyUnit;
string unit = valueUnit == PropertyUnit.None ? string.Empty : valueUnit.ToString();
if (value == null)
{
Console.WriteLine($@" > {friendlyName} > NULL");
continue;
}
if (value is string)
{
Console.WriteLine($@" > {friendlyName} > {value} {unit}");
}
else if (value is byte)
{
Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X2}h]");
}
else if (value is short)
{
Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X4}h]");
}
else if (value is ushort)
{
Console.WriteLine(property.Equals(DmiProperty.MemoryDevice.ConfiguredMemoryClockSpeed)
? $@" > {friendlyName} > {value} {(int.Parse(dmi.SmbiosVersion) > 300 ? PropertyUnit.MTs : PropertyUnit.MHz)} [{value:X4}h]"
: $@" > {friendlyName} > {value} {unit} [{value:X4}h]");
}
else if (value is int)
{
Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X4}h]");
}
else if (value is uint)
{
Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X4}h]");
}
else if (value is long)
{
Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X8}h]");
}
else if (value is ulong)
{
Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X8}h]");
}
else if (value.GetType() == typeof(ReadOnlyCollection<byte>))
{
Console.WriteLine($@" > {friendlyName} > {string.Join(", ", (ReadOnlyCollection<byte>)value)}");
}
else if (value is DmiGroupAssociationElementCollection)
{
// prints elements
}
else if (value.GetType() == typeof(ReadOnlyCollection<string>))
{
Console.WriteLine($@" > {friendlyName}");
var collection = (ReadOnlyCollection<string>)value;
foreach (var entry in collection)
{
Console.WriteLine($@" > {entry} {unit}");
}
}
else
{
Console.WriteLine($@" > {friendlyName} > {value} {unit}");
}
}
}
}
# Documentation
- For full code documentation, please see next link [documentation].
# How can I send feedback!!!
If you have found **iSMBIOS** useful at work or in a personal project, I would love to hear about it. If you have decided not to use **iSMBIOS**, please send me and email stating why this is so. I will use this feedback to improve **iSMBIOS** in future releases.
My email address is
![email.png][email]
[email]: ./assets/email.png "email"
[documentation]: ./documentation/iTin.Hardware.Specification.Dmi.md
[CHANGELOG]: https://github.com/iAJTin/iSMBIOS/blob/master/CHANGELOG.md
[iPowerShellSmbios]: https://github.com/iAJTin/iPowerShellSmbios
[here]: https://github.com/iAJTin/iPowerShellSmbios/blob/main/documentation/iPowerShellSmbios.md
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType004 [Processor Information].cs
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using iTin.Core;
using iTin.Core.Helpers.Enumerations;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 004: Processor Information.
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length Value Description |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.0+ Type BYTE 4 Processor Information Indicator |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.0+ Length BYTE Varies 1ah para version 2.0 |
// | Minimo 20h para version 2.1 y posteriores |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 2.0+ Handle WORD Varies |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 2.0+ Socket BYTE STRING Número o cadena terminada en nulo. |
// | Designation EXAMPLE: ‘J202’,0 |
// | Note: Ver SocketDesignation |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h 2.0+ Processor Type BYTE ENUM Note: See GetProcessorType(byte) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h 2.0+ Processor BYTE ENUM Note: See GetProcessorFamily(byte[], ReadOnlyCollection<string>) |
// | Family |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h 2.0+ Processor BYTE STRING Número o cadena terminada en nulo. |
// | Manufacturer Note: See Manufacturer |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h 2.0+ Processor ID QWORD Varies Raw processor identification data. |
// | Note: Ver ProcessorId |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 10h 2.0+ Processor Version BYTE STRING String number . |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 11h 2.0+ Voltage BYTE Varies Bit 07 - Mode. |
// | 0b - ‘legacy’ mode. |
// | 1b - Manual mode. |
// | Note: See IsLegacyMode |
// | |
// | Bits 06:04 - Reserved, must be zero |
// | |
// | Bits 03:00 - Voltage Capability. |
// | 0h – 5V |
// | 1h – 3.3V |
// | 2h – 2.9V |
// | 3h – Reserved, must be zero. |
// | Setting of multiple bits indicates the socket is |
// | configurable. |
// | Note: See VoltageCapability |
// | |
// | If bit 7 is set to 1, the remaining seven bits of the field are set |
// | to contain the processor’s current voltage times 10. |
// | |
// | EXAMPLE: The field value for a processor voltage of 1.8 volts would |
// | be: |
// | 92h = 80h + (1.8 * 10) = 80h + 18 = 80h + 12h |
// | Note: See VoltageValue |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 12h 2.0+ External Clock WORD Varies External Clock Frequency en MHz. |
// | 0000h si el valor es desconocido. |
// | Note: See GetProcessorFrequency(uint) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 14h 2.0+ Max Speed WORD Varies Máxima velocidad de procesador (MHz) soportada por este sistema. |
// | 0E9h para una velocidad de 233 MHz. |
// | 0000h si el valor es desconocido. |
// | Este campo muestra una capacidad del sistema no el procesador en si |
// | mismo. |
// | Note: See GetProcessorFrequency(uint) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 16h 2.0+ Current Speed WORD Varies Same format as Max Speed This field identifies the processor's speed |
// | at system boot, and the Processor ID field implies the processor's |
// | additional speed characteristics (that is, single speed or multiple |
// | speed). |
// | Note: See GetProcessorFrequency(uint) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 18h 2.0+ Status BYTE Varies Bit 7 Reserved, must be zero |
// | Bit 6 CPU Socket Populated |
// | 1 – CPU Socket Populated |
// | 0 – CPU Socket Unpopulated |
// | Bits 5:3 Reserved, must be zero |
// | Bits 2:0 CPU Status |
// | 0h – Unknown |
// | 1h – CPU Enabled |
// | 2h – CPU Disabled by User through BIOS Setup. |
// | 3h – CPU Disabled By BIOS (POST Error). |
// | 4h – CPU is Idle, waiting to be enabled. |
// | 5-6h – Reserved |
// | 7h – Other |
// | Note: See GetProcessorStatus(byte) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 19h 2.0+ Processor Upgrade BYTE ENUM Note: See GetProcessorUpgrade(byte) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 1Ah 2.1+ L1 Cache WORD Varies The handle of a Cache Information structure that defines the |
// | Handle attributes of the primary (Level 1) cache for this processor. |
// | For version 2.1 and version 2.2 implementations, the value is 0FFFFh |
// | if the processor has no L1 cache. For version 2.3 and later |
// | implementations, the value is 0FFFFh if the Cache Information |
// | structure is not provided. |
// | Note: See Parse(Hashtable) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 1Ch 2.1+ L2 Cache WORD Varies The handle of a Cache Information structure that defines the |
// | Handle attributes of the secondary (Level 2) cache for this processor. |
// | For version 2.1 and version 2.2 implementations, the value is 0FFFFh |
// | if the processor has no L2 cache. For version 2.3 and later |
// | implementations, the value is 0FFFFh if the Cache Information |
// | structure is not provided. |
// | Note: See Parse(Hashtable) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 1Eh 2.1+ L3 Cache WORD Varies The handle of a Cache Information structure that defines the |
// | Handle attributes of the tertiary (Level 3) cache for this processor. |
// | For version 2.1 and version 2.2 implementations, the value is 0FFFFh |
// | if the processor has no L3 cache. For version 2.3 and later |
// | implementations , the value is 0FFFFh if the Cache Information |
// | structure is not provided. |
// | Note: See Parse(Hashtable) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 20h 2.3+ Serial Number BYTE STRING Número o cadena terminada en nulo. |
// | Note: See SerialNumber |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 21h 2.3+ Asset Tag BYTE STRING Número o cadena terminada en nulo. |
// | Note: See AssetTag |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 22h 2.3+ Part Number BYTE STRING Número o cadena terminada en nulo. |
// | Note: See PartNumber |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 23h 2.5+ Core Count BYTE Varies Número de núcleos por procesador. |
// | 00h si el valor es desconocido. |
// | Note: See CoreCount |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 24h 2.5+ Core Enabled BYTE Varies Número de núcleos activos por procesador. |
// | 00h si el valor es desconocido. |
// | Note: See CoreEnabled |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 25h 2.5+ Thread Count BYTE Varies Número de procesos por procesador. |
// | 00h si el valor es desconocido. |
// | Note: See ThreadCount |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 26h 2.5+ Processor WORD Bit Field Funciones soportadas por el procesador. |
// | Characteristics Note: Ver Parse(Hashtable) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 28h 2.6+ Processor WORD ENUM Note: See GetProcessorFamily(byte[], ReadOnlyCollection<string>) |
// | Family 2 |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 2Ah 3.0+ Core Count 2 WORD Varies Número de cores por procesador. |
// | |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 2Ch 3.0+ Core Enabled 2 WORD Varies Número de cores activos por procesador. |
// | |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 2Eh 3.0+ Thread Count 2 WORD Varies Número de hilos por por procesador. |
// | |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 30h 3.6+ Thread Enabled WORD Varies Number of enabled threads per processor. |
// | 0000h = unknown |
// | 0001h-FFFEh = thread enabled counts 1 to 65534, respectively |
// | FFFFh = reserved |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Processor Information (Type 4) structure.
/// </summary>
internal sealed class SmbiosType004 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType004"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType004(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private readonly properties
/// <summary>
/// Gets a value representing the <b>Socket Designation</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string SocketDesignation => GetString(0x04);
/// <summary>
/// Gets a value representing the <b>Processor Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ProcessorType => Reader.GetByte(0x05);
/// <summary>
/// Gets a value representing the <b>Manufacturer</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Manufacturer => GetString(0x07);
/// <summary>
/// Gets a value representing the <b>Processor Id</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string ProcessorId => $"{Reader.GetQuadrupleWord(0x08):X}";
/// <summary>
/// Gets a value representing the <b>Version</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Version => GetString(0x10);
/// <summary>
/// Gets a value representing the <b>Voltages</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Voltages => Reader.GetByte(0x11);
/// <summary>
/// Gets a value representing the <b>Voltage Value</b> characteristic of the <b>Voltages</b> field
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private double VoltageValue => (double) (Voltages & 0x7f) / 10;
/// <summary>
/// Gets a value representing the <b>Voltage Capability</b> characteristic of the <b>Voltages</b> field
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte VoltageCapability => (byte)(Voltages & 0x0f);
/// <summary>
/// Gets a value representing the <b>Is Legacy Mode</b> characteristic of the <b>Voltage</b> field
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool IsLegacyMode => !Voltages.CheckBit(Bits.Bit07);
/// <summary>
/// Gets a value representing the <b>External Clock</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ExternalClock => (ushort)Reader.GetWord(0x12);
/// <summary>
/// Gets a value representing the <b>Maximun Speed</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort MaximunSpeed => (ushort)Reader.GetWord(0x14);
/// <summary>
/// Gets a value representing the <b>Current Speed</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort CurrentSpeed => (ushort)Reader.GetWord(0x16);
/// <summary>
/// Gets a value representing the <b>Status</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Status => Reader.GetByte(0x18);
/// <summary>
/// Gets a value representing the <b>Socket Populated</b> characteristic of the <b>Status</b> field
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool SocketPopulated => Status.CheckBit(Bits.Bit06);
/// <summary>
/// Gets a value representing the <b>Cpu Status</b> characteristic of the <b>Status</b> field
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte CpuStatus => (byte)(Status & 0x07);
/// <summary>
/// Gets a value representing the <b>Upgrade Method</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte UpgradeMethod => Reader.GetByte(0x19);
/// <summary>
/// Gets a value representing the <b>L1 Cache Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort L1CacheHandle => (ushort)Reader.GetWord(0x1a);
/// <summary>
/// Gets a value representing the <b>L2 Cache Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort L2CacheHandle => (ushort)Reader.GetWord(0x1c);
/// <summary>
/// Gets a value representing the <b>L3 Cache Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort L3CacheHandle => (ushort)Reader.GetWord(0x1e);
/// <summary>
/// Gets a value representing the <b>Serial Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string SerialNumber => GetString(0x20);
/// <summary>
/// Gets a value representing the <b>Asset Tag</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string AssetTag => GetString(0x21);
/// <summary>
/// Gets a value representing the <b>Part Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string PartNumber => GetString(0x22);
/// <summary>
/// Gets a value representing the <b>Core Count</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte CoreCount => Reader.GetByte(0x23);
/// <summary>
/// Gets a value representing the <b>Core Enabled</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte CoreEnabled => Reader.GetByte(0x24);
/// <summary>
/// Gets a value representing the <b>Thread Count</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ThreadCount => Reader.GetByte(0x25);
/// <summary>
/// Gets a value representing the <b>Characteristics</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort Characteristics => (ushort)Reader.GetWord(0x26);
/// <summary>
/// Gets a value representing the <b>Is Capable 64Bit</b> characteristic of the <b>Characteristics</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool IsCapable64Bit => Characteristics.CheckBit(Bits.Bit02);
/// <summary>
/// Gets a value representing the <b>Is MultiCore</b> characteristic of the <b>Characteristics</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool IsMultiCore => Characteristics.CheckBit(Bits.Bit03);
/// <summary>
/// Gets a value representing the <b>Multiple Hardware Threads Per Core</b> characteristic of the <b>Characteristics</b> field
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool MultipleHardwareThreadsPerCore => Characteristics.CheckBit(Bits.Bit04);
/// <summary>
/// Gets a value representing the <b>Execute Protection</b> characteristic of the <b>Characteristics</b> field
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool ExecuteProtection => Characteristics.CheckBit(Bits.Bit05);
/// <summary>
/// Gets a value representing the <b>Enhanced Virtualization</b> characteristic of the <b>Characteristics</b> field
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool EnhancedVirtualization => Characteristics.CheckBit(Bits.Bit06);
/// <summary>
/// Gets a value representing the <b>Power Performance Control</b> characteristic of the <b>Characteristics</b> field
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool PowerPerformanceControl => Characteristics.CheckBit(Bits.Bit07);
/// <summary>
/// Gets a value representing the <b>128-bit Capable</b> characteristic of the <b>Characteristics</b> field
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool IsCapable128Bit => Characteristics.CheckBit(Bits.Bit08);
/// <summary>
/// Gets a value representing the <b>Arm64 SoC Id</b> characteristic of the <b>Characteristics</b> field
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool Arm64SocIdSupported => Characteristics.CheckBit(Bits.Bit09);
/// <summary>
/// Gets a value representing the <b>Core Count 2</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort CoreCount2 => (ushort)Reader.GetWord(0x2a);
/// <summary>
/// Gets a value representing the <b>Core Enabled 2</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort CoreEnabled2 => (ushort)Reader.GetWord(0x2c);
/// <summary>
/// Gets a value representing the <b>Thread Count 2</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ThreadCount2 => (ushort)Reader.GetWord(0x2e);
/// <summary>
/// Gets a value representing the <b>Thread Count 2</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ThreadEnabled => (ushort)Reader.GetWord(0x30);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
#region 2.0+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v20)
{
properties.Add(SmbiosProperty.Processor.SocketDesignation, SocketDesignation);
properties.Add(SmbiosProperty.Processor.ProcessorType, GetProcessorType(ProcessorType));
properties.Add(SmbiosProperty.Processor.ProcessorVersion, Version);
properties.Add(SmbiosProperty.Processor.Family, GetProcessorFamily(StructureInfo.RawData, Strings));
properties.Add(SmbiosProperty.Processor.ProcessorManufacturer, Manufacturer);
properties.Add(SmbiosProperty.Processor.ProcessorId, ProcessorId);
properties.Add(SmbiosProperty.Processor.Voltage.IsLegacyMode, IsLegacyMode);
bool isLegacyMode = IsLegacyMode;
if (!isLegacyMode)
{
var items = new List<string> {$"{VoltageValue}"};
properties.Add(SmbiosProperty.Processor.Voltage.SupportedVoltages, items.AsReadOnly());
}
else
{
properties.Add(SmbiosProperty.Processor.Voltage.SupportedVoltages, GetVoltagesCapability(VoltageCapability));
}
properties.Add(SmbiosProperty.Processor.ExternalClock, ExternalClock);
properties.Add(SmbiosProperty.Processor.MaximunSpeed, MaximunSpeed);
properties.Add(SmbiosProperty.Processor.CurrentSpeed, CurrentSpeed);
properties.Add(SmbiosProperty.Processor.Status.CpuStatus, GetProcessorStatus(CpuStatus));
properties.Add(SmbiosProperty.Processor.Status.SocketPopulated, SocketPopulated);
properties.Add(SmbiosProperty.Processor.UpgradeMethod, GetProcessorUpgrade(UpgradeMethod));
}
#endregion
#region 2.1+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v21)
{
int l1CacheHandle = L1CacheHandle;
if (l1CacheHandle == 0xffff)
{
if (SmbiosVersion >= 0x0203)
{
properties.Add(SmbiosProperty.Processor.L1CacheHandle, 0); // Structure not provided
}
else
{
properties.Add(SmbiosProperty.Processor.L1CacheHandle, -1); // Cache not installed
}
}
else
{
properties.Add(SmbiosProperty.Processor.L1CacheHandle, l1CacheHandle);
}
int l2CacheHandle = L2CacheHandle;
if (l2CacheHandle == 0xffff)
{
if (SmbiosVersion >= 0x0203)
{
properties.Add(SmbiosProperty.Processor.L2CacheHandle, 0); // Structure not provided
}
else
{
properties.Add(SmbiosProperty.Processor.L2CacheHandle, -1); // Cache not installed
}
}
else
{
properties.Add(SmbiosProperty.Processor.L2CacheHandle, L2CacheHandle);
}
int l3CacheHandle = L3CacheHandle;
if (l3CacheHandle == 0xffff)
{
if (SmbiosVersion >= 0x0203)
{
properties.Add(SmbiosProperty.Processor.L3CacheHandle, 0); // Structure not provided
}
else
{
properties.Add(SmbiosProperty.Processor.L3CacheHandle, -1); // Cache not installed
}
}
else
{
properties.Add(SmbiosProperty.Processor.L3CacheHandle, L3CacheHandle);
}
}
#endregion
#region 2.3+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v23)
{
properties.Add(SmbiosProperty.Processor.SerialNumber, SerialNumber);
properties.Add(SmbiosProperty.Processor.AssetTag, AssetTag);
properties.Add(SmbiosProperty.Processor.PartNumber, PartNumber);
}
#endregion
#region 2.5+
if (StructureInfo.Length >= 0x24)
{
var coreCount = CoreCount;
if (coreCount != 0x00)
{
if (coreCount != 0xff)
{
properties.Add(SmbiosProperty.Processor.CoreCount, coreCount);
}
else
{
if (StructureInfo.Length >= 0x2b)
{
var coreCount2 = CoreCount2;
if (coreCount2 != 0x0000)
{
if (coreCount2 != 0xffff)
{
properties.Add(SmbiosProperty.Processor.CoreCount, coreCount2);
}
}
}
}
}
}
if (StructureInfo.Length >= 0x25)
{
byte coreEnabled = CoreEnabled;
if (coreEnabled != 0x00)
{
if (coreEnabled != 0xff)
{
properties.Add(SmbiosProperty.Processor.CoreEnabled, coreEnabled);
}
else
{
if (StructureInfo.Length >= 0x2d)
{
int coreEnabled2 = CoreEnabled2;
if (coreEnabled2 != 0x0000)
{
if (coreEnabled2 != 0xffff)
{
properties.Add(SmbiosProperty.Processor.CoreEnabled, coreEnabled2);
}
}
}
}
}
}
if (StructureInfo.Length >= 0x26)
{
byte threadCount = ThreadCount;
if (threadCount != 0x00)
{
if (threadCount != 0xff)
{
properties.Add(SmbiosProperty.Processor.ThreadCount, threadCount);
}
else
{
if (StructureInfo.Length >= 0x2f)
{
var threadCount2 = ThreadCount2;
if (threadCount2 != 0x0000)
{
if (threadCount2 != 0xffff)
{
properties.Add(SmbiosProperty.Processor.ThreadCount, threadCount2);
}
}
}
}
}
}
if (StructureInfo.Length >= 0x27)
{
properties.Add(SmbiosProperty.Processor.Characteristics.Arm64SocIdSupported, Arm64SocIdSupported);
properties.Add(SmbiosProperty.Processor.Characteristics.Capable64Bits, IsCapable64Bit);
properties.Add(SmbiosProperty.Processor.Characteristics.Capable128Bits, IsCapable128Bit);
properties.Add(SmbiosProperty.Processor.Characteristics.MultiCore, IsMultiCore);
properties.Add(SmbiosProperty.Processor.Characteristics.HardwareThreadPerCore, MultipleHardwareThreadsPerCore);
properties.Add(SmbiosProperty.Processor.Characteristics.ExecuteProtectionSupport, ExecuteProtection);
properties.Add(SmbiosProperty.Processor.Characteristics.EnhancedVirtualizationInstructions, EnhancedVirtualization);
properties.Add(SmbiosProperty.Processor.Characteristics.PowerPerformanceControlSupport, PowerPerformanceControl);
}
#endregion
#region 3.6+
if (StructureInfo.StructureVersion == SmbiosStructureVersion.v36)
{
properties.Add(SmbiosProperty.Processor.ThreadEnabled, ThreadEnabled);
}
#endregion
}
#endregion
#region BIOS Specification 3.7.0 (23/07/2023)
/// <summary>
/// Gets a string that identifies the processor family.
/// </summary>
/// <param name="table">Raw information.</param>
/// <param name="strings">Collection of strings available for this structure.</param>
/// <returns>
/// Processor family.
/// </returns>
private static string GetProcessorFamily(IList<byte> table, IEnumerable<string> strings)
{
var items = new Hashtable
{
{ (ushort)0x01, "Other" },
{ (ushort)0x02, "Unknown" },
{ (ushort)0x03, "8086" },
{ (ushort)0x04, "80286" },
{ (ushort)0x05, "Intel386™ processor" },
{ (ushort)0x06, "Intel486™ processor" },
{ (ushort)0x07, "8087" },
{ (ushort)0x08, "80287" },
{ (ushort)0x0A, "80487" },
{ (ushort)0x0B, "Intel® Pentium® processor" },
{ (ushort)0x0C, "Pentium® Pro processor" },
{ (ushort)0x0D, "Pentium® II processor" },
{ (ushort)0x0E, "Pentium® processor with MMX™ technology" },
{ (ushort)0x0F, "Intel® Celeron® processor" },
{ (ushort)0x10, "Pentium® II Xeon™ processor" },
{ (ushort)0x11, "Pentium® III processor" },
{ (ushort)0x12, "M1" },
{ (ushort)0x13, "M2" },
{ (ushort)0x14, "Intel® Celeron® M processor" },
{ (ushort)0x15, "Intel® Pentium® 4 HT processor" },
{ (ushort)0x16, "Intel® Processor" },
//// 0x17 - Disponible.
{ (ushort)0x18, "AMD Duron™ Processor Family" },
{ (ushort)0x19, "K5" },
{ (ushort)0x1A, "K6" },
{ (ushort)0x1B, "K6-2" },
{ (ushort)0x1C, "K6-3" },
{ (ushort)0x1D, "AMD Athlon™ Processor Family" },
{ (ushort)0x1E, "AMD29000 Family" },
{ (ushort)0x1F, "K6-2+" },
{ (ushort)0x20, "Power PC" },
{ (ushort)0x21, "Power PC 601" },
{ (ushort)0x22, "Power PC 603" },
{ (ushort)0x23, "Power PC 603+" },
{ (ushort)0x24, "Power PC 604" },
{ (ushort)0x25, "Power PC 620" },
{ (ushort)0x26, "Power PC x704" },
{ (ushort)0x27, "Power PC 750" },
{ (ushort)0x28, "Intel® Core™ Duo processor" },
{ (ushort)0x29, "Intel® Core™ Duo mobile processor" },
{ (ushort)0x2A, "Intel® Core™ Solo mobile processor" },
{ (ushort)0x2B, "Intel® Atom™ processor" },
{ (ushort)0x2C, "Intel® Core™ M processor" },
{ (ushort)0x2D, "Intel(R) Core(TM) m3 processor" },
{ (ushort)0x2E, "Intel(R) Core(TM) m5 processor" },
{ (ushort)0x2F, "Intel(R) Core(TM) m7 processor" },
{ (ushort)0x30, "Alpha Family" },
{ (ushort)0x31, "Alpha 21064" },
{ (ushort)0x32, "Alpha 21066" },
{ (ushort)0x33, "Alpha 21164" },
{ (ushort)0x34, "Alpha 21164PC" },
{ (ushort)0x35, "Alpha 21164a" },
{ (ushort)0x36, "Alpha 21264" },
{ (ushort)0x37, "Alpha 21364" },
{ (ushort)0x38, "AMD Turion™ II Ultra Dual-Core Mobile M Processor Family" },
{ (ushort)0x39, "AMD Turion™ II Dual-Core Mobile M Processor Family" },
{ (ushort)0x3A, "AMD Athlon™ II Dual-Core M Processor Family" },
{ (ushort)0x3B, "AMD Opteron™ 6100 Series Processor" },
{ (ushort)0x3C, "AMD Opteron™ 4100 Series Processor" },
{ (ushort)0x3D, "AMD Opteron™ 6200 Series Processor" },
{ (ushort)0x3E, "AMD Opteron™ 4200 Series Processor" },
{ (ushort)0x3F, "AMD FX™ Series Processor" },
{ (ushort)0x40, "MIPS" },
{ (ushort)0x41, "MIPS R4000" },
{ (ushort)0x42, "MIPS R4200" },
{ (ushort)0x43, "MIPS R4400" },
{ (ushort)0x44, "MIPS R4600" },
{ (ushort)0x45, "MIPS R10000" },
{ (ushort)0x46, "AMD C-Series Processor" },
{ (ushort)0x47, "AMD E-Series Processor" },
{ (ushort)0x48, "AMD S-Series Processor" },
{ (ushort)0x49, "AMD G-Series Processor" },
{ (ushort)0x4A, "AMD Z-Series Processor" },
{ (ushort)0x4B, "AMD R-Series Processor" },
{ (ushort)0x4C, "AMD Opteron™ 4300 Series Processor" },
{ (ushort)0x4D, "AMD Opteron™ 6300 Series Processor" },
{ (ushort)0x4E, "AMD Opteron™ 3300 Series Processor" },
{ (ushort)0x4F, "AMD FirePro™ Series Processor" },
{ (ushort)0x50, "SPARC" },
{ (ushort)0x51, "SuperSPARC" },
{ (ushort)0x52, "MicroSPARC II" },
{ (ushort)0x53, "MicroSPARC IIep" },
{ (ushort)0x54, "UltraSPARC" },
{ (ushort)0x55, "UltraSPARC II" },
{ (ushort)0x56, "UltraSPARC IIi" },
{ (ushort)0x57, "UltraSPARC III" },
{ (ushort)0x58, "UltraSPARC IIIi" },
//// 0x59 - Disponible.
//// 0x5A - Disponible.
//// 0x45 - Disponible.
//// 0x5C - Disponible.
//// 0x5D - Disponible.
//// 0x5E - Disponible.
//// 0x5F - Disponible.
{ (ushort)0x60, "68040" },
{ (ushort)0x61, "68xxx" },
{ (ushort)0x62, "68000" },
{ (ushort)0x63, "68010" },
{ (ushort)0x64, "68020" },
{ (ushort)0x65, "68030" },
{ (ushort)0x66, "AMD Athlon(TM) X4 Quad-Core Processor Family" },
{ (ushort)0x67, "AMD Opteron(TM) X1000 Series Processor" },
{ (ushort)0x68, "AMD Opteron(TM) X2000 Series APU" },
{ (ushort)0x69, "AMD Opteron(TM) A-Series Processor" },
{ (ushort)0x6A, "AMD Opteron(TM) X3000 Series APU" },
{ (ushort)0x6B, "AMD Zen Processor Family" },
//// 0x6C - Disponible.
//// 0x6D - Disponible.
//// 0x6E - Disponible.
//// 0x6F - Disponible.
{ (ushort)0x70, "Hobbit Family" },
//// 0x71 - Disponible.
//// 0x72 - Disponible.
//// 0x73 - Disponible.
//// 0x74 - Disponible.
//// 0x75 - Disponible.
//// 0x76 - Disponible.
//// 0x77 - Disponible.
{ (ushort)0x78, "Crusoe™ TM5000 Family" },
{ (ushort)0x79, "Crusoe™ TM3000 Family" },
{ (ushort)0x7A, "Efficeon™ TM8000 Family" },
//// 0x7B - Disponible.
//// 0x7C - Disponible.
//// 0x7D - Disponible.
//// 0x7E - Disponible.
//// 0x7F - Disponible.
{ (ushort)0x80, "Weitek" },
//// 0x81 - Disponible.
{ (ushort)0x82, "Itanium™ processor" },
{ (ushort)0x83, "AMD Athlon™ 64 Processor Family" },
{ (ushort)0x84, "AMD Opteron™ Processor Family" },
{ (ushort)0x85, "AMD Sempron™ Processor Family" },
{ (ushort)0x86, "AMD Turion™ 64 Mobile Technology" },
{ (ushort)0x87, "Dual-Core AMD Opteron™ Processor Family" },
{ (ushort)0x88, "AMD Athlon™ 64 X2 Dual-Core Processor Family" },
{ (ushort)0x89, "AMD Turion™ 64 X2 Mobile Technology" },
{ (ushort)0x8A, "Quad-Core AMD Opteron™ Processor Family" },
{ (ushort)0x8B, "Third-Generation AMD Opteron™ Processor Family" },
{ (ushort)0x8C, "AMD Phenom™ FX Quad-Core Processor Family" },
{ (ushort)0x8D, "AMD Phenom™ X4 Quad-Core Processor Family" },
{ (ushort)0x8E, "AMD Phenom™ X2 Dual-Core Processor Family" },
{ (ushort)0x8F, "AMD Athlon™ X2 Dual-Core Processor Family" },
{ (ushort)0x90, "PA-RISC Family" },
{ (ushort)0x91, "PA-RISC 8500" },
{ (ushort)0x92, "PA-RISC 8000" },
{ (ushort)0x93, "PA-RISC 7300LC" },
{ (ushort)0x94, "PA-RISC 7200" },
{ (ushort)0x95, "PA-RISC 7100LC" },
{ (ushort)0x96, "PA-RISC 7100" },
//// 0x97 - Disponible.
//// 0x98 - Disponible.
//// 0x99 - Disponible.
//// 0x9A - Disponible.
//// 0x9B - Disponible.
//// 0x9C - Disponible.
//// 0x9D - Disponible.
//// 0x9E - Disponible.
//// 0x9F - Disponible.
{ (ushort)0xA0, "V30 Family" },
{ (ushort)0xA1, "Quad-Core Intel® Xeon® processor 3200 Series" },
{ (ushort)0xA2, "Dual-Core Intel® Xeon® processor 3000 Series" },
{ (ushort)0xA3, "Quad-Core Intel® Xeon® processor 5300 Series" },
{ (ushort)0xA4, "Dual-Core Intel® Xeon® processor 5100 Series" },
{ (ushort)0xA5, "Dual-Core Intel® Xeon® processor 5000 Series" },
{ (ushort)0xA6, "Dual-Core Intel® Xeon® processor LV" },
{ (ushort)0xA7, "Dual-Core Intel® Xeon® processor ULV" },
{ (ushort)0xA8, "Dual-Core Intel® Xeon® processor 7100 Series" },
{ (ushort)0xA9, "Quad-Core Intel® Xeon® processor 5400 Series" },
{ (ushort)0xAA, "Quad-Core Intel® Xeon® processor" },
{ (ushort)0xAB, "Dual-Core Intel® Xeon® processor 5200 Series" },
{ (ushort)0xAC, "Dual-Core Intel® Xeon® processor 7200 Series" },
{ (ushort)0xAD, "Quad-Core Intel® Xeon® processor 7300 Series" },
{ (ushort)0xAE, "Quad-Core Intel® Xeon® processor 7400 Series" },
{ (ushort)0xAF, "Multi-Core Intel® Xeon® processor 7400 Series" },
{ (ushort)0xB0, "Pentium® III Xeon™ processor" },
{ (ushort)0xB1, "Pentium® III Processor with Intel® SpeedStep™ Technology" },
{ (ushort)0xB2, "Pentium® 4 Processor" },
{ (ushort)0xB3, "Intel® Xeon® processor" },
{ (ushort)0xB4, "AS400 Family" },
{ (ushort)0xB5, "Intel® Xeon™ processor MP" },
{ (ushort)0xB6, "AMD Athlon™ XP Processor Family" },
{ (ushort)0xB7, "AMD Athlon™ MP Processor Family" },
{ (ushort)0xB8, "Intel® Itanium® 2 processor" },
{ (ushort)0xB9, "Intel® Pentium® M processor" },
{ (ushort)0xBA, "Intel® Celeron® D processor" },
{ (ushort)0xBB, "Intel® Pentium® D processor" },
{ (ushort)0xBC, "Intel® Pentium® Processor Extreme Edition" },
{ (ushort)0xBD, "Intel® Core™ Solo Processor" },
//// 0xBE - Reserved. See 'if' instruction below.
{ (ushort)0xBF, "Intel® Core™ 2 Duo Processor" },
{ (ushort)0xC0, "Intel® Core™ 2 Solo processor" },
{ (ushort)0xC1, "Intel® Core™ 2 Extreme processor" },
{ (ushort)0xC2, "Intel® Core™ 2 Quad processor" },
{ (ushort)0xC3, "Intel® Core™ 2 Extreme mobile processor" },
{ (ushort)0xC4, "Intel® Core™ 2 Duo mobile processor" },
{ (ushort)0xC5, "Intel® Core™ 2 Solo mobile processor" },
{ (ushort)0xC6, "Intel® Core™ i7 processor" },
{ (ushort)0xC7, "Dual-Core Intel® Celeron® processor" },
{ (ushort)0xC8, "IBM390 Family" },
{ (ushort)0xC9, "G4" },
{ (ushort)0xCA, "G5" },
{ (ushort)0xCB, "ESA/390 G6" },
{ (ushort)0xCC, "z/Architecture base" },
{ (ushort)0xCD, "Intel® Core™ i5 processor" },
{ (ushort)0xCE, "Intel® Core™ i3 processor" },
{ (ushort)0xCF, "Intel® Core™ i9 processor" },
//// 0xD0 - Disponible.
//// 0xD1 - Disponible.
{ (ushort)0xD2, "VIA C7™-M Processor Family" },
{ (ushort)0xD3, "VIA C7™-D Processor Family" },
{ (ushort)0xD4, "VIA C7™ Processor Family" },
{ (ushort)0xD5, "VIA Eden™ Processor Family" },
{ (ushort)0xD6, "Multi-Core Intel® Xeon® processor" },
{ (ushort)0xD7, "Dual-Core Intel® Xeon® processor 3xxx Series" },
{ (ushort)0xD8, "Quad-Core Intel® Xeon® processor 3xxx Series" },
{ (ushort)0xD9, "VIA Nano™ Processor Family" },
{ (ushort)0xDA, "Dual-Core Intel® Xeon® processor 5xxx Series" },
{ (ushort)0xDB, "Quad-Core Intel® Xeon® processor 5xxx Series" },
//// 0xDC - Disponible.
{ (ushort)0xDD, "Dual-Core Intel® Xeon® processor 7xxx Series" },
{ (ushort)0xDE, "Quad-Core Intel® Xeon® processor 7xxx Series" },
{ (ushort)0xDF, "Multi-Core Intel® Xeon® processor 7xxx Series" },
{ (ushort)0xE0, "Multi-Core Intel® Xeon® processor 3400 Series" },
//// 0xE1 - Disponible.
//// 0xE2 - Disponible.
//// 0xE3 - Disponible.
{ (ushort)0xE4, "AMD Opteron™ 3000 Series Processor" },
{ (ushort)0xE5, "AMD Sempron™ II Processor" },
{ (ushort)0xE6, "Embedded AMD Opteron™ Quad-Core Processor Family" },
{ (ushort)0xE7, "AMD Phenom™ Triple-Core Processor Family" },
{ (ushort)0xE8, "AMD Turion™ Ultra Dual-Core Mobile Processor Family" },
{ (ushort)0xE9, "AMD Turion™ Dual-Core Mobile Processor Family" },
{ (ushort)0xEA, "AMD Athlon™ Dual-Core Processor Family" },
{ (ushort)0xEB, "AMD Sempron™ SI Processor Family" },
{ (ushort)0xEC, "AMD Phenom™ II Processor Family" },
{ (ushort)0xED, "AMD Athlon™ II Processor Family" },
{ (ushort)0xEE, "Six-Core AMD Opteron™ Processor Family" },
{ (ushort)0xEF, "AMD Sempron™ M Processor Family" },
//// 0xF0 - Disponible.
//// 0xF1 - Disponible.
//// 0xF2 - Disponible.
//// 0xF3 - Disponible.
//// 0xF4 - Disponible.
//// 0xF5 - Disponible.
//// 0xF6 - Disponible.
//// 0xF7 - Disponible.
//// 0xF8 - Disponible.
//// 0xF9 - Disponible.
{ (ushort)0xFA, "i860" },
{ (ushort)0xFB, "i960" },
//// 0xFC - Disponible.
//// 0xFD - Disponible.
//// 0xFE - Indicador para obtener la familia de procesadores del campo 2 de familia de procesador..
//// 0xFF - Reservado.
//// 0x100 - 0x1FF - These values are available for assignment, except for the following:
{ (ushort)0x100, "ARMv7" },
{ (ushort)0x101, "ARMv8" },
{ (ushort)0x102, "ARMv9" },
//// 0x103 - Disponible.
{ (ushort)0x104, "SH-3" },
{ (ushort)0x105, "SH-4" },
{ (ushort)0x118, "ARM" },
{ (ushort)0x119, "StrongARM" },
{ (ushort)0x12C, "6x86" },
{ (ushort)0x12D, "MediaGX" },
{ (ushort)0x12E, "MII" },
{ (ushort)0x140, "WinChip" },
{ (ushort)0x15E, "DSP" },
{ (ushort)0x1F4, "Video Processor" },
{ (ushort)0x200, "RISC-V RV32" },
{ (ushort)0x201, "RISC-V RV64" },
{ (ushort)0x202, "RISC-V RV128" },
//// 0x0203 - 0x0257 - Available for assignment
{ (ushort)0x258, "LoongArch" },
{ (ushort)0x259, "Loongson™ 1 Processor Family" },
{ (ushort)0x25a, "Loongson™ 2 Processor Family" },
{ (ushort)0x25b, "Loongson™ 3 Processor Family" },
{ (ushort)0x25c, "Loongson™ 2K Processor Family" },
{ (ushort)0x25d, "Loongson™ 3A Processor Family" },
{ (ushort)0x25e, "Loongson™ 3B Processor Family" },
{ (ushort)0x25f, "Loongson™ 3C Processor Family" },
{ (ushort)0x260, "Loongson™ 3D Processor Family" },
{ (ushort)0x261, "Loongson™ 3E Processor Family" },
{ (ushort)0x262, "Dual-Core Loongson™ 2K Processor 2xxx Series" },
//// 0x0263 - 0x026b - Available for assignment
{ (ushort)0x26c, "Quad-Core Loongson™ 3A Processor 5xxx Series" },
{ (ushort)0x26d, "Multi-Core Loongson™ 3A Processor 5xxx Series" },
{ (ushort)0x26e, "Quad-Core Loongson™ 3B Processor 5xxx Series" },
{ (ushort)0x26f, "Multi-Core Loongson™ 3B Processor 5xxx Series" },
{ (ushort)0x270, "Multi-Core Loongson™ 3C Processor 5xxx Series" },
{ (ushort)0x271, "Multi-Core Loongson™ 3D Processor 5xxx Series" },
//// 0x0300 - 0xfffd - Available for assignment
//// 0xfffe - 0xffff - Reserved
};
byte family = table[0x06];
ushort code = family;
string manufacturer = strings.ElementAt(table[0x07]);
if (table[0x01] >= 0x29)
{
ushort family2 = (ushort) table.ToArray().GetWord(0x28);
if (family != 0xfd)
{
code = family2;
}
}
if (code == 0xbe)
{
return manufacturer == "Intel" ? "Core 2" : "K7";
}
return (string)items[code];
}
/// <summary>
/// Gets a string that indicates the current state of the processor
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// Current processor status.
/// </returns>
private static string GetProcessorStatus(byte code)
{
string[] value =
{
"Unknown", // 0x00
"Enabled",
"Disabled By User",
"Disabled By BIOS",
"Idle", // 0x04
SmbiosHelper.OutOfSpec,
SmbiosHelper.OutOfSpec,
"Other" // 0x07
};
return value[code];
}
/// <summary>
/// Gets a string that identifies the type of processor.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// Processor type.
/// </returns>
private static string GetProcessorType(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"Central Processor",
"Math Processor",
"DSP Processor",
"Video Processor" // 0x06
};
if (code >= 0x01 && code <= 0x06)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string representing the socket type of the processor.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// Processor socket type.
/// </returns>
private static string GetProcessorUpgrade(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"Daughter Board",
"ZIF Socket",
"Replaceable Piggy Back",
"None",
"LIF Socket",
"Slot 1",
"Slot 2",
"370-pin Socket",
"Slot A",
"Slot M",
"Socket 423",
"Socket A (Socket 462)",
"Socket 478",
"Socket 754",
"Socket 940",
"Socket 939",
"Socket mPGA604",
"Socket LGA771",
"Socket LGA775",
"Socket S1",
"Socket AM2",
"Socket F (1207)",
"Socket 1366",
"Socket G34",
"Socket AM3",
"Socket C32",
"Socket LGA1156",
"Socket LGA1567",
"Socket PGA988A2",
"Socket BGA1288",
"Socket rPGA988B",
"Socket BGA1023",
"Socket BGA1224",
"Socket BGA1155",
"Socket LGA1356",
"Socket LGA2011",
"Socket FS1",
"Socket FS2",
"Socket FM1",
"Socket FM2",
"Socket LGA2011-3",
"Socket LGA1356-3",
"Socket LGA1150",
"Socket BGA1168",
"Socket BGA1234",
"Socket BGA1364",
"Socket AM4",
"Socket LGA1151",
"Socket BGA1356",
"Socket BGA1440",
"Socket BGA1515",
"Socket LGA3647-1",
"Socket SP3",
"Socket SP3r2",
"Socket LGA2066",
"Socket BGA1392",
"Socket BGA1510",
"Socket BGA1528",
"Socket LGA4189",
"Socket LGA1200",
"Socket LGA4677",
"Socket LGA1700",
"Socket LGA1744",
"Socket LGA1781",
"Socket BGA1211",
"Socket BGA2422",
"Socket LGA1211",
"Socket LGA2422",
"Socket LGA5773",
"Socket BGA5773",
"Socket AM5",
"Socket SP5",
"Socket SP6",
"Socket BGA883",
"Socket BGA1190",
"Socket BGA4129",
"Socket BGA7410",
"Socket BGA7529" // 0x50
};
if (code >= 0x01 && code <= 0x50)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a collection of voltages supported by the processor.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// Collection of voltages supported.
/// </returns>
private static ReadOnlyCollection<string> GetVoltagesCapability(byte code)
{
string[] value =
{
"5.0", // 0
"3.3",
"2.9" // 2
};
List<string> items = new List<string>();
for (byte i = 0; i <= 2; i++)
{
bool addVoltage = code.CheckBit(i);
if (addVoltage)
{
items.Add(value[i]);
}
}
return items.AsReadOnly();
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemReset/Timeout.md
# DmiProperty.SystemReset.Timeout property
Gets a value representing the key to retrieve the property value.
Number of minutes before the reboot is initiated. It is used after a system power cycle, system reset (local or remote), and automatic system reset
Key Composition
* Structure: SystemReset
* Property: Timeout
* Unit: None
Return Value
Type: UInt16
```csharp
public static IPropertyKey Timeout { get; }
```
## See Also
* class [SystemReset](../DmiProperty.SystemReset.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiSupportedEventLogTypeDescriptorElement/DescriptorFormat.md
# DmiSupportedEventLogTypeDescriptorElement.DescriptorFormat property
Gets a value that represents the Descriptor Format.
```csharp
public string DescriptorFormat { get; }
```
## Property Value
Descriptor Format.
## See Also
* class [DmiSupportedEventLogTypeDescriptorElement](../DmiSupportedEventLogTypeDescriptorElement.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/Specific/DmiSupportedEventLogTypeDescriptorsCollection.cs
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Represents a collection of objects <see cref="DmiSupportedEventLogTypeDescriptorElement"/>.
/// </summary>
public sealed class DmiSupportedEventLogTypeDescriptorsCollection : ReadOnlyCollection<DmiSupportedEventLogTypeDescriptorElement>
{
#region constructor/s
/// <summary>
/// Initialize a new instance of the class <see cref="DmiSupportedEventLogTypeDescriptorsCollection"/>.
/// </summary>
/// <param name="elements">Item list.</param>
internal DmiSupportedEventLogTypeDescriptorsCollection(IEnumerable<DmiSupportedEventLogTypeDescriptorElement> elements) : base(elements.ToList())
{
}
#endregion
#region public override methods
/// <summary>
/// Returns a class <see cref="string"/> that represents the current object.
/// </summary>
/// <returns>
/// Object <see cref="string"/> that represents the current class.
/// </returns>
/// <remarks>
/// This method returns a string that includes the number of available elements.
/// </remarks>
public override string ToString() => $"Elements = {Items.Count}";
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/SmbiosHelper.cs
using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
namespace iTin.Hardware.Specification.Smbios;
/// <summary>
/// Helper class for <see cref="SMBIOS"/>.
/// </summary>
internal static class SmbiosHelper
{
public const string Unknown = "Unknown";
public const string Reserved = "Reserved";
public const string OutOfSpec = "<OUT OF SPEC>";
/// <summary>
/// Returns all stored strings in raw table.
/// </summary>
/// <param name="rawDataArray">Raw table</param>
/// <returns>
/// Strings stored in raw data.
/// </returns>
public static string[] ParseStrings(byte[] rawDataArray)
{
var exit = false;
int index = rawDataArray[1];
var items = new Collection<string> { string.Empty };
while (!exit)
{
int end = Array.IndexOf(rawDataArray, (byte)0x00, index);
int count = end - index;
items.Add(Encoding.ASCII.GetString(rawDataArray, index, count));
if (rawDataArray[end + 1] == 0x00)
{
exit = true;
}
else
{
index = end + 1;
}
}
return items.ToArray();
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/SmbiosProperty.cs
using System;
using System.Collections.ObjectModel;
using System.Diagnostics.CodeAnalysis;
using iTin.Core.Hardware.Common;
namespace iTin.Hardware.Specification.Smbios.Property;
/// <summary>
/// Defines available keys for the available devices of a system.
/// </summary>
public static partial class SmbiosProperty
{
#region [public] {static} (class) Bios: Contains the key definitions available for a type 000 [Bios Information] structure
/// <summary>
/// Contains the key definitions available for a type 000 [<see cref="SmbiosStructure.Bios"/> Information] structure.
/// </summary>
public static class Bios
{
#region Version 2.0+
#region [public] {static} (IPropertyKey) Vendor: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of the BIOS Vendor’s Name.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Bios"/></description></item>
/// <item><description>Property: <see cref="SmbiosType000Property.Vendor"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Vendor => new PropertyKey(SmbiosStructure.Bios, SmbiosType000Property.Vendor);
#endregion
#region [public] {static} (IPropertyKey) BiosVersion: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of the BIOS Version.</para>
/// <para>This value is a free-form string that may contain core and <b>OEM</b> version information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Bios"/></description></item>
/// <item><description>Property: <see cref="SmbiosType000Property.BiosVersion"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey BiosVersion => new PropertyKey(SmbiosStructure.Bios, SmbiosType000Property.BiosVersion);
#endregion
#region [public] {static} (IPropertyKey) BiosStartSegment: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Segment location of BIOS starting address. This value is a free-form string that may contain core and <b>OEM</b> version information.
/// The size of the runtime BIOS image can be computed by subtracting the Starting Address Segment from 10000h and multiplying the result by 16.
/// When not applicable, such as on UEFI-based systems, this value is set to 0000h.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Bios"/></description></item>
/// <item><description>Property: <see cref="SmbiosType000Property.BiosStartSegment"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey BiosStartSegment => new PropertyKey(SmbiosStructure.Bios, SmbiosType000Property.BiosStartSegment);
#endregion
#region [public] {static} (IPropertyKey) BiosReleaseDate: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// String number of the BIOS release date. The date string, if supplied, is in either mm/dd/yy or mm/dd/yyyy format. If the year portion of the string is two digits, the year is assumed to be 19yy.
/// The mm/dd/yyyy format is required for SMBIOS version 2.3 and later.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Bios"/></description></item>
/// <item><description>Property: <see cref="SmbiosType000Property.BiosReleaseDate"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey BiosReleaseDate => new PropertyKey(SmbiosStructure.Bios, SmbiosType000Property.BiosReleaseDate);
#endregion
#region [public] {static} (IPropertyKey) BiosRomSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Size of the physical device containing the BIOS.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Bios"/></description></item>
/// <item><description>Property: <see cref="SmbiosType000Property.BiosRomSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey BiosRomSize => new PropertyKey(SmbiosStructure.Bios, SmbiosType000Property.BiosRomSize, PropertyUnit.KB);
#endregion
#region [public] {static} (IPropertyKey) Characteristics: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Defines which functions the BIOS supports: <b>PCI</b>, <b>PCMCIA</b>, <b>Flash</b>, etc.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Bios"/></description></item>
/// <item><description>Property: <see cref="SmbiosType000Property.Characteristics"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Characteristics => new PropertyKey(SmbiosStructure.Bios, SmbiosType000Property.Characteristics);
#endregion
#endregion
#region Version 2.4+
#region [public] {static} (IPropertyKey) CharacteristicsExtensionByte1: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Defines which functions the BIOS supports.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Bios"/></description></item>
/// <item><description>Property: <see cref="SmbiosType000Property.CharacteristicsExtensionByte1"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey CharacteristicsExtensionByte1 => new PropertyKey(SmbiosStructure.Bios, SmbiosType000Property.CharacteristicsExtensionByte1);
#endregion
#region [public] {static} (IPropertyKey) CharacteristicsExtensionByte2: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Defines which functions the BIOS supports.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Bios"/></description></item>
/// <item><description>Property: <see cref="SmbiosType000Property.CharacteristicsExtensionByte2"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey CharacteristicsExtensionByte2 => new PropertyKey(SmbiosStructure.Bios, SmbiosType000Property.CharacteristicsExtensionByte2);
#endregion
#region [public] {static} (IPropertyKey) SystemBiosMajorRelease: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the major release of the System BIOS.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Bios"/></description></item>
/// <item><description>Property: <see cref="SmbiosType000Property.SystemBiosMajorRelease"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="Nullable{T}"/> where <b>T</b> is <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.4+</para>
/// </para>
/// </summary>
public static IPropertyKey SystemBiosMajorRelease => new PropertyKey(SmbiosStructure.Bios, SmbiosType000Property.SystemBiosMajorRelease);
#endregion
#region [public] {static} (IPropertyKey) SystemBiosMinorRelease: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the minor release of the System BIOS.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Bios"/></description></item>
/// <item><description>Property: <see cref="SmbiosType000Property.SystemBiosMinorRelease"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="Nullable{T}"/> where <b>T</b> is <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.4+</para>
/// </para>
/// </summary>
public static IPropertyKey SystemBiosMinorRelease => new PropertyKey(SmbiosStructure.Bios, SmbiosType000Property.SystemBiosMinorRelease);
#endregion
#region [public] {static} (IPropertyKey) FirmwareMajorRelease: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the major release of the embedded controller firmware.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Bios"/></description></item>
/// <item><description>Property: <see cref="SmbiosType000Property.FirmwareMajorRelease"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="Nullable{T}"/> where <b>T</b> is <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.4+</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareMajorRelease => new PropertyKey(SmbiosStructure.Bios, SmbiosType000Property.FirmwareMajorRelease);
#endregion
#region [public] {static} (IPropertyKey) FirmwareMinorRelease: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the minor release of the embedded controller firmware.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Bios"/></description></item>
/// <item><description>Property: <see cref="SmbiosType000Property.FirmwareMinorRelease"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="Nullable{T}"/> where <b>T</b> is <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.4+</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareMinorRelease => new PropertyKey(SmbiosStructure.Bios, SmbiosType000Property.FirmwareMinorRelease);
#endregion
#endregion
#region version 3.1+
#region [public] {static} (IPropertyKey) ExtendedBiosRomSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Extended size of the physical device(s) containing the BIOS. For check measured unit, please see <see cref="BiosRomSizeUnit"/>.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Bios"/></description></item>
/// <item><description>Property: <see cref="SmbiosType000Property.BiosRomSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+, 3.1+</para>
/// </para>
/// </summary>
public static IPropertyKey ExtendedBiosRomSize => new PropertyKey(SmbiosStructure.Bios, SmbiosType000Property.ExtendedBiosRomSize, PropertyUnit.None);
#endregion
#region [public] {static} (IPropertyKey) BiosRomSizeUnit: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Size of the physical device(s) containing the BIOS.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Bios"/></description></item>
/// <item><description>Property: <see cref="SmbiosType000Property.BiosRomSizeUnit"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="MemorySizeUnit"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.1+</para>
/// </para>
/// </summary>
public static IPropertyKey BiosRomSizeUnit => new PropertyKey(SmbiosStructure.Bios, SmbiosType000Property.BiosRomSizeUnit);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) System: Contains the key definitions available for a type 001 [System Information] structure
/// <summary>
/// Contains the key definitions available for a type 001 [<see cref="SmbiosStructure.System"/> Information] structure.
/// </summary>
public static class System
{
#region version 2.0+
#region [public] {static} (IPropertyKey) Manufacturer: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Manufacturer name</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.System"/></description></item>
/// <item><description>Property: <see cref="SmbiosType001Property.Manufacturer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Manufacturer => new PropertyKey(SmbiosStructure.System, SmbiosType001Property.Manufacturer);
#endregion
#region [public] {static} (IPropertyKey) ProductName: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Product name</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.System"/></description></item>
/// <item><description>Property: <see cref="SmbiosType001Property.ProductName"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ProductName => new PropertyKey(SmbiosStructure.System, SmbiosType001Property.ProductName);
#endregion
#region [public] {static} (IPropertyKey) Version: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Product Version.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.System"/></description></item>
/// <item><description>Property: <see cref="SmbiosType001Property.Version"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Version => new PropertyKey(SmbiosStructure.System, SmbiosType001Property.Version);
#endregion
#region [public] {static} (IPropertyKey) SerialNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Serial Number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.System"/></description></item>
/// <item><description>Property: <see cref="SmbiosType001Property.SerialNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SerialNumber => new PropertyKey(SmbiosStructure.System, SmbiosType001Property.SerialNumber);
#endregion
#endregion
#region version 2.1+
#region [public] {static} (IPropertyKey) UUID: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Universal unique ID number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.System"/></description></item>
/// <item><description>Property: <see cref="SmbiosType001Property.UUID"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey UUID => new PropertyKey(SmbiosStructure.System, SmbiosType001Property.UUID);
#endregion
#region [public] {static} (IPropertyKey) WakeUpType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the event that caused the system to power up.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.System"/></description></item>
/// <item><description>Property: <see cref="SmbiosType001Property.WakeUpType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey WakeUpType => new PropertyKey(SmbiosStructure.System, SmbiosType001Property.WakeUpType);
#endregion
#endregion
#region version 2.4+
#region [public] {static} (IPropertyKey) SkuNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// This text string identifies a particular computer configuration for sale.
/// It is sometimes also called a product ID or purchase order number.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.System"/></description></item>
/// <item><description>Property: <see cref="SmbiosType001Property.SkuNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.4+</para>
/// </para>
/// </summary>
public static IPropertyKey SkuNumber => new PropertyKey(SmbiosStructure.System, SmbiosType001Property.SkuNumber);
#endregion
#region [public] {static} (IPropertyKey) Family: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>This text string identifies the family to which a particular computer belongs.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.System"/></description></item>
/// <item><description>Property: <see cref="SmbiosType001Property.Family"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.4+</para>
/// </para>
/// </summary>
public static IPropertyKey Family => new PropertyKey(SmbiosStructure.System, SmbiosType001Property.Family);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) BaseBoard: Contains the key definitions available for a type 002 [Baseboard (or Module) Information] structure
/// <summary>
/// Contains the key definitions available for a type 002 [<see cref="SmbiosStructure.BaseBoard"/> (or Module) Information] structure.
/// </summary>
public static class BaseBoard
{
#region [public] {static} (IPropertyKey) Manufacturer: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Manufacturer name</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="SmbiosType002Property.Manufacturer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Manufacturer => new PropertyKey(SmbiosStructure.BaseBoard, SmbiosType002Property.Manufacturer);
#endregion
#region [public] {static} (IPropertyKey) Product: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Baseboard product.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="SmbiosType002Property.Product"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Product => new PropertyKey(SmbiosStructure.BaseBoard, SmbiosType002Property.Product);
#endregion
#region [public] {static} (IPropertyKey) Version: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Mainboard Version</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="SmbiosType002Property.Version"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Version => new PropertyKey(SmbiosStructure.BaseBoard, SmbiosType002Property.Version);
#endregion
#region [public] {static} (IPropertyKey) SerialNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Mainboard Serial Number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="SmbiosType002Property.SerialNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey SerialNumber => new PropertyKey(SmbiosStructure.BaseBoard, SmbiosType002Property.SerialNumber);
#endregion
#region [public] {static} (IPropertyKey) AssetTag: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Mainboard asset tag number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="SmbiosType002Property.AssetTag"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey AssetTag => new PropertyKey(SmbiosStructure.BaseBoard, SmbiosType002Property.AssetTag);
#endregion
#region [public] {static} (IPropertyKey) LocationInChassis: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String that describes this board's location.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="SmbiosType002Property.LocationInChassis"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey LocationInChassis => new PropertyKey(SmbiosStructure.BaseBoard, SmbiosType002Property.LocationInChassis);
#endregion
#region [public] {static} (IPropertyKey) ChassisHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with the chassis in which this board resides.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="SmbiosType002Property.ChassisHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey ChassisHandle => new PropertyKey(SmbiosStructure.BaseBoard, SmbiosType002Property.ChassisHandle);
#endregion
#region [public] {static} (IPropertyKey) BoardType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Mainboard Type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="SmbiosType002Property.BoardType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey BoardType => new PropertyKey(SmbiosStructure.BaseBoard, SmbiosType002Property.BoardType);
#endregion
#region [public] {static} (IPropertyKey) NumberOfContainedObjectHandles: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number (0 to 255) of contained Object Handles that follow.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="SmbiosType002Property.NumberOfContainedObjectHandles"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey NumberOfContainedObjectHandles => new PropertyKey(SmbiosStructure.BaseBoard, SmbiosType002Property.NumberOfContainedObjectHandles);
#endregion
#region [public] {static} (IPropertyKey) ContainedElements: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>List of handles of other structures (for examples, Baseboard, Processor, Port, System Slots, Memory Device) that are contained by this baseboard.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="SmbiosType002Property.ContainedObjectHandles"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="BaseBoardContainedElementCollection"/></para>
/// </para>
/// </summary>
public static IPropertyKey ContainedElements => new PropertyKey(SmbiosStructure.BaseBoard, SmbiosType002Property.ContainedObjectHandles);
#endregion
#region nested classes
#region [public] {static} (class) Features: Contains the key definition for the 'Features' section
/// <summary>
/// Contains the key definition for the <b>Features</b> section.
/// </summary>
public static class Features
{
#region [public] {static} (IPropertyKey) IsHostingBoard: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if is hosting board.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="SmbiosType002Property.IsHostingBoard"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey IsHostingBoard => new PropertyKey(SmbiosStructure.BaseBoard, SmbiosType002Property.IsHostingBoard);
#endregion
#region [public] {static} (IPropertyKey) IsHotSwappable: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if mainboard is hot swappable.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="SmbiosType002Property.HotSwappable"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey IsHotSwappable => new PropertyKey(SmbiosStructure.BaseBoard, SmbiosType002Property.HotSwappable);
#endregion
#region [public] {static} (IPropertyKey) IsRemovable: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if mainboard is removable.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="SmbiosType002Property.IsRemovable"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey IsRemovable => new PropertyKey(SmbiosStructure.BaseBoard, SmbiosType002Property.IsRemovable);
#endregion
#region [public] {static} (IPropertyKey) IsReplaceable: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if mainboard is replaceable.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="SmbiosType002Property.IsReplaceable"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey IsReplaceable => new PropertyKey(SmbiosStructure.BaseBoard, SmbiosType002Property.IsReplaceable);
#endregion
#region [public] {static} (IPropertyKey) RequiredDaughterBoard: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if mainboard required a daughter board.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="SmbiosType002Property.RequiredDaughterBoard"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey RequiredDaughterBoard => new PropertyKey(SmbiosStructure.BaseBoard, SmbiosType002Property.RequiredDaughterBoard);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) Chassis: Contains the key definitions available for a type 003 [System Enclosure or Chassis] structure
/// <summary>
/// Contains the key definitions available for a type 003 [<see cref="SmbiosStructure.SystemEnclosure"/> Information] structure.
/// </summary>
public static class Chassis
{
#region version 2.0+
#region [public] {static} (IPropertyKey) Manufacturer: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Manufacturer name</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.Manufacturer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Manufacturer => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.Manufacturer);
#endregion
#region [public] {static} (IPropertyKey) Locked: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if chassis lock is present.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.Locked"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Locked => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.Locked);
#endregion
#region [public] {static} (IPropertyKey) ChassisType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Chassis Type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.ChassisType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ChassisType => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.ChassisType);
#endregion
#region [public] {static} (IPropertyKey) Version: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Chassis Version.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.Version"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Version => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.Version);
#endregion
#region [public] {static} (IPropertyKey) SerialNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Chassis Serial Number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.SerialNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SerialNumber => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.SerialNumber);
#endregion
#region [public] {static} (IPropertyKey) AssetTagNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Asset Tag Number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.AssetTagNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey AssetTagNumber => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.AssetTagNumber);
#endregion
#endregion
#region version 2.1+
#region [public] {static} (IPropertyKey) BootUpState: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>State of the enclosure when it was last booted.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.BootUpState"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey BootUpState => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.BootUpState);
#endregion
#region [public] {static} (IPropertyKey) PowerSupplyState: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>State of the enclosure’s power supply (or supplies) when last booted.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.PowerSupplyState"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey PowerSupplyState => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.PowerSupplyState);
#endregion
#region [public] {static} (IPropertyKey) ThermalState: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Thermal state of the enclosure when last booted.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.ThermalState"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey ThermalState => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.ThermalState);
#endregion
#region [public] {static} (IPropertyKey) SecurityStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Physical security status of the enclosure when last booted.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.SecurityStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey SecurityStatus => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.SecurityStatus);
#endregion
#endregion
#region version 2.3+
#region [public] {static} (IPropertyKey) OemDefined: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>OEM or BIOS vendor-specific information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.OemDefined"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey OemDefined => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.OemDefined);
#endregion
#region [public] {static} (IPropertyKey) Height: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Height of the enclosure, in 'U's A U is a standard unit of measure for the height of a rack or rack-mountable component and is equal to 1.75 inches or 4.445 cm.</para>
/// <para>A value of 00h indicates that the enclosure height is unspecified.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.Height"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.U"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey Height => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.Height, PropertyUnit.U);
#endregion
#region [public] {static} (IPropertyKey) NumberOfPowerCords: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of power cords associated with the enclosure or chassis.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.NumberOfPowerCords"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey NumberOfPowerCords => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.NumberOfPowerCords);
#endregion
#region [public] {static} (IPropertyKey) ContainedElements: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of contained Element records that follow, in the range 0 to 255.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.ContainedElements"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ChassisContainedElementCollection"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey ContainedElements => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.ContainedElements);
#endregion
#endregion
#region version 2.7+
#region [public] {static} (IPropertyKey) SkuNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String describing the chassis or enclosure SKU number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.SkuNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey SkuNumber => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.SkuNumber);
#endregion
#endregion
#region nested classes
#region [public] {static} (class) Elements: Contains the key definition for the 'Elements' section
/// <summary>
/// Contains the key definition for the <b>Elements</b> section.
/// </summary>
public static class Elements
{
#region [public] {static} (IPropertyKey) ItemType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Type of element associated.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.ContainedType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey ItemType => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.ContainedType);
#endregion
#region [public] {static} (IPropertyKey) Min: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Specifies the minimum number of the element type that can be installed in the chassis for the chassis to properly operate, in the range 0 to 254.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.ContainedElementMinimum"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey Min => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.ContainedElementMinimum);
#endregion
#region [public] {static} (IPropertyKey) Max: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Specifies the maximum number of the element type that can be installed in the chassis, in the range 1 to 255.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.ContainedElementMaximum"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey Max => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.ContainedElementMaximum);
#endregion
#region [public] {static} (IPropertyKey) TypeSelect: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Type of select element associated.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="SmbiosType003Property.ContainedTypeSelect"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ChassisContainedElementType"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey TypeSelect => new PropertyKey(SmbiosStructure.SystemEnclosure, SmbiosType003Property.ContainedTypeSelect);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) Processor: Contains the key definitions available for a type 004 [Processor Information] structure
/// <summary>
/// Contains the key definitions available for a type 004 [<see cref="SmbiosStructure.Processor"/> Information] structure.
/// </summary>
public static class Processor
{
#region version 2.0+
#region [public] {static} (IPropertyKey) SocketDesignation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Reference designation.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.SocketDesignation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SocketDesignation => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.SocketDesignation);
#endregion
#region [public] {static} (IPropertyKey) ProcessorType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String containing the type of processor.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.ProcessorType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ProcessorType => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.ProcessorType);
#endregion
#region [public] {static} (IPropertyKey) ProcessorFamily: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String containing the family of processor.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.ProcessorFamily"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Family => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.ProcessorFamily);
#endregion
#region [public] {static} (IPropertyKey) ProcessorManufacturer: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Processor manufacturer.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.ProcessorManufacturer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ProcessorManufacturer => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.ProcessorManufacturer);
#endregion
#region [public] {static} (IPropertyKey) ProcessorId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Raw processor identification data.</para>
/// <para>The Processor ID field contains processor-specific information that describes the processor’s features.</para>
/// <para>
/// <list type="bullet">
/// <item>
/// <term>x86</term>
/// <description>
/// <para>The field’s format depends on the processor’s support of the CPUID instruction. If the instruction is supported, the Processor ID field contains two DWORD-formatted values.</para>
/// <para>The first (offsets 08h-0Bh) is the EAX value returned by a CPUID instruction with input EAX set to 1; the second(offsets 0Ch-0Fh) is the EDX value returned by that instruction.</para>
/// </description>
/// </item>
/// <item>
/// <term>ARM32</term>
/// <description>
/// <para>The processor ID field contains two DWORD-formatted values. The first (offsets 08h-0Bh) is the contents of the Main ID Register(MIDR); the second(offsets 0Ch-0Fh) is zero.</para>
/// </description>
/// </item>
/// <item>
/// <term>ARM64</term>
/// <description>
/// <para>The processor ID field contains two DWORD-formatted values. The first (offsets 08h-0Bh) is the contents of the MIDR_EL1 register; the second (offsets 0Ch-0Fh) is zero.</para>
/// </description>
/// </item>
/// <item>
/// <term>RISC-V</term>
/// <description>
/// <para>The processor ID contains a QWORD Machine Vendor ID CSR (mvendroid) of RISC-V processor hart 0. More information of RISC-V class CPU feature is described in RISC-V processor additional information.</para>
/// </description>
/// </item>
/// </list>
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.ProcessorId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ProcessorId => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.ProcessorId);
#endregion
#region [public] {static} (IPropertyKey) ProcessorVersion: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String describing the processor.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.ProcessorVersion"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ProcessorVersion => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.ProcessorVersion);
#endregion
#region [public] {static} (IPropertyKey) ExternalClock: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>External Clock Frequency, in MHz.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.ExternalClock"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MHz"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ExternalClock => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.ExternalClock, PropertyUnit.MHz);
#endregion
#region [public] {static} (IPropertyKey) MaximumSpeed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Maximum processor speed (in MHz) supported by the system for this processor socket 0E9h is for a 233 MHz processor. If the value is unknown, the field is set to 0.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.MaximumSpeed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MHz"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey MaximunSpeed => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.MaximumSpeed, PropertyUnit.MHz);
#endregion
#region [public] {static} (IPropertyKey) CurrentSpeed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Current processor speed (in MHz).</para>
/// <para>This field identifies the processor's speed at system boot; the processor may support more than one speed.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.CurrentSpeed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MHz"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CurrentSpeed => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.CurrentSpeed, PropertyUnit.MHz);
#endregion
#region [public] {static} (IPropertyKey) ProcessorUpgrade: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Processor upgrade value.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.ProcessorUpgrade"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey UpgradeMethod => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.ProcessorUpgrade);
#endregion
#endregion
#region version 2.1+
#region [public] {static} (IPropertyKey) L1CacheHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle of a cache information structure that defines the attributes of the primary (Level 1) cache for this processor.</para>
/// <para>
/// <list type="bullet">
/// <item><description>For version 2.1 and version 2.2 implementations, the value is 0FFFFh if the processor has no L1 cache.</description></item>
/// <item><description>For version 2.3 and later implementations, the value is 0FFFFh if the Cache Information structure is not provided.</description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.L1CacheHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey L1CacheHandle => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.L1CacheHandle);
#endregion
#region [public] {static} (IPropertyKey) L2CacheHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle of a cache information structure that defines the attributes of the secondary (Level 2) cache for this processor.</para>
/// <para>
/// <list type="bullet">
/// <item><description>For version 2.1 and version 2.2 implementations, the value is 0FFFFh if the processor has no L2 cache.</description></item>
/// <item><description>For version 2.3 and later implementations, the value is 0FFFFh if the Cache Information structure is not provided.</description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.L2CacheHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey L2CacheHandle => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.L2CacheHandle);
#endregion
#region [public] {static} (IPropertyKey) L3CacheHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle of a cache information structure that defines the attributes of the tertiary (Level 3) cache for this processor.</para>
/// <para>
/// <list type="bullet">
/// <item><description>For version 2.1 and version 2.2 implementations, the value is 0FFFFh if the processor has no L3 cache.</description></item>
/// <item><description>For version 2.3 and later implementations, the value is 0FFFFh if the Cache Information structure is not provided.</description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.L3CacheHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey L3CacheHandle => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.L3CacheHandle);
#endregion
#endregion
#region version 2.3+
#region [public] {static} (IPropertyKey) SerialNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Serial number of this processor. This value is set by the manufacturer and normally not changeable.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.SerialNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey SerialNumber => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.SerialNumber);
#endregion
#region [public] {static} (IPropertyKey) AssetTag: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Asset tag of this processor.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.AssetTag"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey AssetTag => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.AssetTag);
#endregion
#region [public] {static} (IPropertyKey) PartNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Asset tag of this processor.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.PartNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey PartNumber => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.PartNumber);
#endregion
#endregion
#region version 2.5+
#region [public] {static} (IPropertyKey) CoreCount: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Number of cores per processor socket. If the value is unknown, the field is set to 0.
/// Core Count is the number of cores detected by the BIOS for this processor socket. It does not necessarily indicate the full capability of the processor.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.CoreCount"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey CoreCount => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.CoreCount);
#endregion
#region [public] {static} (IPropertyKey) CoreEnabled: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of enabled cores per processor socket. If the value is unknown, the field is set 0.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.CoreEnabled"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey CoreEnabled => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.CoreEnabled);
#endregion
#region [public] {static} (IPropertyKey) ThreadCount: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Number of threads per processor socket. If the value is unknown, the field is set to 0.
/// For thread counts of 256 or greater, this property returns FFh and the <b>ThreadCount2</b> property is set to the number of threads.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.ThreadCount"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey ThreadCount => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.ThreadCount);
#endregion
#endregion
#region version 3.0+
#region [public] {static} (IPropertyKey) CoreCount2: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Number of cores per processor socket. Supports core counts >255.
/// If this field is present, it holds the core count for the processor socket.
/// Core Count will also hold the core count, except for core counts that are 256 or greater.
/// In that case, core Count shall be set to FFh and core Count 2 will hold the count.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.CoreCount2"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CoreCount2 => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.CoreCount2);
#endregion
#region [public] {static} (IPropertyKey) CoreEnabled2: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Number of enabled cores per processor socket. Supports core enabled counts >255
/// If this field is present, it holds the core enabled count for the processor socket.
/// Core Enabled will also hold the core enabled count, except for core counts that are 256 or greater.
/// In that case, core enabled shall be set to FFh and core enabled 2 will hold the count.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.CoreEnabled2"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CoreEnabled2 => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.CoreEnabled2);
#endregion
#region [public] {static} (IPropertyKey) ThreadCount2: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Number of threads per processor socket. Supports thread counts >255
/// If this field is present, it holds the thread count for the processor socket.
/// Thread Count will also hold the thread count, except for thread counts that are 256 or greater.
/// In that case, thread count shall be set to FFh and thread count 2 will hold the count.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.ThreadCount2"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ThreadCount2 => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.ThreadCount2);
#endregion
#endregion
#region version 3.6+
#region [public] {static} (IPropertyKey) ThreadEnabled: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Number of enabled threads per processor.
/// <list type="bullet">
/// <item><description>If the value is unknown, the field is set to 0000h.</description></item>
/// <item><description>If the value is valid, the field contains the thread enabled counts 1 to 65534, respectively </description></item>
/// <item><description>If the value is reserved, the field is set to ffffh</description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.ThreadEnabled"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.6+</para>
/// </para>
/// </summary>
public static IPropertyKey ThreadEnabled => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.ThreadEnabled);
#endregion
#endregion
#region nested classes
#region [public] {static} (class) Features: Contains the key definition for the 'Characteristics' section
/// <summary>
/// Contains the key definition for the <b>Characteristics</b> section.
/// </summary>
public static class Characteristics
{
#region [public] {static} (IPropertyKey) Capable64Bits: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>64-bit Capable indicates the maximum data width capability of the processor.</para>
/// <para>For example, this bit is set for Intel Itanium, AMD Opteron, and Intel Xeon(with EM64T) processors; this bit is cleared for Intel Xeon processors that do not have EM64T.</para>
/// <para>Indicates the maximum capability of the processor and does not indicate the current enabled state.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.Capable64Bits"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey Capable64Bits => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.Capable64Bits);
#endregion
#region [public] {static} (IPropertyKey) Capable128Bits: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>128-bit Capable indicates the maximum data width capability of the processor.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.Capable128Bits"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey Capable128Bits => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.Capable128Bits);
#endregion
#region [public] {static} (IPropertyKey) Arm64SocIdSupported: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>indicates that the processor supports returning a SoC ID value using the
/// SMCCC_ARCH_SOC_ID architectural call, as defined in the Arm SMC Calling Convention Specification v1.2 at
/// https://developer.arm.com/architectures/system-architectures/software-standards/smccc.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.Arm64SocIdSupported"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.4+</para>
/// </para>
/// </summary>
public static IPropertyKey Arm64SocIdSupported => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.Arm64SocIdSupported);
#endregion
#region [public] {static} (IPropertyKey) EnhancedVirtualizationInstructions: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates that the processor is capable of executing enhanced virtualization instructions. Does not indicate the present state of this feature.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.EnhancedVirtualizationInstructions"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey EnhancedVirtualizationInstructions => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.EnhancedVirtualizationInstructions);
#endregion
#region [public] {static} (IPropertyKey) ExecuteProtectionSupport: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Indicates that the processor supports marking specific memory regions as non-executable.
/// For example, this is the NX (No eXecute) feature of AMD processors and the XD (eXecute Disable) feature of Intel processors.
/// Does not indicate the present state of this feature.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.ExecuteProtectionSupport"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey ExecuteProtectionSupport => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.ExecuteProtectionSupport);
#endregion
#region [public] {static} (IPropertyKey) MultiCore: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates the processor has more than one core. Does not indicate the number of cores (Core Count) enabled by hardware or the number of cores (Core Enabled) enabled by BIOS.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.MultiCore"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey MultiCore => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.MultiCore);
#endregion
#region [public] {static} (IPropertyKey) HardwareThreadPerCore: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates that the processor supports multiple hardware threads per core. Does not indicate the state or number of threads.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.HardwareThreadPerCore"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey HardwareThreadPerCore => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.HardwareThreadPerCore);
#endregion
#region [public] {static} (IPropertyKey) PowerPerformanceControlSupport: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates that the processor is capable of load-based power savings. Does not indicate the present state of this feature.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.PowerPerformanceControlSupport"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey PowerPerformanceControlSupport => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.PowerPerformanceControlSupport);
#endregion
}
#endregion
#region [public] {static} (class) Status: Contains the key definition for the 'Status' section
/// <summary>
/// Contains the key definition for the <b>Status</b> section.
/// </summary>
public static class Status
{
#region [public] {static} (IPropertyKey) PowerPerformanceControlSupport: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String containing the current status of processor.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.CpuStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CpuStatus => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.CpuStatus);
#endregion
#region [public] {static} (IPropertyKey) SocketPopulated: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if CPU is populated.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.SocketPopulated"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SocketPopulated => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.SocketPopulated);
#endregion
}
#endregion
#region [public] {static} (class) Voltage: Contains the key definition for the 'Voltage' section
/// <summary>
/// Contains the key definition for the <b>Voltage</b> section.
/// </summary>
public static class Voltage
{
#region [public] {static} (IPropertyKey) IsLegacyMode: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicating 'legacy' mode for processor voltage</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.IsLegacyMode"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey IsLegacyMode => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.IsLegacyMode);
#endregion
#region [public] {static} (IPropertyKey) VoltageCapability: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Represent the specific voltages that the processor socket can accept.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Processor"/></description></item>
/// <item><description>Property: <see cref="SmbiosType004Property.VoltageCapability"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.V"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SupportedVoltages => new PropertyKey(SmbiosStructure.Processor, SmbiosType004Property.VoltageCapability, PropertyUnit.V);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) MemoryController: Contains the key definitions available for a type 005, obsolete [Memory Controller Information] structure
/// <summary>
/// Contains the key definitions available for a type 005, obsolete [<see cref="SmbiosStructure.MemoryController"/> Information] structure.
/// </summary>
public static class MemoryController
{
#region version 2.0+
#region [public] {static} (IPropertyKey) ErrorDetectingMethod: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Error detecting method.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryController"/></description></item>
/// <item><description>Property: <see cref="SmbiosType005Property.ErrorDetectingMethod"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ErrorDetectingMethod => new PropertyKey(SmbiosStructure.MemoryController, SmbiosType005Property.ErrorDetectingMethod);
#endregion
#region [public] {static} (IPropertyKey) ErrorDetectingMethod: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Error detecting capabilities.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryController"/></description></item>
/// <item><description>Property: <see cref="SmbiosType005Property.ErrorCorrectingCapabilities"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ErrorCorrectingCapabilities => new PropertyKey(SmbiosStructure.MemoryController, SmbiosType005Property.ErrorCorrectingCapabilities);
#endregion
#region [public] {static} (IPropertyKey) SupportedInterleave: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Interleave supported.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryController"/></description></item>
/// <item><description>Property: <see cref="SmbiosType005Property.SupportedInterleave"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SupportedInterleave => new PropertyKey(SmbiosStructure.MemoryController, SmbiosType005Property.SupportedInterleave);
#endregion
#region [public] {static} (IPropertyKey) CurrentInterleave: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Current interleave.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryController"/></description></item>
/// <item><description>Property: <see cref="SmbiosType005Property.CurrentInterleave"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CurrentInterleave => new PropertyKey(SmbiosStructure.MemoryController, SmbiosType005Property.CurrentInterleave);
#endregion
#region [public] {static} (IPropertyKey) MaximumMemoryModuleSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Size of the largest memory module supported (per slot), specified as n, where 2**n is the maximum size in MB.
/// The maximum amount of memory supported by this controller is that value times the number of slots, as specified in <see cref="NumberMemorySlots"/> property.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryController"/></description></item>
/// <item><description>Property: <see cref="SmbiosType005Property.MaximumMemoryModuleSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="int"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey MaximumMemoryModuleSize => new PropertyKey(SmbiosStructure.MemoryController, SmbiosType005Property.MaximumMemoryModuleSize);
#endregion
#region [public] {static} (IPropertyKey) SupportedSpeeds: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>A string collection with supported speeds.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryController"/></description></item>
/// <item><description>Property: <see cref="SmbiosType005Property.SupportedSpeeds"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.ns"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SupportedSpeeds => new PropertyKey(SmbiosStructure.MemoryController, SmbiosType005Property.SupportedSpeeds, PropertyUnit.ns);
#endregion
#region [public] {static} (IPropertyKey) SupportedMemoryTypes: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>A string collection with supported memory types.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryController"/></description></item>
/// <item><description>Property: <see cref="SmbiosType005Property.SupportedMemoryTypes"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SupportedMemoryTypes => new PropertyKey(SmbiosStructure.MemoryController, SmbiosType005Property.SupportedMemoryTypes);
#endregion
#region [public] {static} (IPropertyKey) MemoryModuleVoltages: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>A string collection with memory module voltages.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryController"/></description></item>
/// <item><description>Property: <see cref="SmbiosType005Property.MemoryModuleVoltages"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryModuleVoltages => new PropertyKey(SmbiosStructure.MemoryController, SmbiosType005Property.MemoryModuleVoltages, PropertyUnit.V);
#endregion
#region [public] {static} (IPropertyKey) NumberMemorySlots: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of memory slots.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryController"/></description></item>
/// <item><description>Property: <see cref="SmbiosType005Property.NumberMemorySlots"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey NumberMemorySlots => new PropertyKey(SmbiosStructure.MemoryController, SmbiosType005Property.NumberMemorySlots);
#endregion
#region [public] {static} (IPropertyKey) ContainedMemoryModules: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contained memory modules reference.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryController"/></description></item>
/// <item><description>Property: <see cref="SmbiosType005Property.ContainedMemoryModules"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="MemoryControllerContainedElementCollection"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ContainedMemoryModules => new PropertyKey(SmbiosStructure.MemoryController, SmbiosType005Property.ContainedMemoryModules, PropertyUnit.None);
#endregion
#endregion
#region version 2.1+
#region [public] {static} (IPropertyKey) EnabledErrorCorrectingCapabilities: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the error-correcting capabilities that were enabled.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryController"/></description></item>
/// <item><description>Property: <see cref="SmbiosType005Property.EnabledErrorCorrectingCapabilities"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey EnabledErrorCorrectingCapabilities => new PropertyKey(SmbiosStructure.MemoryController, SmbiosType005Property.EnabledErrorCorrectingCapabilities);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) MemoryModule: Contains the key definitions available for a type 006, obsolete [Memory Module Information] structure
/// <summary>
/// Contains the key definitions available for a type 006, obsolete [<see cref="SmbiosStructure.MemoryModule"/> Information] structure.
/// </summary>
public static class MemoryModule
{
#region [public] {static} (IPropertyKey) SocketDesignation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number for reference designation.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryModule"/></description></item>
/// <item><description>Property: <see cref="SmbiosType006Property.SocketDesignation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey SocketDesignation => new PropertyKey(SmbiosStructure.MemoryModule, SmbiosType006Property.SocketDesignation);
#endregion
#region [public] {static} (IPropertyKey) BankConnections: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates a bank (RAS#) connection.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryModule"/></description></item>
/// <item><description>Property: <see cref="SmbiosType006Property.BankConnections"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey BankConnections => new PropertyKey(SmbiosStructure.MemoryModule, SmbiosType006Property.BankConnections);
#endregion
#region [public] {static} (IPropertyKey) CurrentSpeed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Speed of the memory module, in ns.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryModule"/></description></item>
/// <item><description>Property: <see cref="SmbiosType006Property.CurrentSpeed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.ns"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey CurrentSpeed => new PropertyKey(SmbiosStructure.MemoryModule, SmbiosType006Property.CurrentSpeed, PropertyUnit.ns);
#endregion
#region [public] {static} (IPropertyKey) CurrentMemoryType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Describes the physical characteristics of the memory modules that are supported by (and currently installed in) the system.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryModule"/></description></item>
/// <item><description>Property: <see cref="SmbiosType006Property.CurrentMemoryType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey CurrentMemoryType => new PropertyKey(SmbiosStructure.MemoryModule, SmbiosType006Property.CurrentMemoryType);
#endregion
#region [public] {static} (IPropertyKey) InstalledSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identify the size of the memory module that is installed in the socket, as determined by reading and correlating the module’s presence-detect information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryModule"/></description></item>
/// <item><description>Property: <see cref="SmbiosType006Property.InstalledSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey InstalledSize => new PropertyKey(SmbiosStructure.MemoryModule, SmbiosType006Property.InstalledSize, PropertyUnit.MB);
#endregion
#region [public] {static} (IPropertyKey) EnabledSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the amount of memory currently enabled for the system’s use from the module.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryModule"/></description></item>
/// <item><description>Property: <see cref="SmbiosType006Property.EnabledSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey EnabledSize => new PropertyKey(SmbiosStructure.MemoryModule, SmbiosType006Property.EnabledSize, PropertyUnit.MB);
#endregion
#region [public] {static} (IPropertyKey) ErrorStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies error status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryModule"/></description></item>
/// <item><description>Property: <see cref="SmbiosType006Property.ErrorStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ErrorStatus => new PropertyKey(SmbiosStructure.MemoryModule, SmbiosType006Property.ErrorStatus);
#endregion
}
#endregion
#region [public] {static} (class) Cache: Contains the key definitions available for a type 007 [Cache Information] structure
/// <summary>
/// Contains the key definitions available for a type 007 [<see cref="SmbiosStructure.Cache"/> Information] structure.
/// </summary>
public static class Cache
{
#region version 2.0+
#region [public] {static} (IPropertyKey) SocketDesignation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number for reference designation.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Cache"/></description></item>
/// <item><description>Property: <see cref="SmbiosType007Property.SocketDesignation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SocketDesignation => new PropertyKey(SmbiosStructure.Cache, SmbiosType007Property.SocketDesignation);
#endregion
#region [public] {static} (IPropertyKey) MaximumCacheSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Maximum size that can be installed.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Cache"/></description></item>
/// <item><description>Property: <see cref="SmbiosType007Property.MaximumCacheSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="int"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey MaximumCacheSize => new PropertyKey(SmbiosStructure.Cache, SmbiosType007Property.MaximumCacheSize, PropertyUnit.KB);
#endregion
#region [public] {static} (IPropertyKey) InstalledCacheSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Installed size.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Cache"/></description></item>
/// <item><description>Property: <see cref="SmbiosType007Property.InstalledCacheSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="int"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey InstalledCacheSize => new PropertyKey(SmbiosStructure.Cache, SmbiosType007Property.InstalledCacheSize, PropertyUnit.KB);
#endregion
#region [public] {static} (IPropertyKey) SupportedSramTypes: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String collection with supported SRAM types.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Cache"/></description></item>
/// <item><description>Property: <see cref="SmbiosType007Property.SupportedSramTypes"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SupportedSramTypes => new PropertyKey(SmbiosStructure.Cache, SmbiosType007Property.SupportedSramTypes);
#endregion
#region [public] {static} (IPropertyKey) CurrentSramType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Current SRAM type is installed.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Cache"/></description></item>
/// <item><description>Property: <see cref="SmbiosType007Property.SupportedSramTypes"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CurrentSramType => new PropertyKey(SmbiosStructure.Cache, SmbiosType007Property.CurrentSramType);
#endregion
#endregion
#region version 2.1+
#region [public] {static} (IPropertyKey) CacheSpeed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Cache module speed, in nanoseconds.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Cache"/></description></item>
/// <item><description>Property: <see cref="SmbiosType007Property.CacheSpeed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.ns"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey CacheSpeed => new PropertyKey(SmbiosStructure.Cache, SmbiosType007Property.CacheSpeed, PropertyUnit.ns);
#endregion
#region [public] {static} (IPropertyKey) ErrorCorrectionType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Error-correction scheme supported by this cache component.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Cache"/></description></item>
/// <item><description>Property: <see cref="SmbiosType007Property.ErrorCorrectionType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey ErrorCorrectionType => new PropertyKey(SmbiosStructure.Cache, SmbiosType007Property.ErrorCorrectionType);
#endregion
#region [public] {static} (IPropertyKey) SystemCacheType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Logical type of cache.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Cache"/></description></item>
/// <item><description>Property: <see cref="SmbiosType007Property.SystemCacheType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey SystemCacheType => new PropertyKey(SmbiosStructure.Cache, SmbiosType007Property.SystemCacheType);
#endregion
#region [public] {static} (IPropertyKey) Associativity: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Associativity of the cache.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Cache"/></description></item>
/// <item><description>Property: <see cref="SmbiosType007Property.Associativity"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Associativity => new PropertyKey(SmbiosStructure.Cache, SmbiosType007Property.Associativity);
#endregion
#endregion
#region version 3.1+
#region [public] {static} (IPropertyKey) MaximumCacheSize2: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>If is present, for cache sizes of 2047MB or smaller the value is equals to <see cref="MaximumCacheSize"/> property.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Cache"/></description></item>
/// <item><description>Property: <see cref="SmbiosType007Property.MaximumCacheSize2"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MaximumCacheSize2 => new PropertyKey(SmbiosStructure.Cache, SmbiosType007Property.MaximumCacheSize2, PropertyUnit.KB);
#endregion
#region [public] {static} (IPropertyKey) InstalledCacheSize2: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>If is present, for cache sizes of 2047MB or smaller the value is equals to <see cref="InstalledCacheSize"/> property.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Cache"/></description></item>
/// <item><description>Property: <see cref="SmbiosType007Property.InstalledCacheSize2"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.1+</para>
/// </para>
/// </summary>
public static IPropertyKey InstalledCacheSize2 => new PropertyKey(SmbiosStructure.Cache, SmbiosType007Property.InstalledCacheSize2, PropertyUnit.KB);
#endregion
#endregion
#region nested classes
#region [public] {static} (class) CacheConfiguration: Contains the key definition for the 'CacheConfiguration' section
/// <summary>
/// Contains the key definition for the <b>CacheConfiguration</b> section.
/// </summary>
public static class CacheConfiguration
{
#region [public] {static} (IPropertyKey) CacheEnabled: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if is enabled/disabled (at boot time).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Cache"/></description></item>
/// <item><description>Property: <see cref="SmbiosType007Property.CacheEnabled"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CacheEnabled => new PropertyKey(SmbiosStructure.Cache, SmbiosType007Property.CacheEnabled);
#endregion
#region [public] {static} (IPropertyKey) CacheLevel: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Returns cache level (1, 2, 3,...).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Cache"/></description></item>
/// <item><description>Property: <see cref="SmbiosType007Property.CacheLevel"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Level => new PropertyKey(SmbiosStructure.Cache, SmbiosType007Property.CacheLevel);
#endregion
#region [public] {static} (IPropertyKey) CacheLocation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Location, relative to the CPU module.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Cache"/></description></item>
/// <item><description>Property: <see cref="SmbiosType007Property.CacheLocation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Location => new PropertyKey(SmbiosStructure.Cache, SmbiosType007Property.CacheLocation);
#endregion
#region [public] {static} (IPropertyKey) OperationalMode: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Cache operational mode (Write Through, Write Back, ...).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Cache"/></description></item>
/// <item><description>Property: <see cref="SmbiosType007Property.OperationalMode"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey OperationalMode => new PropertyKey(SmbiosStructure.Cache, SmbiosType007Property.OperationalMode);
#endregion
#region [public] {static} (IPropertyKey) CacheSocketed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if cache is socketed.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Cache"/></description></item>
/// <item><description>Property: <see cref="SmbiosType007Property.CacheSocketed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CacheSocketed => new PropertyKey(SmbiosStructure.Cache, SmbiosType007Property.CacheSocketed);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) PortConnector: Contains the key definitions available for a type 008 [Port Connector Information] structure
/// <summary>
/// Contains the key definitions available for a type 008 [<see cref="SmbiosStructure.PortConnector"/> Information] structure.
/// </summary>
public static class PortConnector
{
#region [public] {static} (IPropertyKey) InternalReferenceDesignator: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number for Internal Reference Designator, that is, internal to the system enclosure.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortConnector"/></description></item>
/// <item><description>Property: <see cref="SmbiosType008Property.InternalReferenceDesignator"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey InternalReferenceDesignator => new PropertyKey(SmbiosStructure.PortConnector, SmbiosType008Property.InternalReferenceDesignator);
#endregion
#region [public] {static} (IPropertyKey) InternalConnectorType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Internal Connector type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortConnector"/></description></item>
/// <item><description>Property: <see cref="SmbiosType008Property.InternalConnectorType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey InternalConnectorType => new PropertyKey(SmbiosStructure.PortConnector, SmbiosType008Property.InternalConnectorType);
#endregion
#region [public] {static} (IPropertyKey) ExternalReferenceDesignator: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number for the External Reference Designation external to the system enclosure.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortConnector"/></description></item>
/// <item><description>Property: <see cref="SmbiosType008Property.ExternalReferenceDesignator"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ExternalReferenceDesignator => new PropertyKey(SmbiosStructure.PortConnector, SmbiosType008Property.ExternalReferenceDesignator);
#endregion
#region [public] {static} (IPropertyKey) ExternalConnectorType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>External Connector type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortConnector"/></description></item>
/// <item><description>Property: <see cref="SmbiosType008Property.ExternalConnectorType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ExternalConnectorType => new PropertyKey(SmbiosStructure.PortConnector, SmbiosType008Property.ExternalConnectorType);
#endregion
#region [public] {static} (IPropertyKey) PortType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Describes the function of the port.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortConnector"/></description></item>
/// <item><description>Property: <see cref="SmbiosType008Property.PortType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey PortType => new PropertyKey(SmbiosStructure.PortConnector, SmbiosType008Property.PortType);
#endregion
}
#endregion
#region [public] {static} (class) SystemSlots: Contains the key definitions available for a type 009 [System Slots] structure
/// <summary>
/// Contains the key definitions available for a type 009 [<see cref="SmbiosStructure.SystemSlots"/>] structure.
/// </summary>
public static class SystemSlots
{
#region version 2.0+
#region [public] {static} (IPropertyKey) SlotDesignation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number for reference designation.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.SlotDesignation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SlotDesignation => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.SlotDesignation);
#endregion
#region [public] {static} (IPropertyKey) SlotType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Slot type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.SlotType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SlotType => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.SlotType);
#endregion
#region [public] {static} (IPropertyKey) SlotDataBusWidth: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Slot Data Bus Width.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.SlotDataBusWidth"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SlotDataBusWidth => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.SlotDataBusWidth, PropertyUnit.None);
#endregion
#region [public] {static} (IPropertyKey) CurrentUsage: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Slot current usage.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.CurrentUsage"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CurrentUsage => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.CurrentUsage);
#endregion
#region [public] {static} (IPropertyKey) SlotLength: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Slot length.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.SlotLength"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SlotLength => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.SlotLength);
#endregion
#region [public] {static} (IPropertyKey) SlotId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Slot Identifier.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.SlotId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SlotId => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.SlotId);
#endregion
#endregion
#region version 2.0+ - 2.1+
#region [public] {static} (IPropertyKey) SlotCharacteristics: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Slot characteristics.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.SlotCharacteristics"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+, 2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Characteristics => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.SlotCharacteristics);
#endregion
#endregion
#region version 2.6+
#region [public] {static} (IPropertyKey) SegmentBusFunction: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Segment bus function.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.SegmentBusFunction"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+ - 2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey SegmentBusFunction => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.SegmentBusFunction);
#endregion
#region [public] {static} (IPropertyKey) BusDeviceFunction: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Bus device function.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.BusDeviceFunction"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.6+</para>
/// </para>
/// </summary>
public static IPropertyKey BusDeviceFunction => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.BusDeviceFunction);
#endregion
#endregion
#region version 3.2
#region [public] {static} (IPropertyKey) PeerDevices: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>The PCI Express Generation (e.g., PCI Express Generation 6).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.PeerDevices"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="PeerDevicesCollection"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2</para>
/// </para>
/// </summary>
public static IPropertyKey PeerDevices => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.PeerDevices);
#endregion
#endregion
#region version 3.4
#region [public] {static} (IPropertyKey) SlotInformation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>The PCI Express Generation (e.g., PCI Express Generation 6).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.SlotInformation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.4</para>
/// </para>
/// </summary>
public static IPropertyKey SlotInformation => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.SlotInformation);
#endregion
#region [public] {static} (IPropertyKey) SlotPhysicalWidth: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates the physical width of the slot whereas <see cref="SystemSlots.SlotDataBusWidth"/> property indicates the electrical width of the slot.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.SlotPhysicalWidth"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.4</para>
/// </para>
/// </summary>
public static IPropertyKey SlotPhysicalWidth => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.SlotPhysicalWidth);
#endregion
#region [public] {static} (IPropertyKey) SlotPitch: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates the pitch of the slot in units of 1/100 millimeter. The pitch is defined by each slot/card specification, but typically describes add-in card to add-in card pitch.</para>
/// <para>A value of 0 implies that the slot pitch is not given or is unknown.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.SlotPitch"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.d_mm"/> <b>(1/100 mm)</b></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.4</para>
/// </para>
/// </summary>
public static IPropertyKey SlotPitch => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.SlotPitch, PropertyUnit.d_mm);
#endregion
#endregion
#region version 3.5
#region [public] {static} (IPropertyKey) SlotHeight: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates the maximum supported card height for the slot.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.SlotHeight"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey SlotHeight => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.SlotHeight);
#endregion
#endregion
#region nested classes
#region [public] {static} (class) Peers: Contains the key definition for the 'Peers' section
/// <summary>
/// Contains the key definition for the <b>Peers</b> section.
/// </summary>
public static class Peers
{
#region [public] {static} (IPropertyKey) SegmentGroupNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Segment Group Number is defined in the PCI Firmware Specification. The value is 0 for a single-segment topology.</para>
/// <para>For PCI Express slots, Bus Number and Device/Function Number refer to the endpoint in the slot, not the upstream switch.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.SegmentGroupNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2</para>
/// </para>
/// </summary>
public static IPropertyKey SegmentGroupNumber => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.SegmentGroupNumber);
#endregion
#region [public] {static} (IPropertyKey) BusDeviceFunction: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Bus device function (Peer).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.BusDeviceFunctionPeer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2</para>
/// </para>
/// </summary>
public static IPropertyKey BusDeviceFunction => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.BusDeviceFunctionPeer);
#endregion
#region [public] {static} (IPropertyKey) DataBusWidth: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates electrical bus width of peer Segment/Bus/Device/Function.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="SmbiosType009Property.DataBusWidth"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2</para>
/// </para>
/// </summary>
public static IPropertyKey DataBusWidth => new PropertyKey(SmbiosStructure.SystemSlots, SmbiosType009Property.DataBusWidth);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) OnBoardDevices: Contains the key definitions available for a type 010, obsolete [On Board Devices Information] structure
/// <summary>
/// Contains the key definitions available for a type 010, obsolete [<see cref="SmbiosStructure.OnBoardDevices"/> Information] structure.
/// </summary>
public static class OnBoardDevices
{
#region [public] {static} (IPropertyKey) Enabled: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Device status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.OnBoardDevices"/></description></item>
/// <item><description>Property: <see cref="SmbiosType010Property.Enabled"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey Enabled => new PropertyKey(SmbiosStructure.OnBoardDevices, SmbiosType010Property.Enabled);
#endregion
#region [public] {static} (IPropertyKey) DeviceType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Device type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.OnBoardDevices"/></description></item>
/// <item><description>Property: <see cref="SmbiosType010Property.DeviceType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey DeviceType => new PropertyKey(SmbiosStructure.OnBoardDevices, SmbiosType010Property.DeviceType);
#endregion
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of device description.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.OnBoardDevices"/></description></item>
/// <item><description>Property: <see cref="SmbiosType010Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(SmbiosStructure.OnBoardDevices, SmbiosType010Property.Description);
#endregion
}
#endregion
#region [public] {static} (class) OnBoardDevices: Contains the key definitions available for a type 011 [OEM Strings] structure
/// <summary>
/// Contains the key definitions available for a type 011 [<see cref="SmbiosStructure.OemStrings"/>] structure.
/// </summary>
public static class OemStrings
{
#region [public] {static} (IPropertyKey) Values: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains free-form strings defined by the OEM.</para>
/// <para>Examples of this are part numbers for system reference documents, contact information for the manufacturer, etc.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.OemStrings"/></description></item>
/// <item><description>Property: <see cref="SmbiosType011Property.Values"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Values => new PropertyKey(SmbiosStructure.OemStrings, SmbiosType011Property.Values);
#endregion
}
#endregion
#region [public] {static} (class) SystemConfigurationOptions: Contains the key definitions available for a type 012 [System Configuration Options] structure
/// <summary>
/// Contains the key definitions available for a type 012 [<see cref="SmbiosStructure.SystemConfigurationOptions"/>] structure.
/// </summary>
public static class SystemConfigurationOptions
{
#region [public] {static} (IPropertyKey) Values: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains information required to configure the baseboard’s Jumpers and Switches.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemConfigurationOptions"/></description></item>
/// <item><description>Property: <see cref="SmbiosType012Property.Values"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Values => new PropertyKey(SmbiosStructure.SystemConfigurationOptions, SmbiosType012Property.Values);
#endregion
}
#endregion
#region [public] {static} (class) BiosLanguage: Contains the key definitions available for a type 013 [BIOS Language Information] structure
/// <summary>
/// Contains the key definitions available for a type 013 [<see cref="SmbiosStructure.BiosLanguage"/> Information] structure.
/// </summary>
public static class BiosLanguage
{
#region version 2.0+
#region [public] {static} (IPropertyKey) InstallableLanguages: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of languages available. Each available language has a description string</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BiosLanguage"/></description></item>
/// <item><description>Property: <see cref="SmbiosType013Property.InstallableLanguages"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey InstallableLanguages => new PropertyKey(SmbiosStructure.BiosLanguage, SmbiosType013Property.InstallableLanguages);
#endregion
#region [public] {static} (IPropertyKey) Current: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Currently installed language.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BiosLanguage"/></description></item>
/// <item><description>Property: <see cref="SmbiosType013Property.Current"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Current => new PropertyKey(SmbiosStructure.BiosLanguage, SmbiosType013Property.Current);
#endregion
#endregion
#region version 2.1+
#region [public] {static} (IPropertyKey) IsCurrentAbbreviated: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if the abbreviated format is used.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BiosLanguage"/></description></item>
/// <item><description>Property: <see cref="SmbiosType013Property.IsCurrentAbbreviated"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey IsCurrentAbbreviated => new PropertyKey(SmbiosStructure.BiosLanguage, SmbiosType013Property.IsCurrentAbbreviated);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) GroupAssociations: Contains the key definitions available for a type 014 [Group Associations] structure
/// <summary>
/// Contains the key definitions available for a type 014 [<see cref="SmbiosStructure.GroupAssociations"/>] structure.
/// </summary>
public static class GroupAssociations
{
#region [public] {static} (IPropertyKey) ContainedElements: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>A collection of group association items.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.GroupAssociations"/></description></item>
/// <item><description>Property: <see cref="SmbiosType014Property.ContainedElements"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="GroupAssociationElementCollection"/></para>
/// </para>
/// </summary>
public static IPropertyKey ContainedElements => new PropertyKey(SmbiosStructure.GroupAssociations, SmbiosType014Property.ContainedElements);
#endregion
#region [public] {static} (IPropertyKey) GroupName: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of string describing the group.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.GroupAssociations"/></description></item>
/// <item><description>Property: <see cref="SmbiosType014Property.GroupName"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey GroupName => new PropertyKey(SmbiosStructure.GroupAssociations, SmbiosType014Property.GroupName);
#endregion
#region nested classes
#region [public] {static} (class) Items: Contains the key definition for the 'Items' section
/// <summary>
/// Contains the key definition for the <b>Items</b> section.
/// </summary>
public static class Items
{
#region [public] {static} (IPropertyKey) Handle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle corresponding to a item collection.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.GroupAssociations"/></description></item>
/// <item><description>Property: <see cref="SmbiosType014Property.Handle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Handle => new PropertyKey(SmbiosStructure.GroupAssociations, SmbiosType014Property.Handle);
#endregion
#region [public] {static} (IPropertyKey) Structure: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Item (Structure) Type of this member.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.GroupAssociations"/></description></item>
/// <item><description>Property: <see cref="SmbiosType014Property.Structure"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="SmbiosStructure"/></para>
/// </para>
/// </summary>
public static IPropertyKey Structure => new PropertyKey(SmbiosStructure.GroupAssociations, SmbiosType014Property.Structure);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) SystemEventLog: Contains the key definitions available for a type 015 [System Event Log] structure
/// <summary>
/// Contains the key definitions available for a type 015 [<see cref="SmbiosStructure.SystemEventLog"/>] structure.
/// </summary>
public static class SystemEventLog
{
#region [public] {static} (IPropertyKey) LogAreaLength: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>The length, in bytes, of the overall event log area</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="SmbiosType015Property.LogAreaLength"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="int"/></para>
/// </para>
/// </summary>
public static IPropertyKey LogAreaLength => new PropertyKey(SmbiosStructure.SystemEventLog, SmbiosType015Property.LogAreaLength, PropertyUnit.Bytes);
#endregion
#region [public] {static} (IPropertyKey) LogHeaderStartOffset: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Defines the starting offset (or index) within the nonvolatile storage of the event-log’s header from the Access Method Address</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="SmbiosType015Property.LogHeaderStartOffset"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey LogHeaderStartOffset => new PropertyKey(SmbiosStructure.SystemEventLog, SmbiosType015Property.LogHeaderStartOffset);
#endregion
#region [public] {static} (IPropertyKey) DataStartOffset: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Defines the starting offset (or index) within the nonvolatile storage of the event-log’s first data byte, from the Access Method Address</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="SmbiosType015Property.DataStartOffset"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="int"/></para>
/// </para>
/// </summary>
public static IPropertyKey DataStartOffset => new PropertyKey(SmbiosStructure.SystemEventLog, SmbiosType015Property.DataStartOffset);
#endregion
#region [public] {static} (IPropertyKey) AccessMethod: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Defines the Location and Method used by higher-level software to access the log area</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="SmbiosType015Property.AccessMethod"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey AccessMethod => new PropertyKey(SmbiosStructure.SystemEventLog, SmbiosType015Property.AccessMethod);
#endregion
#region [public] {static} (IPropertyKey) LogStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Current status of the system event-log</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="SmbiosType015Property.LogStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey LogStatus => new PropertyKey(SmbiosStructure.SystemEventLog, SmbiosType015Property.LogStatus);
#endregion
#region [public] {static} (IPropertyKey) AccessMethodAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Access Method Address</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="SmbiosType015Property.AccessMethodAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey AccessMethodAddress => new PropertyKey(SmbiosStructure.SystemEventLog, SmbiosType015Property.AccessMethodAddress);
#endregion
#region [public] {static} (IPropertyKey) LogChangeToken: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Unique token that is reassigned every time the event log changes</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="SmbiosType015Property.LogChangeToken"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey LogChangeToken => new PropertyKey(SmbiosStructure.SystemEventLog, SmbiosType015Property.LogChangeToken);
#endregion
#region [public] {static} (IPropertyKey) LogHeaderFormat: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Unique token that is reassigned every time the event log changes</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="SmbiosType015Property.LogHeaderFormat"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey LogHeaderFormat => new PropertyKey(SmbiosStructure.SystemEventLog, SmbiosType015Property.LogHeaderFormat);
#endregion
#region [public] {static} (IPropertyKey) SupportedLogTypeDescriptors: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of supported event log type descriptors.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="SmbiosType015Property.SupportedLogTypeDescriptors"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey SupportedLogTypeDescriptors => new PropertyKey(SmbiosStructure.SystemEventLog, SmbiosType015Property.SupportedLogTypeDescriptors);
#endregion
#region [public] {static} (IPropertyKey) SupportedLogTypeDescriptors: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>List of Event Log Type Descriptors.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="SmbiosType015Property.ListSupportedEventLogTypeDescriptors"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="SupportedEventLogTypeDescriptorsCollection"/></para>
/// </para>
/// </summary>
public static IPropertyKey ListSupportedEventLogTypeDescriptors => new PropertyKey(SmbiosStructure.SystemEventLog, SmbiosType015Property.ListSupportedEventLogTypeDescriptors);
#endregion
}
#endregion
#region [public] {static} (class) PhysicalMemoryArray: Contains the key definitions available for a type 016 [Physical Memory Array] structure
/// <summary>
/// Contains the key definitions available for a type 016 [<see cref="SmbiosStructure.PhysicalMemoryArray"/>] structure.
/// </summary>
public static class PhysicalMemoryArray
{
#region version 2.1+
#region [public] {static} (IPropertyKey) Location: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Physical location of the Memory Array, whether on the system board or an add-in board.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PhysicalMemoryArray"/></description></item>
/// <item><description>Property: <see cref="SmbiosType016Property.Location"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Location => new PropertyKey(SmbiosStructure.PhysicalMemoryArray, SmbiosType016Property.Location);
#endregion
#region [public] {static} (IPropertyKey) Use: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Function for which the array is used.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PhysicalMemoryArray"/></description></item>
/// <item><description>Property: <see cref="SmbiosType016Property.Use"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Use => new PropertyKey(SmbiosStructure.PhysicalMemoryArray, SmbiosType016Property.Use);
#endregion
#region [public] {static} (IPropertyKey) MemoryErrorCorrection: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Primary hardware error correction or detection method supported by this memory array.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PhysicalMemoryArray"/></description></item>
/// <item><description>Property: <see cref="SmbiosType016Property.MemoryErrorCorrection"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryErrorCorrection => new PropertyKey(SmbiosStructure.PhysicalMemoryArray, SmbiosType016Property.MemoryErrorCorrection);
#endregion
#region [public] {static} (IPropertyKey) MaximumCapacity: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Maximum memory capacity, in kilobytes, for this array.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PhysicalMemoryArray"/></description></item>
/// <item><description>Property: <see cref="SmbiosType016Property.MaximumCapacity"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MaximumCapacity => new PropertyKey(SmbiosStructure.PhysicalMemoryArray, SmbiosType016Property.MaximumCapacity, PropertyUnit.KB);
#endregion
#region [public] {static} (IPropertyKey) MemoryErrorInformationHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with any error that was previously detected for the array.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PhysicalMemoryArray"/></description></item>
/// <item><description>Property: <see cref="SmbiosType016Property.MemoryErrorInformationHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryErrorInformationHandle => new PropertyKey(SmbiosStructure.PhysicalMemoryArray, SmbiosType016Property.MemoryErrorInformationHandle);
#endregion
#region [public] {static} (IPropertyKey) NumberOfMemoryDevices: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of slots or sockets available for Memory devices in this array.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PhysicalMemoryArray"/></description></item>
/// <item><description>Property: <see cref="SmbiosType016Property.NumberOfMemoryDevices"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey NumberOfMemoryDevices => new PropertyKey(SmbiosStructure.PhysicalMemoryArray, SmbiosType016Property.NumberOfMemoryDevices);
#endregion
#endregion
#region version 2.7+
#region [public] {static} (IPropertyKey) ExtendedMaximumCapacity: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Extended maximum memory capacity, in kilobytes, for this array.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PhysicalMemoryArray"/></description></item>
/// <item><description>Property: <see cref="SmbiosType016Property.ExtendedMaximumCapacity"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey ExtendedMaximumCapacity => new PropertyKey(SmbiosStructure.PhysicalMemoryArray, SmbiosType016Property.ExtendedMaximumCapacity, PropertyUnit.KB);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) MemoryDevice: Contains the key definitions available for a type 017 [Memory Device] structure
/// <summary>
/// Contains the key definitions available for a type 017 [<see cref="SmbiosStructure.MemoryDevice"/>] structure.
/// </summary>
public static class MemoryDevice
{
#region version 2.1+
#region [public] {static} (IPropertyKey) PhysicalMemoryArrayHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with the physical memory array to which this device belongs.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.PhysicalMemoryArrayHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey PhysicalMemoryArrayHandle => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.PhysicalMemoryArrayHandle);
#endregion
#region [public] {static} (IPropertyKey) MemoryErrorInformationHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// Handle, or instance number, associated with any error that was previously detected for the device.
/// If the system does not provide the error information structure, the field contains FFFEh; otherwise, the
/// field contains either FFFFh(if no error was detected).
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.MemoryErrorInformationHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryErrorInformationHandle => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.MemoryErrorInformationHandle);
#endregion
#region [public] {static} (IPropertyKey) TotalWidth: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// Total width, in bits, of this memory device, including any check or error-correction bits.
/// If there are no error-correction bits, this value should be equal to Data Width.If the width is unknown, the field is set to FFFFh
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.TotalWidth"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bits"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey TotalWidth => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.TotalWidth, PropertyUnit.Bits);
#endregion
#region [public] {static} (IPropertyKey) DataWidth: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// Data width, in bits, of this memory device A data width of 0 and a total width of 8 indicates that the device is being
/// used solely to provide 8 error-correction bits.
/// If there are no error-correction bits, this value should be equal to Data Width.If the width is unknown, the field is set to FFFFh.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.DataWidth"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bits"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey DataWidth => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.DataWidth, PropertyUnit.Bits);
#endregion
#region [public] {static} (IPropertyKey) Size: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// Size of the memory device.
/// If the value is 0, no memory device is installed in the socket;
/// if the size is unknown, the field value is FFFFh.
/// If the size is 32 GB-1 MB or greater, the field value is 7FFFh and the actual size is stored in the Extended Size field.
/// The granularity in which the value is specified depends on the setting of the most-significant bit (bit 15).
/// If the bit is 0, the value is specified in megabyte units; if the bit is 1, the value is specified in kilobyte units.
/// For example, the value 8100h identifies a 256 KB memory device and 0100h identifies a 256 MB memory device.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.Size"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Size => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.Size, PropertyUnit.KB);
#endregion
#region [public] {static} (IPropertyKey) FormFactor: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Implementation form factor for this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.FormFactor"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey FormFactor => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.FormFactor);
#endregion
#region [public] {static} (IPropertyKey) DeviceSet: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// Identifies when the Memory Device is one of a set of Memory Devices that must be populated with all
/// devices of the same type and size, and the set to which this device belongs.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.DeviceSet"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey DeviceSet => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.DeviceSet);
#endregion
#region [public] {static} (IPropertyKey) BankLocator: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>String number of the string that identifies the physically labeled bank where the memory device is located.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.BankLocator"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey BankLocator => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.BankLocator);
#endregion
#region [public] {static} (IPropertyKey) DeviceLocator: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>String number of the string that identifies the physically-labeled socket or board position where the memory device is located.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.DeviceLocator"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey DeviceLocator => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.DeviceLocator);
#endregion
#region [public] {static} (IPropertyKey) MemoryType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Type of memory used in this device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.MemoryType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryType => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.MemoryType);
#endregion
#region [public] {static} (IPropertyKey) TypeDetail: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Additional detail on the memory device type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.TypeDetail"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey TypeDetail => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.TypeDetail);
#endregion
#endregion
#region version 2.3+
#region [public] {static} (IPropertyKey) Speed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// Identifies the maximum capable speed of the device, in megatransfers per second(MT/s).
/// 0000h = the speed is unknown.
/// FFFFh = the speed is 65,535 MT/s or greater, and the actual speed is stored in the <see cref="ExtendedSpeed"/> property.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.Speed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MTs"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey Speed => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.Speed, PropertyUnit.MTs);
#endregion
#region [public] {static} (IPropertyKey) Manufacturer: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>String number for the manufacturer of this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.Manufacturer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey Manufacturer => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.Manufacturer);
#endregion
#region [public] {static} (IPropertyKey) SerialNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>String number for the serial number of this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.SerialNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey SerialNumber => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.SerialNumber);
#endregion
#region [public] {static} (IPropertyKey) AssetTag: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>String number for the asset tag of this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.AssetTag"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey AssetTag => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.AssetTag);
#endregion
#region [public] {static} (IPropertyKey) PartNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>String number for the part number of this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.PartNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey PartNumber => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.PartNumber);
#endregion
#endregion
#region version 2.6+
#region [public] {static} (IPropertyKey) Rank: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Rank.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.Rank"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey Rank => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.Rank);
#endregion
#endregion
#region version 2.7+
#region [public] {static} (IPropertyKey) ExtendedSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Extended size of the memory device (complements the <see cref="Size"/> property).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.ExtendedSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey ExtendedSize => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.Size, PropertyUnit.None);
#endregion
#region [public] {static} (IPropertyKey) ConfiguredMemoryClockSpeed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// Memory speed is expressed in megatransfers per second (MT/s). Previous revisions (3.0.0 and earlier) of this
/// specification used MHz to indicate clock speed.With double data rate memory, clock speed is distinct
/// from transfer rate, since data is transferred on both the rising and the falling edges of the clock signal.
/// This maintains backward compatibility with observed DDR implementations prior to this revision, which
/// already reported transfer rate instead of clock speed, e.g., DDR4-2133 (PC4-17000) memory was
/// reported as 2133 instead of 1066.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.ConfiguredMemoryClockSpeed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Variable"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey ConfiguredMemoryClockSpeed => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.ConfiguredMemoryClockSpeed, PropertyUnit.Variable);
#endregion
#endregion
#region version 2.8+
#region [public] {static} (IPropertyKey) MinimumVoltage: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Minimum operating voltage for this device, in millivolts.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.MinimumVoltage"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mV"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.8+</para>
/// </para>
/// </summary>
public static IPropertyKey MinimumVoltage => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.MinimumVoltage, PropertyUnit.mV);
#endregion
#region [public] {static} (IPropertyKey) MaximumVoltage: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Maximum operating voltage for this device, in millivolts.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.MaximumVoltage"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mV"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.8+</para>
/// </para>
/// </summary>
public static IPropertyKey MaximumVoltage => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.MaximumVoltage, PropertyUnit.mV);
#endregion
#region [public] {static} (IPropertyKey) ConfiguredVoltage: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Configured voltage for this device, in millivolts.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.ConfiguredVoltage"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mV"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.8+</para>
/// </para>
/// </summary>
public static IPropertyKey ConfiguredVoltage => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.ConfiguredVoltage, PropertyUnit.mV);
#endregion
#endregion
#region version 3.2+
#region [public] {static} (IPropertyKey) MemoryTechnology: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Memory technology type for this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.MemoryTechnology"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryTechnology => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.MemoryTechnology);
#endregion
#region [public] {static} (IPropertyKey) MemoryOperatingModeCapability: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>The operating modes supported by this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.MemoryOperatingModeCapability"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryOperatingModeCapability => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.MemoryOperatingModeCapability);
#endregion
#region [public] {static} (IPropertyKey) FirmwareVersion: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number for the firmware version of this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.FirmwareVersion"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareVersion => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.FirmwareVersion);
#endregion
#region [public] {static} (IPropertyKey) ModuleManufacturerId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>The two-byte module manufacturer ID found in the SPD of this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.ModuleManufacturerId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey ModuleManufacturerId => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.ModuleManufacturerId);
#endregion
#region [public] {static} (IPropertyKey) ModuleProductId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>The two-byte module product ID found in the SPD of this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.ModuleProductId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey ModuleProductId => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.ModuleProductId);
#endregion
#region [public] {static} (IPropertyKey) MemorySubSystemControllerManufacturerId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>The two-byte memory subsystem controller manufacturer ID found in the SPD of this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.MemorySubSystemControllerManufacturerId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey MemorySubsystemControllerManufacturerId => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.MemorySubSystemControllerManufacturerId);
#endregion
#region [public] {static} (IPropertyKey) MemorySubSystemControllerProductId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>The two-byte memory subsystem controller product ID found in the SPD of this memory device; LSB first.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.MemorySubSystemControllerProductId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey MemorySubsystemControllerProductId => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.MemorySubSystemControllerProductId);
#endregion
#region [public] {static} (IPropertyKey) NonVolatileSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Size of the Non-volatile portion of the memory device in bytes.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.NonVolatileSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey NonVolatileSize => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.NonVolatileSize, PropertyUnit.Bytes);
#endregion
#region [public] {static} (IPropertyKey) VolatileSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Size of the volatile portion of the memory device in bytes.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.VolatileSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey VolatileSize => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.VolatileSize, PropertyUnit.Bytes);
#endregion
#region [public] {static} (IPropertyKey) CacheSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Size of the Cache portion of the memory device in bytes.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.CacheSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey CacheSize => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.CacheSize, PropertyUnit.Bytes);
#endregion
#region [public] {static} (IPropertyKey) LogicalSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Size of the Logical memory device in bytes.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.LogicalSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey LogicalSize => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.LogicalSize, PropertyUnit.Bytes);
#endregion
#endregion
#region version 3.3+
#region [public] {static} (IPropertyKey) ExtendedSpeed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Extended speed of the memory device. Identifies the maximum capable speed of the device, in megatransfers per second (MT/s).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.ExtendedSpeed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MTs"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.3+</para>
/// </para>
/// </summary>
public static IPropertyKey ExtendedSpeed => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.ExtendedSpeed, PropertyUnit.MTs);
#endregion
#region [public] {static} (IPropertyKey) ExtendedConfiguredMemorySpeed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Extended configured memory speed of the memory device. Identifies the configured speed of the memory device, in megatransfers per second (MT/s).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.ExtendedConfiguredMemorySpeed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MTs"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.3+</para>
/// </para>
/// </summary>
public static IPropertyKey ExtendedConfiguredMemorySpeed => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.ExtendedConfiguredMemorySpeed, PropertyUnit.MTs);
#endregion
#endregion
#region version 3.7+
#region [public] {static} (IPropertyKey) PMIC0ManufacturerId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// The PMIC0 Manufacturer ID indicates the manufacturer of the PMIC0 on memory device. This field shall
/// be set to the value of the SPD PMIC 0 Manufacturer ID Code.
/// A value of 0000h indicates the PMIC0 Manufacturer ID is unknown.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.PMIC0ManufacturerId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.7+</para>
/// </para>
/// </summary>
public static IPropertyKey PMIC0ManufacturerId => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.PMIC0ManufacturerId, PropertyUnit.None);
#endregion
#region [public] {static} (IPropertyKey) PMIC0RevisionNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// The PMIC0 Revision Number indicates the revision of the PMIC0 on memory device. This field shall be
/// set to the value of the SPD PMIC 0 Revision Number.
/// A value of FF00h indicates the PMIC0 Revision Number is unknown.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.PMIC0RevisionNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.7+</para>
/// </para>
/// </summary>
public static IPropertyKey PMIC0RevisionNumber => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.PMIC0RevisionNumber, PropertyUnit.None);
#endregion
#region [public] {static} (IPropertyKey) RCDManufacturerId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// The RCD Manufacturer ID indicates the manufacturer of the RCD on memory device. This field shall be
/// set to the value of the SPD Registering Clock Driver Manufacturer ID Code.
/// A value of 0000h indicates the RCD Manufacturer ID is unknown
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.RCDManufacturerId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.7+</para>
/// </para>
/// </summary>
public static IPropertyKey RCDManufacturerId => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.RCDManufacturerId, PropertyUnit.None);
#endregion
#region [public] {static} (IPropertyKey) RCDRevisionNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// The RCD Revision Number indicates the revision of the RCD on memory device.
/// This field shall be set to the value of the SPD Register Revision Number.
/// A value of FF00h indicates the RCD Revision Number is unknown.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType017Property.RCDRevisionNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.7+</para>
/// </para>
/// </summary>
public static IPropertyKey RCDRevisionNumber => new PropertyKey(SmbiosStructure.MemoryDevice, SmbiosType017Property.RCDRevisionNumber, PropertyUnit.None);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) BitMemoryError32: Contains the key definitions available for a type 018 [32-Bit Memory Error Information] structure
/// <summary>
/// Contains the key definitions available for a type 018 [<see cref="SmbiosStructure.BitMemoryError32"/> Information] structure.
/// </summary>
public static class BitMemoryError32
{
#region version 2.1+
#region [public] {static} (IPropertyKey) ErrorType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Type of error that is associated with the current status reported for the memory array or device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BitMemoryError32"/></description></item>
/// <item><description>Property: <see cref="SmbiosType018Property.ErrorType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey ErrorType => new PropertyKey(SmbiosStructure.BitMemoryError32, SmbiosType018Property.ErrorType);
#endregion
#region [public] {static} (IPropertyKey) ErrorGranularity: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Granularity (for example, device versus Partition) to which the error can be resolved.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BitMemoryError32"/></description></item>
/// <item><description>Property: <see cref="SmbiosType018Property.ErrorGranularity"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey ErrorGranularity => new PropertyKey(SmbiosStructure.BitMemoryError32, SmbiosType018Property.ErrorGranularity);
#endregion
#region [public] {static} (IPropertyKey) ErrorOperation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Memory access operation that caused the error.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BitMemoryError32"/></description></item>
/// <item><description>Property: <see cref="SmbiosType018Property.ErrorOperation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey ErrorOperation => new PropertyKey(SmbiosStructure.BitMemoryError32, SmbiosType018Property.ErrorOperation);
#endregion
#region [public] {static} (IPropertyKey) VendorSyndrome: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Vendor-specific ECC syndrome or CRC data associated with the erroneous access.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BitMemoryError32"/></description></item>
/// <item><description>Property: <see cref="SmbiosType018Property.VendorSyndrome"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey VendorSyndrome => new PropertyKey(SmbiosStructure.BitMemoryError32, SmbiosType018Property.VendorSyndrome);
#endregion
#region [public] {static} (IPropertyKey) MemoryArrayErrorAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>32-bit physical address of the error based on the addressing of the bus to which the memory array is connected.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BitMemoryError32"/></description></item>
/// <item><description>Property: <see cref="SmbiosType018Property.MemoryArrayErrorAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryArrayErrorAddress => new PropertyKey(SmbiosStructure.BitMemoryError32, SmbiosType018Property.MemoryArrayErrorAddress);
#endregion
#region [public] {static} (IPropertyKey) DeviceErrorAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>32-bit physical address of the error relative to the start of the failing memory device, in bytes</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BitMemoryError32"/></description></item>
/// <item><description>Property: <see cref="SmbiosType018Property.DeviceErrorAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey DeviceErrorAddress => new PropertyKey(SmbiosStructure.BitMemoryError32, SmbiosType018Property.DeviceErrorAddress, PropertyUnit.Bytes);
#endregion
#region [public] {static} (IPropertyKey) ErrorResolution: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Range, in bytes, within which the error can be determined, when an error address is given</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BitMemoryError32"/></description></item>
/// <item><description>Property: <see cref="SmbiosType018Property.ErrorResolution"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey ErrorResolution => new PropertyKey(SmbiosStructure.BitMemoryError32, SmbiosType018Property.ErrorResolution, PropertyUnit.Bytes);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) MemoryArrayMappedAddress: Contains the key definitions available for a type 019 [Memory Array Mapped Address] structure
/// <summary>
/// Contains the key definitions available for a type 019 [<see cref="SmbiosStructure.MemoryArrayMappedAddress"/>] structure.
/// </summary>
public static class MemoryArrayMappedAddress
{
#region version 2.1+
#region [public] {static} (IPropertyKey) StartingAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Physical address, of a range of memory mapped to the specified physical memory array When the field value is FFFF FFFFh,
/// the actual address is stored in the <see cref="ExtendedStartingAddress"/> property.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryArrayMappedAddress"/></description></item>
/// <item><description>Property: <see cref="SmbiosType019Property.StartingAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey StartingAddress => new PropertyKey(SmbiosStructure.MemoryArrayMappedAddress, SmbiosType019Property.StartingAddress, PropertyUnit.KB);
#endregion
#region [public] {static} (IPropertyKey) EndingAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para> Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Physical ending address of the last kilobyte of a range of addresses mapped to the specified physical memory array When the field value is FFFF FFFFh
/// and the <see cref="StartingAddress"/> property also contains FFFF FFFFh, the actual address is stored in the <see cref="ExtendedEndingAddress"/> property.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryArrayMappedAddress"/></description></item>
/// <item><description>Property: <see cref="SmbiosType019Property.EndingAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey EndingAddress => new PropertyKey(SmbiosStructure.MemoryArrayMappedAddress, SmbiosType019Property.EndingAddress, PropertyUnit.KB);
#endregion
#region [public] {static} (IPropertyKey) MemoryArrayHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para> Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Handle, or instance number, associated with the physical memory array to which this address range is mapped
/// multiple address ranges can be mapped to a single physical memory array.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryArrayMappedAddress"/></description></item>
/// <item><description>Property: <see cref="SmbiosType019Property.MemoryArrayHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryArrayHandle => new PropertyKey(SmbiosStructure.MemoryArrayMappedAddress, SmbiosType019Property.MemoryArrayHandle);
#endregion
#region [public] {static} (IPropertyKey) PartitionWidth: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para> Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of memory devices that form a single row of memory for the address partition defined by this structure.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryArrayMappedAddress"/></description></item>
/// <item><description>Property: <see cref="SmbiosType019Property.PartitionWidth"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey PartitionWidth => new PropertyKey(SmbiosStructure.MemoryArrayMappedAddress, SmbiosType019Property.PartitionWidth);
#endregion
#endregion
#region version 2.7+
#region [public] {static} (IPropertyKey) ExtendedStartingAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Physical address, in bytes, of a range of memory mapped to the specified physical memory array this property is valid when
/// <see cref="StartingAddress"/> contains the value FFFF FFFFh. If <see cref="StartingAddress"/> contains a value other than FFFF FFFFh,
/// this field contains zeros.When this field contains a valid address, <see cref="ExtendedEndingAddress"/> must also contain a valid address.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryArrayMappedAddress"/></description></item>
/// <item><description>Property: <see cref="SmbiosType019Property.ExtendedStartingAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey ExtendedStartingAddress => new PropertyKey(SmbiosStructure.MemoryArrayMappedAddress, SmbiosType019Property.ExtendedStartingAddress, PropertyUnit.Bytes);
#endregion
#region [public] {static} (IPropertyKey) ExtendedEndingAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Physical ending address, in bytes, of the last of a range of addresses mapped to the specified physical memory array this property
/// is valid when both <see cref="StartingAddress"/> and <see cref="EndingAddress"/> contain the value FFFF FFFFh. If <see cref="EndingAddress"/>
/// contains a value other than FFFF FFFFh, this property contains zeros. When this property contains a valid address, <see cref="ExtendedEndingAddress"/>
/// must also contain a valid address.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryArrayMappedAddress"/></description></item>
/// <item><description>Property: <see cref="SmbiosType019Property.ExtendedEndingAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey ExtendedEndingAddress => new PropertyKey(SmbiosStructure.MemoryArrayMappedAddress, SmbiosType019Property.ExtendedEndingAddress, PropertyUnit.Bytes);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) MemoryArrayMappedAddress: Contains the key definitions available for a type 020 [Memory Device Mapped Address] structure
/// <summary>
/// Contains the key definitions available for a type 020 [<see cref="SmbiosStructure.MemoryDeviceMappedAddress"/>] structure.
/// </summary>
public static class MemoryDeviceMappedAddress
{
#region version 2.1+
#region [public] {static} (IPropertyKey) StartingAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Physical address, in kilobytes, of a range of memory mapped to the referenced memory device When the property value is FFFF FFFFh the actual
/// address is stored in the <see cref="ExtendedStartingAddress"/> property. When this property contains a valid address, <see cref="EndingAddress"/> must also contain a
/// valid address. When this property contains FFFF FFFFh, <see cref="EndingAddress"/> must also contain FFFF FFFFh.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDeviceMappedAddress"/></description></item>
/// <item><description>Property: <see cref="SmbiosType020Property.StartingAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey StartingAddress => new PropertyKey(SmbiosStructure.MemoryDeviceMappedAddress, SmbiosType020Property.StartingAddress);
#endregion
#region [public] {static} (IPropertyKey) EndingAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Physical ending address of the last kilobyte of a range of addresses mapped to the referenced memory device When the field value is FFFF FFFFh the actual
/// address is stored in the <see cref="ExtendedEndingAddress"/> field. When this property contains a valid address,<see cref="StartingAddress"/> must also contain a valid address.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDeviceMappedAddress"/></description></item>
/// <item><description>Property: <see cref="SmbiosType020Property.EndingAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey EndingAddress => new PropertyKey(SmbiosStructure.MemoryDeviceMappedAddress, SmbiosType020Property.EndingAddress);
#endregion
#region [public] {static} (IPropertyKey) MemoryDeviceHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Handle, or instance number, associated with the memory device structure to which this address range is mapped multiple address
/// ranges can be mapped to a single memory device.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDeviceMappedAddress"/></description></item>
/// <item><description>Property: <see cref="SmbiosType020Property.MemoryDeviceHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryDeviceHandle => new PropertyKey(SmbiosStructure.MemoryDeviceMappedAddress, SmbiosType020Property.MemoryDeviceHandle);
#endregion
#region [public] {static} (IPropertyKey) MemoryArrayMappedAddressHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Handle, or instance number, associated with the memory array mapped Address structure to which this device address range is mapped
/// multiple address ranges can be mapped to a single Memory array mapped address.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDeviceMappedAddress"/></description></item>
/// <item><description>Property: <see cref="SmbiosType020Property.MemoryArrayMappedAddressHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryArrayMappedAddressHandle => new PropertyKey(SmbiosStructure.MemoryDeviceMappedAddress, SmbiosType020Property.MemoryArrayMappedAddressHandle);
#endregion
#region [public] {static} (IPropertyKey) PartitionRowPosition: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Position of the referenced Memory Device in a row of the address partition.
/// The value 0 is reserved. If the position is unknown, the field contains FFh.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDeviceMappedAddress"/></description></item>
/// <item><description>Property: <see cref="SmbiosType020Property.PartitionRowPosition"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey PartitionRowPosition => new PropertyKey(SmbiosStructure.MemoryDeviceMappedAddress, SmbiosType020Property.PartitionRowPosition);
#endregion
#region [public] {static} (IPropertyKey) InterleavePosition: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Position of the referenced Memory Device in an interleave.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDeviceMappedAddress"/></description></item>
/// <item><description>Property: <see cref="SmbiosType020Property.InterleavePosition"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="MemoryDeviceMappedAddressInterleavedPosition"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey InterleavePosition => new PropertyKey(SmbiosStructure.MemoryDeviceMappedAddress, SmbiosType020Property.InterleavePosition);
#endregion
#region [public] {static} (IPropertyKey) InterleavedDataDepth: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Maximum number of consecutive rows from the referenced Memory Device that are accessed in a single interleaved transfer.
/// If the device is not part of an interleave, the field contains 0; if the interleave configuration is unknown, the value is FFh.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDeviceMappedAddress"/></description></item>
/// <item><description>Property: <see cref="SmbiosType020Property.InterleavedDataDepth"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey InterleavedDataDepth => new PropertyKey(SmbiosStructure.MemoryDeviceMappedAddress, SmbiosType020Property.InterleavedDataDepth);
#endregion
#endregion
#region version 2.7+
#region [public] {static} (IPropertyKey) ExtendedStartingAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Physical address, in bytes, of a range of memory mapped to the referenced memory device this property is valid when <see cref="StartingAddress"/> contains
/// the value FFFF FFFFh. If <see cref="StartingAddress"/> contains a value other than FFFF FFFFh, this property contains zeros. When this property contains a valid
/// address, <see cref="ExtendedEndingAddress"/> must also contain a valid address.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDeviceMappedAddress"/></description></item>
/// <item><description>Property: <see cref="SmbiosType020Property.ExtendedStartingAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey ExtendedStartingAddress => new PropertyKey(SmbiosStructure.MemoryDeviceMappedAddress, SmbiosType020Property.ExtendedStartingAddress, PropertyUnit.Bytes);
#endregion
#region [public] {static} (IPropertyKey) ExtendedEndingAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Physical ending address, in bytes, of the last of a range of addresses mapped to the referenced memory device this property is valid when both
/// <see cref="StartingAddress"/> and <see cref="EndingAddress"/> contain the value FFFF FFFFh. If <see cref="EndingAddress"/> contains a value other
/// than FFFF FFFFh, this property contains zeros. When this property contains a valid address, <see cref="ExtendedStartingAddress"/> must also contain a valid address.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryDeviceMappedAddress"/></description></item>
/// <item><description>Property: <see cref="SmbiosType020Property.ExtendedEndingAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey ExtendedEndingAddress => new PropertyKey(SmbiosStructure.MemoryDeviceMappedAddress, SmbiosType020Property.ExtendedEndingAddress, PropertyUnit.Bytes);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) BuiltInPointingDevice: Contains the key definitions available for a type 021 [Built-in Pointing Device] structure
/// <summary>
/// Contains the key definitions available for a type 021 [<see cref="SmbiosStructure.BuiltInPointingDevice"/>] structure.
/// </summary>
public static class BuiltInPointingDevice
{
#region version 2.1+
#region [public] {static} (IPropertyKey) Type: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Type of pointing device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BuiltInPointingDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType021Property.Type"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Type => new PropertyKey(SmbiosStructure.BuiltInPointingDevice, SmbiosType021Property.Type);
#endregion
#region [public] {static} (IPropertyKey) Interface: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Interface type for the pointing device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BuiltInPointingDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType021Property.Interface"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Interface => new PropertyKey(SmbiosStructure.BuiltInPointingDevice, SmbiosType021Property.Interface);
#endregion
#region [public] {static} (IPropertyKey) NumberOfButtons: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of buttons on the pointing device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BuiltInPointingDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType021Property.NumberOfButtons"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey NumberOfButtons => new PropertyKey(SmbiosStructure.BuiltInPointingDevice, SmbiosType021Property.NumberOfButtons);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) PortableBattery: Contains the key definitions available for a type 022 [Portable Battery] structure
/// <summary>
/// Contains the key definitions available for a type 022 [<see cref="SmbiosStructure.PortableBattery"/>] structure.
/// </summary>
public static class PortableBattery
{
#region version 2.1+
#region [public] {static} (IPropertyKey) Location: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of the string that identifies the location of the battery.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="SmbiosType022Property.Location"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Location => new PropertyKey(SmbiosStructure.PortableBattery, SmbiosType022Property.Location);
#endregion
#region [public] {static} (IPropertyKey) Manufacturer: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of the string that names the company that manufactured the battery.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="SmbiosType022Property.Manufacturer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Manufacturer => new PropertyKey(SmbiosStructure.PortableBattery, SmbiosType022Property.Manufacturer);
#endregion
#region [public] {static} (IPropertyKey) DeviceName: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Battery name.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="SmbiosType022Property.DeviceName"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey DeviceName => new PropertyKey(SmbiosStructure.PortableBattery, SmbiosType022Property.DeviceName);
#endregion
#region [public] {static} (IPropertyKey) DesignVoltage: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Design voltage of the battery in mVolts.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="SmbiosType022Property.DesignVoltage"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mV"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey DesignVoltage => new PropertyKey(SmbiosStructure.PortableBattery, SmbiosType022Property.DesignVoltage, PropertyUnit.mV);
#endregion
#region [public] {static} (IPropertyKey) SBDSVersionNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>The Smart Battery Data Specification version number supported by this battery.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="SmbiosType022Property.SbdsVersionNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey SBDSVersionNumber => new PropertyKey(SmbiosStructure.PortableBattery, SmbiosType022Property.SbdsVersionNumber);
#endregion
#region [public] {static} (IPropertyKey) MaximunErrorInBatteryData: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Maximum error (as a percentage in the range 0 to 100) in the Watt-hour data reported by the battery, indicating an upper bound on how much
/// additional energy the battery might have above the energy it reports having.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="SmbiosType022Property.MaximunErrorInBatteryData"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MaximunErrorInBatteryData => new PropertyKey(SmbiosStructure.PortableBattery, SmbiosType022Property.MaximunErrorInBatteryData);
#endregion
#region [public] {static} (IPropertyKey) ManufactureDate: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// The date on which the battery was manufactured. Version 2.2+ implementations that use a Smart Battery set this property to empty string to indicate
/// that the <b>SBDS Manufacture Date</b>.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="SmbiosType022Property.ManufactureDate"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey ManufactureDate => new PropertyKey(SmbiosStructure.PortableBattery, SmbiosType022Property.ManufactureDate);
#endregion
#region [public] {static} (IPropertyKey) SerialNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// The serial number for the battery. Version 2.2+ implementations that use a Smart Battery set this property to empty string to indicate
/// that the <b>SBDS Serial Number</b> (<see cref="SBDSVersionNumber"/>) property contains the information.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="SmbiosType022Property.SerialNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey SerialNumber => new PropertyKey(SmbiosStructure.PortableBattery, SmbiosType022Property.SerialNumber);
#endregion
#region [public] {static} (IPropertyKey) DeviceChemistry: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Identifies the battery chemistry. Version 2.2+ implementations that use a Smart Battery set this property to empty string to indicate
/// that the <b>SBDS Device Chemistry</b>.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="SmbiosType022Property.DeviceChemistry"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey DeviceChemistry => new PropertyKey(SmbiosStructure.PortableBattery, SmbiosType022Property.DeviceChemistry);
#endregion
#region [public] {static} (IPropertyKey) DesignCapacity: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Design capacity of the battery in mWatt-hours. For version 2.2+ implementations, this value is multiplied by the
/// <b>Design Capacity Multiplier</b> (<see cref="DesignCapacityMultiplier"/>) property to produce the actual value.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="SmbiosType022Property.DesignCapacity"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mWh"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey DesignCapacity => new PropertyKey(SmbiosStructure.PortableBattery, SmbiosType022Property.DesignCapacity, PropertyUnit.mWh);
#endregion
#endregion
#region version 2.2+
#region [public] {static} (IPropertyKey) DesignCapacityMultiplier: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Multiplication factor of the Design Capacity value, which assures that the mWatt hours value
/// does not overflow for <b>SBDS</b> implementations. The multiplier default is 1.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="SmbiosType022Property.DesignCapacityMultiplier"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.2+</para>
/// </para>
/// </summary>
public static IPropertyKey DesignCapacityMultiplier => new PropertyKey(SmbiosStructure.PortableBattery, SmbiosType022Property.DesignCapacityMultiplier);
#endregion
#region [public] {static} (IPropertyKey) OemSpecific: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains OEM or BIOS vendor-specific information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="SmbiosType022Property.OemSpecific"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.2+</para>
/// </para>
/// </summary>
public static IPropertyKey OemSpecific => new PropertyKey(SmbiosStructure.PortableBattery, SmbiosType022Property.OemSpecific);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) SystemReset: Contains the key definitions available for a type 023 [System Reset] structure
/// <summary>
/// Contains the key definitions available for a type 023 [<see cref="SmbiosStructure.SystemReset"/>] structure.
/// </summary>
public static class SystemReset
{
#region [public] {static} (IPropertyKey) ResetCount: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of automatic system resets since the last intentional reset.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemReset"/></description></item>
/// <item><description>Property: <see cref="SmbiosType023Property.ResetCount"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey ResetCount => new PropertyKey(SmbiosStructure.SystemReset, SmbiosType023Property.ResetCount);
#endregion
#region [public] {static} (IPropertyKey) ResetLimit: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of consecutive times the system reset is attempted.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemReset"/></description></item>
/// <item><description>Property: <see cref="SmbiosType023Property.ResetLimit"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey ResetLimit => new PropertyKey(SmbiosStructure.SystemReset, SmbiosType023Property.ResetLimit);
#endregion
#region [public] {static} (IPropertyKey) TimerInterval: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of minutes to use for the watchdog timer If the timer is not reset within this interval, the system reset timeout begins.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemReset"/></description></item>
/// <item><description>Property: <see cref="SmbiosType023Property.TimerInterval"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey TimerInterval => new PropertyKey(SmbiosStructure.SystemReset, SmbiosType023Property.TimerInterval);
#endregion
#region [public] {static} (IPropertyKey) Timeout: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Number of minutes before the reboot is initiated. It is used after a system power cycle, system reset (local or remote),
/// and automatic system reset
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemReset"/></description></item>
/// <item><description>Property: <see cref="SmbiosType023Property.Timeout"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Timeout => new PropertyKey(SmbiosStructure.SystemReset, SmbiosType023Property.Timeout);
#endregion
#region nested classes
#region [public] {static} (class) Capabilities: Contains the key definition for the 'Capabilities' section.
/// <summary>
/// Contains the key definition for the <b>Capabilities</b> section.
/// </summary>
public static class Capabilities
{
#region [public] {static} (IPropertyKey) BootOption: Gets a value representing the key to retrieve the property value.
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Returns the action to be taken after a watchdog restart.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemReset"/></description></item>
/// <item><description>Property: <see cref="SmbiosType023Property.BootOption"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey BootOption => new PropertyKey(SmbiosStructure.SystemReset, SmbiosType023Property.BootOption);
#endregion
#region [public] {static} (IPropertyKey) BootOptionOnLimit: Gets a value representing the key to retrieve the property value.
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Returns to the action that will be taken when the restart limit is reached.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemReset"/></description></item>
/// <item><description>Property: <see cref="SmbiosType023Property.BootOptionOnLimit"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey BootOptionOnLimit => new PropertyKey(SmbiosStructure.SystemReset, SmbiosType023Property.BootOptionOnLimit);
#endregion
#region [public] {static} (IPropertyKey) Status: Gets a value representing the key to retrieve the property value.
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies whether (enabled) or not (disabled) the system reset by the user.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemReset"/></description></item>
/// <item><description>Property: <see cref="SmbiosType023Property.Status"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Status => new PropertyKey(SmbiosStructure.SystemReset, SmbiosType023Property.Status);
#endregion
#region [public] {static} (IPropertyKey) WatchdogTimer: Gets a value representing the key to retrieve the property value.
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates whether the system contains a watchdog timer.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemReset"/></description></item>
/// <item><description>Property: <see cref="SmbiosType023Property.WatchdogTimer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey WatchdogTimer => new PropertyKey(SmbiosStructure.SystemReset, SmbiosType023Property.WatchdogTimer);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) HardwareSecurity: Contains the key definitions available for a type 024 [Hardware Security] structure
/// <summary>
/// Contains the key definitions available for a type 024 [<see cref="SmbiosStructure.HardwareSecurity"/>] structure.
/// </summary>
public static class HardwareSecurity
{
#region nested classes
#region [public] {static} (class) HardwareSecuritySettings: Contains the key definition for the 'HardwareSecuritySettings' section
/// <summary>
/// Contains the key definition for the <b>HardwareSecuritySettings</b> section.
/// </summary>
public static class HardwareSecuritySettings
{
#region [public] {static} (IPropertyKey) AdministratorPasswordStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Returns current administrator password status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.HardwareSecurity"/></description></item>
/// <item><description>Property: <see cref="SmbiosType024Property.AdministratorPasswordStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey AdministratorPasswordStatus => new PropertyKey(SmbiosStructure.HardwareSecurity, SmbiosType024Property.AdministratorPasswordStatus);
#endregion
#region [public] {static} (IPropertyKey) FrontPanelResetStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Returns current front panel reset status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.HardwareSecurity"/></description></item>
/// <item><description>Property: <see cref="SmbiosType024Property.FrontPanelResetStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey FrontPanelResetStatus => new PropertyKey(SmbiosStructure.HardwareSecurity, SmbiosType024Property.FrontPanelResetStatus);
#endregion
#region [public] {static} (IPropertyKey) KeyboardPasswordStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Returns current keyboard password status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.HardwareSecurity"/></description></item>
/// <item><description>Property: <see cref="SmbiosType024Property.KeyboardPasswordStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey KeyboardPasswordStatus => new PropertyKey(SmbiosStructure.HardwareSecurity, SmbiosType024Property.KeyboardPasswordStatus);
#endregion
#region [public] {static} (IPropertyKey) PowerOnPasswordStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Returns current power on password status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.HardwareSecurity"/></description></item>
/// <item><description>Property: <see cref="SmbiosType024Property.PowerOnPasswordStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey PowerOnPasswordStatus => new PropertyKey(SmbiosStructure.HardwareSecurity, SmbiosType024Property.PowerOnPasswordStatus);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) HardwareSecurity: Contains the key definitions available for a type 025 [System Power Controls] structure
/// <summary>
/// Contains the key definitions available for a type 025 [<see cref="SmbiosStructure.SystemPowerControls"/>] structure.
/// </summary>
public static class SystemPowerControls
{
#region [public] {static} (IPropertyKey) Month: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>BCD value of the month on which the next scheduled power-on is to occur, in the range 01h to 12h.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerControls"/></description></item>
/// <item><description>Property: <see cref="SmbiosType025Property.Month"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey Month => new PropertyKey(SmbiosStructure.SystemPowerControls, SmbiosType025Property.Month);
#endregion
#region [public] {static} (IPropertyKey) Day: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>BCD value of the day-of-month on which the next scheduled power-on is to occur, in the range 01h to 31h.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerControls"/></description></item>
/// <item><description>Property: <see cref="SmbiosType025Property.Day"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey Day => new PropertyKey(SmbiosStructure.SystemPowerControls, SmbiosType025Property.Day);
#endregion
#region [public] {static} (IPropertyKey) Hour: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>BCD value of the hour on which the next scheduled poweron is to occur, in the range 00h to 23h.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerControls"/></description></item>
/// <item><description>Property: <see cref="SmbiosType025Property.Hour"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey Hour => new PropertyKey(SmbiosStructure.SystemPowerControls, SmbiosType025Property.Hour);
#endregion
#region [public] {static} (IPropertyKey) Minute: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>BCD value of the minute on which the next scheduled power-on is to occur, in the range 00h to 59h.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerControls"/></description></item>
/// <item><description>Property: <see cref="SmbiosType025Property.Minute"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey Minute => new PropertyKey(SmbiosStructure.SystemPowerControls, SmbiosType025Property.Minute);
#endregion
#region [public] {static} (IPropertyKey) Second: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>BCD value of the second on which the next scheduled power-on is to occur, in the range 00h to 59h.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerControls"/></description></item>
/// <item><description>Property: <see cref="SmbiosType025Property.Second"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey Second => new PropertyKey(SmbiosStructure.SystemPowerControls, SmbiosType025Property.Second);
#endregion
}
#endregion
#region [public] {static} (class) VoltageProbe: Contains the key definitions available for a type 026 [Voltage Probe] structure
/// <summary>
/// Contains the key definitions available for a type 026 [<see cref="SmbiosStructure.VoltageProbe"/>] structure.
/// </summary>
public static class VoltageProbe
{
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains additional descriptive information about the probe or its location.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType026Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(SmbiosStructure.VoltageProbe, SmbiosType026Property.Description);
#endregion
#region [public] {static} (IPropertyKey) MaximumValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Maximum voltage level readable by this probe, in millivolts.
/// If the value is unknown, the field is set to 0x8000.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType026Property.MaximumValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mV"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey MaximumValue => new PropertyKey(SmbiosStructure.VoltageProbe, SmbiosType026Property.MaximumValue, PropertyUnit.mV);
#endregion
#region [public] {static} (IPropertyKey) MinimumValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Minimum voltage level readable by this probe, in millivolts.
/// If the value is unknown, the field is set to 0x8000.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType026Property.MinimumValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mV"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey MinimumValue => new PropertyKey(SmbiosStructure.VoltageProbe, SmbiosType026Property.MinimumValue, PropertyUnit.mV);
#endregion
#region [public] {static} (IPropertyKey) Resolution: Gets a value representing the key to retrieve the property value.
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Resolution for the probe’s reading, in tenths of millivolts.
/// If the value is unknown, the field is set to 0x8000.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType026Property.Resolution"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.d_mV"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Resolution => new PropertyKey(SmbiosStructure.VoltageProbe, SmbiosType026Property.Resolution, PropertyUnit.mV);
#endregion
#region [public] {static} (IPropertyKey) Tolerance: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Tolerance for reading from this probe, in plus/minus millivolts.
/// If the value is unknown, the field is set to 0x8000.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType026Property.Resolution"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mV"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Tolerance => new PropertyKey(SmbiosStructure.VoltageProbe, SmbiosType026Property.Tolerance, PropertyUnit.mV);
#endregion
#region [public] {static} (IPropertyKey) Accuracy: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Accuracy for reading from this probe, in plus/minus 1/100th of a percent.
/// If the value is unknown, the field is set to 0x8000.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType026Property.Accuracy"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Percent_1_100th"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Accuracy => new PropertyKey(SmbiosStructure.VoltageProbe, SmbiosType026Property.Accuracy, PropertyUnit.Percent_1_100th);
#endregion
#region [public] {static} (IPropertyKey) OemDefined: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>OEM or BIOS vendor-specific information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType026Property.OemDefined"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// </summary>
public static IPropertyKey OemDefined => new PropertyKey(SmbiosStructure.VoltageProbe, SmbiosType026Property.OemDefined);
#endregion
#region [public] {static} (IPropertyKey) NominalValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Nominal value for the probe’s reading in millivolts.
/// If the value is unknown, the field is set to 0x8000.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType026Property.NominalValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Percent_1_100th"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey NominalValue => new PropertyKey(SmbiosStructure.VoltageProbe, SmbiosType026Property.NominalValue, PropertyUnit.mV);
#endregion
#region nested classes
#region [public] {static} (class) LocationAndStatus: Contains the key definition for the 'Location And Status' section
/// <summary>
/// Contains the key definition for the <b>Location And Status</b> section.
/// </summary>
public static class LocationAndStatus
{
#region [public] {static} (IPropertyKey) Location: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Probe’s physical location of the voltage monitored by this voltage probe.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType026Property.Location"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Location => new PropertyKey(SmbiosStructure.VoltageProbe, SmbiosType026Property.Location);
#endregion
#region [public] {static} (IPropertyKey) Status: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Probe’s physical status of the voltage monitored by this voltage probe.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType026Property.Status"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Status => new PropertyKey(SmbiosStructure.VoltageProbe, SmbiosType026Property.Status);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) CoolingDevice: Contains the key definitions available for a type 027 [Cooling Device] structure
/// <summary>
/// Contains the key definitions available for a type 027 [<see cref="SmbiosStructure.CoolingDevice"/>] structure.
/// </summary>
public static class CoolingDevice
{
#region version 2.2+
#region [public] {static} (IPropertyKey) TemperatureProbeHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, of the temperature probe monitoring this cooling device</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.CoolingDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType027Property.TemperatureProbeHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.2+</para>
/// </para>
/// </summary>
public static IPropertyKey TemperatureProbeHandle => new PropertyKey(SmbiosStructure.CoolingDevice, SmbiosType027Property.TemperatureProbeHandle);
#endregion
#region [public] {static} (IPropertyKey) CoolingUnitGroup: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Cooling unit group to which this cooling device is associated.
/// Having multiple cooling devices in the same cooling unit implies a redundant configuration.
/// The value is 00h if the cooling device is not a member of a redundant cooling unit.Non-zero values imply
/// redundancy and that at least one other cooling device will be enumerated with the same value.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.CoolingDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType027Property.CoolingUnitGroup"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.2+</para>
/// </para>
/// </summary>
public static IPropertyKey CoolingUnitGroup => new PropertyKey(SmbiosStructure.CoolingDevice, SmbiosType027Property.CoolingUnitGroup);
#endregion
#region [public] {static} (IPropertyKey) OemDefined: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>OEM or BIOS vendor-specific information,</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.CoolingDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType027Property.OemDefined"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.2+</para>
/// </para>
/// </summary>
public static IPropertyKey OemDefined => new PropertyKey(SmbiosStructure.CoolingDevice, SmbiosType027Property.OemDefined);
#endregion
#region [public] {static} (IPropertyKey) NominalSpeed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Nominal value for the cooling device’s rotational speed, in revolutions-per-minute (rpm).
/// If the value is unknown or the cooling device is non-rotating, the field is set to 0x8000.
/// This field is present in the structure only if the structure’s length is larger than 0Ch.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.CoolingDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType027Property.NominalSpeed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.RPM"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.2+</para>
/// </para>
/// </summary>
public static IPropertyKey NominalSpeed => new PropertyKey(SmbiosStructure.CoolingDevice, SmbiosType027Property.NominalSpeed, PropertyUnit.RPM);
#endregion
#endregion
#region version 2.7+
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Contains additional descriptive information about the cooling device or its location.
/// Is present in the structure only if the structure’s length is 0Fh or larger.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.CoolingDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType027Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(SmbiosStructure.CoolingDevice, SmbiosType027Property.Description);
#endregion
#endregion
#region nested classes
#region [public] {static} (class) DeviceTypeAndStatus: Contains the key definition for the 'Device Type And Status' section
/// <summary>
/// Contains the key definition for the <b>Device Type And Status</b> section.
/// </summary>
public static class DeviceTypeAndStatus
{
#region [public] {static} (IPropertyKey) DeviceType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Cooling device type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.CoolingDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType027Property.DeviceType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey DeviceType => new PropertyKey(SmbiosStructure.CoolingDevice, SmbiosType027Property.DeviceType);
#endregion
#region [public] {static} (IPropertyKey) Status: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Cooling device status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.CoolingDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType027Property.Status"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey Status => new PropertyKey(SmbiosStructure.CoolingDevice, SmbiosType027Property.Status);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) TemperatureProbe: Contains the key definitions available for a type 028 [Temperature Probe] structure
/// <summary>
/// Contains the key definitions available for a type 028 [<see cref="SmbiosStructure.TemperatureProbe"/>] structure.
/// </summary>
public static class TemperatureProbe
{
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains additional descriptive information about the probe or its location.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType028Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(SmbiosStructure.TemperatureProbe, SmbiosType028Property.Description);
#endregion
#region [public] {static} (IPropertyKey) MaximumValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Maximum temperature readable by this probe, in 1/10th ºC.
/// If the value is unknown, the field is set to 0x8000.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType028Property.MaximumValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.DegreeCentigrade"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey MaximumValue => new PropertyKey(SmbiosStructure.TemperatureProbe, SmbiosType028Property.MaximumValue, PropertyUnit.DegreeCentigrade);
#endregion
#region [public] {static} (IPropertyKey) MinimumValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Minimum temperature readable by this probe, in 1/10th ºC.
/// If the value is unknown, the field is set to 0x8000.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType028Property.MinimumValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.DegreeCentigrade"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey MinimumValue => new PropertyKey(SmbiosStructure.TemperatureProbe, SmbiosType028Property.MinimumValue, PropertyUnit.DegreeCentigrade);
#endregion
#region [public] {static} (IPropertyKey) Resolution: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Resolution for the probe’s reading, in 1/1000th ºC.
/// If the value is unknown, the field is set to 0x8000.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType028Property.Resolution"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.DegreeCentigrade"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Resolution => new PropertyKey(SmbiosStructure.TemperatureProbe, SmbiosType028Property.Resolution, PropertyUnit.DegreeCentigrade);
#endregion
#region [public] {static} (IPropertyKey) Tolerance: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Tolerance for reading from this probe, in plus/minus 1/10th ºC.
/// If the value is unknown, the field is set to 0x8000.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType028Property.Tolerance"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.DegreeCentigrade"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Tolerance => new PropertyKey(SmbiosStructure.TemperatureProbe, SmbiosType028Property.Tolerance, PropertyUnit.DegreeCentigrade);
#endregion
#region [public] {static} (IPropertyKey) Accuracy: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Accuracy for reading from this probe, in plus/minus 1/100th of a percent.
/// If the value is unknown, the field is set to 0x8000.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType028Property.Accuracy"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Percent_1_100th"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Accuracy => new PropertyKey(SmbiosStructure.TemperatureProbe, SmbiosType028Property.Accuracy, PropertyUnit.Percent_1_100th);
#endregion
#region [public] {static} (IPropertyKey) OemDefined: Gets a value representing the key to retrieve the property value.
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>OEM or BIOS vendor-specific information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType028Property.OemDefined"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// </summary>
public static IPropertyKey OemDefined => new PropertyKey(SmbiosStructure.TemperatureProbe, SmbiosType028Property.OemDefined);
#endregion
#region [public] {static} (IPropertyKey) NominalValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Nominal value for the probe’s reading in 1/10th degrees ºC.
/// If the value is unknown, the field is set to 0x8000.
/// Is present only if the structure’s Length is larger than 14h.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType028Property.NominalValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.DegreeCentigrade"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey NominalValue => new PropertyKey(SmbiosStructure.TemperatureProbe, SmbiosType028Property.NominalValue, PropertyUnit.DegreeCentigrade);
#endregion
#region nested classes
#region [public] {static} (class) LocationAndStatus: Contains the key definition for the 'Location And Status' section
/// <summary>
/// Contains the key definition for the <b>Location And Status</b> section.
/// </summary>
public static class LocationAndStatus
{
#region [public] {static} (IPropertyKey) Location: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Probe’s physical location of the temperature monitored by this temperature probe.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType028Property.Location"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Location => new PropertyKey(SmbiosStructure.TemperatureProbe, SmbiosType028Property.Location);
#endregion
#region [public] {static} (IPropertyKey) Status: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Probe’s physical status of the temperature monitored by this temperature probe.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType028Property.Status"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Status => new PropertyKey(SmbiosStructure.TemperatureProbe, SmbiosType028Property.Status);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) ElectricalCurrentProbe: Contains the key definitions available for a type 029 [Electrical Current Probe] structure
/// <summary>
/// Contains the key definitions available for a type 029 [<see cref="SmbiosStructure.ElectricalCurrentProbe"/>] structure.
/// </summary>
public static class ElectricalCurrentProbe
{
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains additional descriptive information about the probe or its location.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType029Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(SmbiosStructure.ElectricalCurrentProbe, SmbiosType029Property.Description);
#endregion
#region [public] {static} (IPropertyKey) MaximumValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Maximum current readable by this probe, in milliamps.
/// If the value is unknown, the field is set to 0x8000.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType029Property.MaximumValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mA"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey MaximumValue => new PropertyKey(SmbiosStructure.ElectricalCurrentProbe, SmbiosType029Property.MaximumValue, PropertyUnit.mA);
#endregion
#region [public] {static} (IPropertyKey) MinimumValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Minimun current readable by this probe, in milliamps.
/// If the value is unknown, the field is set to 0x8000.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType029Property.MinimumValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mA"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey MinimumValue => new PropertyKey(SmbiosStructure.ElectricalCurrentProbe, SmbiosType029Property.MinimumValue, PropertyUnit.mA);
#endregion
#region [public] {static} (IPropertyKey) Resolution: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Resolution for the probe’s reading, in tenths of milliamps.
/// If the value is unknown, the field is set to 0x8000.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType029Property.Resolution"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mA"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Resolution => new PropertyKey(SmbiosStructure.ElectricalCurrentProbe, SmbiosType029Property.Resolution, PropertyUnit.mA);
#endregion
#region [public] {static} (IPropertyKey) Tolerance: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Tolerance for reading from this probe, in plus/minus milliamps.
/// If the value is unknown, the field is set to 0x8000.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType029Property.Tolerance"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mA"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Tolerance => new PropertyKey(SmbiosStructure.TemperatureProbe, SmbiosType029Property.Tolerance, PropertyUnit.mA);
#endregion
#region [public] {static} (IPropertyKey) Accuracy: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Accuracy for reading from this probe, in plus/minus 1/100th of a percent.
/// If the value is unknown, the field is set to 0x8000.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType029Property.Accuracy"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Percent_1_100th"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Accuracy => new PropertyKey(SmbiosStructure.ElectricalCurrentProbe, SmbiosType029Property.Accuracy, PropertyUnit.Percent_1_100th);
#endregion
#region [public] {static} (IPropertyKey) OemDefined: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>OEM or BIOS vendor-specific information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType029Property.OemDefined"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// </summary>
public static IPropertyKey OemDefined => new PropertyKey(SmbiosStructure.ElectricalCurrentProbe, SmbiosType029Property.OemDefined);
#endregion
#region [public] {static} (IPropertyKey) NominalValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Nominal value for the probe’s reading in milliamps.
/// If the value is unknown, the field is set to 0x8000.
/// Is present only if the structure’s Length is larger than 14h.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType029Property.NominalValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mA"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey NominalValue => new PropertyKey(SmbiosStructure.ElectricalCurrentProbe, SmbiosType029Property.NominalValue, PropertyUnit.mA);
#endregion
#region nested classes
#region nested classes
#region [public] {static} (class) LocationAndStatus: Contains the key definition for the 'Location And Status' section
/// <summary>
/// Contains the key definition for the <b>Location And Status</b> section.
/// </summary>
public static class LocationAndStatus
{
#region [public] {static} (IPropertyKey) Location: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Probe’s physical location of the current monitored by this current probe.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType029Property.Location"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Location => new PropertyKey(SmbiosStructure.ElectricalCurrentProbe, SmbiosType029Property.Location);
#endregion
#region [public] {static} (IPropertyKey) Status: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Probe’s physical status of the current monitored by this current probe.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="SmbiosType029Property.Status"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Status => new PropertyKey(SmbiosStructure.ElectricalCurrentProbe, SmbiosType029Property.Status);
#endregion
}
#endregion
#endregion
#endregion
}
#endregion
#region [public] {static} (class) OutOfBandRemote: Contains the key definitions available for a type 030 [Out-of-Band Remote Access] structure
/// <summary>
/// Contains the key definitions available for a type 030 [<see cref="SmbiosStructure.OutOfBandRemote"/>] structure.
/// </summary>
public static class OutOfBandRemote
{
#region [public] {static} (IPropertyKey) ManufacturerName: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains the manufacturer of the out-of-band access facility.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.OutOfBandRemote"/></description></item>
/// <item><description>Property: <see cref="SmbiosType030Property.ManufacturerName"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Manufacturer => new PropertyKey(SmbiosStructure.OutOfBandRemote, SmbiosType030Property.ManufacturerName);
#endregion
#region nested classes
#region [public] {static} (class) Connections: Contains the key definition for the 'Connections And Status' section
/// <summary>
/// Contains the key definition for the <b>Connections And Status</b> section.
/// </summary>
public static class Connections
{
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates whether is allowed to initiate outbound connections to contact an alert management facility when critical conditions occur.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.OutOfBandRemote"/></description></item>
/// <item><description>Property: <see cref="SmbiosType030Property.OutBoundConnection"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey OutBoundConnection => new PropertyKey(SmbiosStructure.OutOfBandRemote, SmbiosType030Property.OutBoundConnection);
#endregion
#region [public] {static} (IPropertyKey) InBoundConnection: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates whether is allowed to initiate outbound connections to receive incoming connections for the purpose of remote operations or problem management.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.OutOfBandRemote"/></description></item>
/// <item><description>Property: <see cref="SmbiosType030Property.InBoundConnection"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey InBoundConnection => new PropertyKey(SmbiosStructure.OutOfBandRemote, SmbiosType030Property.InBoundConnection);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) BootIntegrityServicesEntryPoint: Contains the key definitions available for a type 031 [Boot Integrity Services (BIS) Entry Point] structure
/// <summary>
/// Contains the key definitions available for a type 031 [<see cref="SmbiosStructure.BootIntegrityServicesEntryPoint"/>] structure.
/// </summary>
public static class BootIntegrityServicesEntryPoint
{
#region [public] {static} (IPropertyKey) Checksum: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Checksum.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BootIntegrityServicesEntryPoint"/></description></item>
/// <item><description>Property: <see cref="SmbiosType031Property.Checksum"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey Checksum => new PropertyKey(SmbiosStructure.BootIntegrityServicesEntryPoint, SmbiosType031Property.Checksum);
#endregion
#region [public] {static} (IPropertyKey) BisEntryPointAddress16: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Entry point address bis 16bits.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BootIntegrityServicesEntryPoint"/></description></item>
/// <item><description>Property: <see cref="SmbiosType031Property.BisEntryPointAddress16"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey BisEntryPointAddress16 => new PropertyKey(SmbiosStructure.BootIntegrityServicesEntryPoint, SmbiosType031Property.BisEntryPointAddress16);
#endregion
#region [public] {static} (IPropertyKey) BisEntryPointAddress32: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Entry point address bis 32bits.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BootIntegrityServicesEntryPoint"/></description></item>
/// <item><description>Property: <see cref="SmbiosType031Property.BisEntryPointAddress32"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey BisEntryPointAddress32 => new PropertyKey(SmbiosStructure.BootIntegrityServicesEntryPoint, SmbiosType031Property.BisEntryPointAddress32);
#endregion
}
#endregion
#region [public] {static} (class) SystemBoot: Contains the key definitions available for a type 032 [System Boot Information] structure
/// <summary>
/// Contains the key definitions available for a type 032 [<see cref="SmbiosStructure.SystemBoot"/> Information] structure.
/// </summary>
public static class SystemBoot
{
#region [public] {static} (IPropertyKey) Reserved: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Reserved for future assignment by this specification; all bytes are set to 00h.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemBoot"/></description></item>
/// <item><description>Property: <see cref="SmbiosType032Property.Reserved"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Reserved => new PropertyKey(SmbiosStructure.SystemBoot, SmbiosType032Property.Reserved);
#endregion
#region [public] {static} (IPropertyKey) BootStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Status and additional data fields that identify the boot status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemBoot"/></description></item>
/// <item><description>Property: <see cref="SmbiosType032Property.BootStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey BootStatus => new PropertyKey(SmbiosStructure.SystemBoot, SmbiosType032Property.BootStatus);
#endregion
}
#endregion
#region [public] {static} (class) BitMemoryError64: Contains the key definitions available for a type 033 [64-Bit Memory Error Information] structure
/// <summary>
/// Contains the key definitions available for a type 033 [<see cref="SmbiosStructure.BitMemoryError64"/>] structure.
/// </summary>
public static class BitMemoryError64
{
#region [public] {static} (IPropertyKey) ErrorType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Type of error that is associated with the current status reported for the memory array or device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BitMemoryError64"/></description></item>
/// <item><description>Property: <see cref="SmbiosType033Property.ErrorType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ErrorType => new PropertyKey(SmbiosStructure.BitMemoryError64, SmbiosType033Property.ErrorType);
#endregion
#region [public] {static} (IPropertyKey) ErrorGranularity: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Granularity (for example, device versus Partition) to which the error can be resolved.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BitMemoryError64"/></description></item>
/// <item><description>Property: <see cref="SmbiosType033Property.ErrorGranularity"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ErrorGranularity => new PropertyKey(SmbiosStructure.BitMemoryError64, SmbiosType033Property.ErrorGranularity);
#endregion
#region [public] {static} (IPropertyKey) ErrorOperation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Memory access operation that caused the error.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BitMemoryError64"/></description></item>
/// <item><description>Property: <see cref="SmbiosType033Property.ErrorOperation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ErrorOperation => new PropertyKey(SmbiosStructure.BitMemoryError64, SmbiosType033Property.ErrorOperation);
#endregion
#region [public] {static} (IPropertyKey) VendorSyndrome: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Vendor-specific ECC syndrome or CRC data associated with the erroneous access.
/// If the value is unknown, this field contains 0000 0000h.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BitMemoryError64"/></description></item>
/// <item><description>Property: <see cref="SmbiosType033Property.VendorSyndrome"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// </summary>
public static IPropertyKey VendorSyndrome => new PropertyKey(SmbiosStructure.BitMemoryError64, SmbiosType033Property.VendorSyndrome);
#endregion
#region [public] {static} (IPropertyKey) MemoryArrayErrorAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// 64-bit physical address of the error based on the addressing of the bus to which the memory array is connected.
/// If the address is unknown, this field contains 8000 0000 0000 0000h.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BitMemoryError64"/></description></item>
/// <item><description>Property: <see cref="SmbiosType033Property.MemoryArrayErrorAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// </summary>
public static IPropertyKey MemoryArrayErrorAddress => new PropertyKey(SmbiosStructure.BitMemoryError64, SmbiosType033Property.MemoryArrayErrorAddress);
#endregion
#region [public] {static} (IPropertyKey) DeviceErrorAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// 64-bit physical address of the error relative to the start of the failing memory device, in bytes.
/// If the address is unknown, this field contains 8000 0000 0000 0000h.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BitMemoryError64"/></description></item>
/// <item><description>Property: <see cref="SmbiosType033Property.DeviceErrorAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// </summary>
public static IPropertyKey DeviceErrorAddress => new PropertyKey(SmbiosStructure.BitMemoryError64, SmbiosType033Property.DeviceErrorAddress);
#endregion
#region [public] {static} (IPropertyKey) ErrorResolution: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Range, in bytes, within which the error can be determined, when an error address is given.
/// If the range is unknown, this field contains 8000 0000h.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.BitMemoryError64"/></description></item>
/// <item><description>Property: <see cref="SmbiosType033Property.ErrorResolution"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// </summary>
public static IPropertyKey ErrorResolution => new PropertyKey(SmbiosStructure.BitMemoryError64, SmbiosType033Property.ErrorResolution);
#endregion
}
#endregion
#region [public] {static} (class) ManagementDevice: Contains the key definitions available for a type 034 [Management Device] structure
/// <summary>
/// Contains the key definitions available for a type 034 [<see cref="SmbiosStructure.ManagementDevice"/>] structure.
/// </summary>
public static class ManagementDevice
{
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains additional descriptive information about the device or its location.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType034Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(SmbiosStructure.ManagementDevice, SmbiosType034Property.Description);
#endregion
#region [public] {static} (IPropertyKey) Type: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Device’s type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType034Property.Type"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Type => new PropertyKey(SmbiosStructure.ManagementDevice, SmbiosType034Property.Type);
#endregion
#region [public] {static} (IPropertyKey) Address: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Device’s address.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType034Property.Address"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Address => new PropertyKey(SmbiosStructure.ManagementDevice, SmbiosType034Property.Address);
#endregion
#region [public] {static} (IPropertyKey) AddressType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Type of addressing used to access the device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType034Property.AddressType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey AddressType => new PropertyKey(SmbiosStructure.ManagementDevice, SmbiosType034Property.AddressType);
#endregion
}
#endregion
#region [public] {static} (class) ManagementDeviceComponent: Contains the key definitions available for a type 035 [Management Device Component] structure
/// <summary>
/// Contains the key definitions available for a type 035 [<see cref="SmbiosStructure.ManagementDeviceComponent"/>] structure.
/// </summary>
public static class ManagementDeviceComponent
{
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains additional descriptive information about the component.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType035Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(SmbiosStructure.ManagementDeviceComponent, SmbiosType035Property.Description);
#endregion
#region [public] {static} (IPropertyKey) ManagementDeviceHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, of the Management Device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType035Property.ManagementDeviceHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey ManagementDeviceHandle => new PropertyKey(SmbiosStructure.ManagementDeviceComponent, SmbiosType035Property.ManagementDeviceHandle);
#endregion
#region [public] {static} (IPropertyKey) ComponentHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, of the probe or cooling device that defines this component.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType035Property.ComponentHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey ComponentHandle => new PropertyKey(SmbiosStructure.ManagementDeviceComponent, SmbiosType035Property.ComponentHandle);
#endregion
#region [public] {static} (IPropertyKey) ThresholdHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Contains additional descriptive information about the component.
/// A value of 0FFFFh indicates that no Threshold Data structure is associated with this component.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType035Property.ThresholdHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey ThresholdHandle => new PropertyKey(SmbiosStructure.ManagementDeviceComponent, SmbiosType035Property.ThresholdHandle);
#endregion
}
#endregion
#region [public] {static} (class) ManagementDeviceThresholdData: Contains the key definitions available for a type 036 [Management Device Threshold Data] structure
/// <summary>
/// Contains the key definitions available for a type 036 [<see cref="SmbiosStructure.ManagementDeviceThresholdData"/>] structure.
/// </summary>
public static class ManagementDeviceThresholdData
{
#region [public] {static} (IPropertyKey) LowerNonCritical: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Lower non-critical threshold for this component.
/// If the value is unavailable, the field is set to 0x8000
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementDeviceThresholdData"/></description></item>
/// <item><description>Property: <see cref="SmbiosType036Property.LowerNonCritical"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey LowerNonCritical => new PropertyKey(SmbiosStructure.ManagementDeviceThresholdData, SmbiosType036Property.LowerNonCritical);
#endregion
#region [public] {static} (IPropertyKey) UpperNonCritical: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Upper non-critical threshold for this component.
/// If the value is unavailable, the field is set to 0x8000
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementDeviceThresholdData"/></description></item>
/// <item><description>Property: <see cref="SmbiosType036Property.UpperNonCritical"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey UpperNonCritical => new PropertyKey(SmbiosStructure.ManagementDeviceThresholdData, SmbiosType036Property.UpperNonCritical);
#endregion
#region [public] {static} (IPropertyKey) LowerCritical: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Lower critical threshold for this component.
/// If the value is unavailable, the field is set to 0x8000
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementDeviceThresholdData"/></description></item>
/// <item><description>Property: <see cref="SmbiosType036Property.LowerCritical"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey LowerCritical => new PropertyKey(SmbiosStructure.ManagementDeviceThresholdData, SmbiosType036Property.LowerCritical);
#endregion
#region [public] {static} (IPropertyKey) UpperCritical: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Upper critical threshold for this component.
/// If the value is unavailable, the field is set to 0x8000
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementDeviceThresholdData"/></description></item>
/// <item><description>Property: <see cref="SmbiosType036Property.UpperCritical"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey UpperCritical => new PropertyKey(SmbiosStructure.ManagementDeviceThresholdData, SmbiosType036Property.UpperCritical);
#endregion
#region [public] {static} (IPropertyKey) LowerNonRecoverable: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Lower non-recoverable threshold for this component.
/// If the value is unavailable, the field is set to 0x8000
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementDeviceThresholdData"/></description></item>
/// <item><description>Property: <see cref="SmbiosType036Property.LowerNonRecoverable"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey LowerNonRecoverable => new PropertyKey(SmbiosStructure.ManagementDeviceThresholdData, SmbiosType036Property.LowerNonRecoverable);
#endregion
#region [public] {static} (IPropertyKey) UpperNonRecoverable: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Upper non-recoverable threshold for this component.
/// If the value is unavailable, the field is set to 0x8000
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementDeviceThresholdData"/></description></item>
/// <item><description>Property: <see cref="SmbiosType036Property.UpperNonRecoverable"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey UpperNonRecoverable => new PropertyKey(SmbiosStructure.ManagementDeviceThresholdData, SmbiosType036Property.UpperNonRecoverable);
#endregion
}
#endregion
#region [public] {static} (class) MemoryChannel: Contains the key definitions available for a type 037 [Memory Channel] structure
/// <summary>
/// Contains the key definitions available for a type 037 [<see cref="SmbiosStructure.MemoryChannel"/>] structure.
/// </summary>
public static class MemoryChannel
{
#region [public] {static} (IPropertyKey) ChannelType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Type of memory associated with the channel.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryChannel"/></description></item>
/// <item><description>Property: <see cref="SmbiosType037Property.ChannelType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ChannelType => new PropertyKey(SmbiosStructure.MemoryChannel, SmbiosType037Property.ChannelType);
#endregion
#region [public] {static} (IPropertyKey) MaximumChannelLoad: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Maximum load supported by the channel; the sum of all device loads cannot exceed this value.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryChannel"/></description></item>
/// <item><description>Property: <see cref="SmbiosType037Property.MaximumChannelLoad"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey MaximumChannelLoad => new PropertyKey(SmbiosStructure.MemoryChannel, SmbiosType037Property.MaximumChannelLoad);
#endregion
#region [public] {static} (IPropertyKey) Devices: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Devices collection.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryChannel"/></description></item>
/// <item><description>Property: <see cref="SmbiosType037Property.Devices"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="MemoryChannelElementCollection"/></para>
/// </para>
/// </summary>
public static IPropertyKey Devices => new PropertyKey(SmbiosStructure.MemoryChannel, SmbiosType037Property.Devices);
#endregion
#region nested classes
#region [public] {static} (class) MemoryDevices: Contains the key definition for the 'Memory Devices' section
/// <summary>
/// Contains the key definition for the <b>Memory Devices</b> section.
/// </summary>
public static class MemoryDevices
{
#region [public] {static} (IPropertyKey) Handle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Structure handle that identifies the memory device associated with this channel.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryChannel"/></description></item>
/// <item><description>Property: <see cref="SmbiosType037Property.Handle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Handle => new PropertyKey(SmbiosStructure.MemoryChannel, SmbiosType037Property.Handle);
#endregion
#region [public] {static} (IPropertyKey) Load: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Channel load provided by the memory device associated with this channel.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.MemoryChannel"/></description></item>
/// <item><description>Property: <see cref="SmbiosType037Property.Load"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey Load => new PropertyKey(SmbiosStructure.MemoryChannel, SmbiosType037Property.Load);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) IpmiDevice: Contains the key definitions available for a type 038 [IPMI Device Information] structure
/// <summary>
/// Contains the key definitions available for a type 038 [<see cref="SmbiosStructure.IpmiDevice"/> Information] structure.
/// </summary>
public static class IpmiDevice
{
#region [public] {static} (IPropertyKey) InterfaceType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Baseboard Management Controller (BMC) interface type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType038Property.InterfaceType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey InterfaceType => new PropertyKey(SmbiosStructure.IpmiDevice, SmbiosType038Property.InterfaceType);
#endregion
#region [public] {static} (IPropertyKey) SpecificationRevision: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>IPMI specification revision, in BCD format, to which the BMC was designed.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType038Property.SpecificationRevision"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey SpecificationRevision => new PropertyKey(SmbiosStructure.IpmiDevice, SmbiosType038Property.SpecificationRevision);
#endregion
#region [public] {static} (IPropertyKey) I2CSlaveAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Slave address on the I2C bus of this BMC.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType038Property.I2CSlaveAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey I2CSlaveAddress => new PropertyKey(SmbiosStructure.IpmiDevice, SmbiosType038Property.I2CSlaveAddress);
#endregion
#region [public] {static} (IPropertyKey) NVStorageDeviceAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Bus ID of the NV storage device. If no storage device exists for this BMC, the property is set to 0xFF.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType038Property.NvStorageDeviceAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey NVStorageDeviceAddress => new PropertyKey(SmbiosStructure.IpmiDevice, SmbiosType038Property.NvStorageDeviceAddress);
#endregion
#region [public] {static} (IPropertyKey) BaseAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Base address (either memory-mapped or I/O) of the BMC. If the least-significant bit of the field is a 1,
/// the address is in I/O space; otherwise, the address is memory-mapped.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType038Property.BaseAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// </summary>
public static IPropertyKey BaseAddress => new PropertyKey(SmbiosStructure.IpmiDevice, SmbiosType038Property.BaseAddress);
#endregion
#region [public] {static} (IPropertyKey) InterruptNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Interrupt number for IPMI System Interface.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType038Property.InterruptNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey InterruptNumber => new PropertyKey(SmbiosStructure.IpmiDevice, SmbiosType038Property.InterruptNumber);
#endregion
#region nested classes
#region [public] {static} (class) BaseAdressModifier: Contains the key definition for the 'Base Adress Modifier' section
/// <summary>
/// Contains the key definition for the <b>Base Adress Modifier</b> section.
/// </summary>
public static class BaseAdressModifier
{
#region [public] {static} (IPropertyKey) RegisterSpacing: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Register spacing.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType038Property.RegisterSpacing"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey RegisterSpacing => new PropertyKey(SmbiosStructure.IpmiDevice, SmbiosType038Property.RegisterSpacing);
#endregion
#region [public] {static} (IPropertyKey) LsBit: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>LS-bit for addresses.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType038Property.LsBit"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey LsBit => new PropertyKey(SmbiosStructure.IpmiDevice, SmbiosType038Property.LsBit);
#endregion
}
#endregion
#region [public] {static} (class) Interrupt: Definition of keys for the 'Interrupt' section
/// <summary>
/// Definition of keys for the '<b>Interrupt</b>' section.
/// </summary>
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public static class Interrupt
{
#region [public] {static} (IPropertyKey) Polarity: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Interrupt Polarity.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType038Property.Polarity"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Polarity => new PropertyKey(SmbiosStructure.IpmiDevice, SmbiosType038Property.Polarity);
#endregion
#region [public] {static} (IPropertyKey) SpecifiedInfo: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para> Interrupt information specified.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType038Property.SpecifiedInfo"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey SpecifiedInfo => new PropertyKey(SmbiosStructure.IpmiDevice, SmbiosType038Property.SpecifiedInfo);
#endregion
#region [public] {static} (IPropertyKey) TriggerMode: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Interrupt trigger mode.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType038Property.TriggerMode"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey TriggerMode => new PropertyKey(SmbiosStructure.IpmiDevice, SmbiosType038Property.TriggerMode);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) SystemPowerSupply: Contains the key definitions available for a type 039 [System Power Supply] structure
/// <summary>
/// Contains the key definitions available for a type 039 [<see cref="SmbiosStructure.SystemPowerSupply"/> Information] structure.
/// </summary>
public static class SystemPowerSupply
{
#region [public] {static} (IPropertyKey) IsRedundant: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates whether it is redundant.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.IsRedundant"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey IsRedundant => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.IsRedundant);
#endregion
#region [public] {static} (IPropertyKey) Location: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the location of the power supply.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.Location"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Location => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.Location);
#endregion
#region [public] {static} (IPropertyKey) DeviceName: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Names the power supply device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.DeviceName"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey DeviceName => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.DeviceName);
#endregion
#region [public] {static} (IPropertyKey) Manufacturer: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Names the company that manufactured the supply.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.Manufacturer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Manufacturer => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.Manufacturer);
#endregion
#region [public] {static} (IPropertyKey) SerialNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains the serial number for the power supply.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.SerialNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey SerialNumber => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.SerialNumber);
#endregion
#region [public] {static} (IPropertyKey) AssetTagNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains the asset tag number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.AssetTagNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey AssetTagNumber => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.AssetTagNumber);
#endregion
#region [public] {static} (IPropertyKey) ModelPartNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains the OEM part order number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.ModelPartNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ModelPartNumber => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.ModelPartNumber);
#endregion
#region [public] {static} (IPropertyKey) RevisionLevel: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Power supply revision string.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.RevisionLevel"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey RevisionLevel => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.RevisionLevel);
#endregion
#region [public] {static} (IPropertyKey) MaxPowerCapacity: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Maximum sustained power output in Watts.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.MaxPowerCapacity"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.W"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey MaxPowerCapacity => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.MaxPowerCapacity, PropertyUnit.W);
#endregion
#region [public] {static} (IPropertyKey) InputVoltageProbeHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, of a voltage probe monitoring this power supply’s input voltage.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.InputVoltageProbeHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey InputVoltageProbeHandle => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.InputVoltageProbeHandle);
#endregion
#region [public] {static} (IPropertyKey) CoolingDeviceHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, of a cooling device associated with this power supply</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.CoolingDeviceHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey CoolingDeviceHandle => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.CoolingDeviceHandle);
#endregion
#region [public] {static} (IPropertyKey) InputCurrentProbeHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, of the electrical current probe monitoring this power supply’s input current.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.InputCurrentProbeHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey InputCurrentProbeHandle => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.InputCurrentProbeHandle);
#endregion
#region nested classes
#region [public] {static} (class) Characteristics: Contains the key definition for the 'Characteristics' section.
/// <summary>
/// Contains the key definition for the <b>Characteristics</b> section.
/// </summary>
public static class Characteristics
{
#region [public] {static} (IPropertyKey) InputVoltageRange: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Input voltage range switching.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.InputVoltageRange"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey InputVoltageRange => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.InputVoltageRange);
#endregion
#region [public] {static} (IPropertyKey) IsHotReplaceable: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates whethe power supply is hot-replaceable.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.IsHotReplaceable"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey IsHotReplaceable => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.IsHotReplaceable);
#endregion
#region [public] {static} (IPropertyKey) IsPlugged: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates whethe power supply is plugged.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.IsPlugged"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey IsPlugged => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.IsPlugged);
#endregion
#region [public] {static} (IPropertyKey) IsPresent: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates whethe power supply is present.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.IsPresent"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey IsPresent => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.IsPresent);
#endregion
#region [public] {static} (IPropertyKey) Status: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Power supply status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.Status"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Status => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.Status);
#endregion
#region [public] {static} (IPropertyKey) SupplyType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Power supply type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="SmbiosType039Property.SupplyType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey SupplyType => new PropertyKey(SmbiosStructure.SystemPowerSupply, SmbiosType039Property.SupplyType);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) AdditionalInformation: Contains the key definitions available for a type 040 [Additional Information] structure
/// <summary>
/// Contains the key definitions available for a type 040 [<see cref="SmbiosStructure.AdditionalInformation"/>] structure.
/// </summary>
public static class AdditionalInformation
{
#region [public] {static} (IPropertyKey) Entries: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Collection of additional information entries.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.AdditionalInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType040Property.Entries"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="AdditionalInformationEntryCollection"/></para>
/// </para>
/// </summary>
public static IPropertyKey Entries => new PropertyKey(SmbiosStructure.AdditionalInformation, SmbiosType040Property.Entries);
#endregion
#region nested classes
#region [public] {static} (class) Entry: Contains the key definition for the 'Entry' section
/// <summary>
/// Contains the key definition for the <b>Entry</b> section.
/// </summary>
public static class Entry
{
#region [public] {static} (IPropertyKey) EntryLength: Obtiene un valor que representa la clave para recuperar la propiedad
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Length of this additional information entry instance; a minimum of 6.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.AdditionalInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType040Property.EntryLength"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey EntryLength => new PropertyKey(SmbiosStructure.AdditionalInformation, SmbiosType040Property.EntryLength);
#endregion
#region [public] {static} (IPropertyKey) ReferencedHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with the structure for which additional information is provided.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.AdditionalInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType040Property.ReferencedHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey ReferencedHandle => new PropertyKey(SmbiosStructure.AdditionalInformation, SmbiosType040Property.ReferencedHandle);
#endregion
#region [public] {static} (IPropertyKey) ReferencedOffset: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Offset of the field within the structure referenced by the referenced handle for which additional information is provided.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.AdditionalInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType040Property.ReferencedOffset"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey ReferencedOffset => new PropertyKey(SmbiosStructure.AdditionalInformation, SmbiosType040Property.ReferencedOffset);
#endregion
#region [public] {static} (IPropertyKey) StringValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Optional string to be associated with the field referenced by the referenced offset.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.AdditionalInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType040Property.StringValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey StringValue => new PropertyKey(SmbiosStructure.AdditionalInformation, SmbiosType040Property.StringValue);
#endregion
#region [public] {static} (IPropertyKey) Value: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Enumerated value or updated field content that has not yet been approved for publication in this specification and
/// therefore could not be used in the field referenced by referenced offset.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.AdditionalInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType040Property.Value"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey Value => new PropertyKey(SmbiosStructure.AdditionalInformation, SmbiosType040Property.Value);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) OnBoardDevicesExtended: Contains the key definitions available for a type 041 [OnBoard Devices Extended Information] structure
/// <summary>
/// Contains the key definitions available for a type 041 [<see cref="SmbiosStructure.OnBoardDevicesExtended"/> Information] structure.
/// </summary>
public static class OnBoardDevicesExtended
{
#region [public] {static} (IPropertyKey) ReferenceDesignation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Onboard device reference designation.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.OnBoardDevicesExtended"/></description></item>
/// <item><description>Property: <see cref="SmbiosType041Property.ReferenceDesignation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ReferenceDesignation => new PropertyKey(SmbiosStructure.OnBoardDevicesExtended, SmbiosType041Property.ReferenceDesignation);
#endregion
#region nested classes
#region [public] {static} (class) Element: Contains the key definition for the 'Element' section
/// <summary>
/// Contains the key definition for the <b>Element</b> section.
/// </summary>
public static class Element
{
#region [public] {static} (IPropertyKey) DeviceType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Device type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.OnBoardDevicesExtended"/></description></item>
/// <item><description>Property: <see cref="SmbiosType041Property.DeviceType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey DeviceType => new PropertyKey(SmbiosStructure.OnBoardDevicesExtended, SmbiosType041Property.DeviceType);
#endregion
#region [public] {static} (IPropertyKey) DeviceStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Device status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.OnBoardDevicesExtended"/></description></item>
/// <item><description>Property: <see cref="SmbiosType041Property.DeviceStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey DeviceStatus => new PropertyKey(SmbiosStructure.OnBoardDevicesExtended, SmbiosType041Property.DeviceStatus);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) ManagementControllerHostInterface: Contains the key definitions available for a type 042 [Management Controller Host Interface] structure
/// <summary>
/// Contains the key definitions available for a type 042 [<see cref="SmbiosStructure.ManagementControllerHostInterface"/>] structure.
/// </summary>
public static class ManagementControllerHostInterface
{
#region [public] {static} (IPropertyKey) InterfaceType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Management Controller Interface Type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementControllerHostInterface"/></description></item>
/// <item><description>Property: <see cref="SmbiosType042Property.InterfaceType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey InterfaceType => new PropertyKey(SmbiosStructure.ManagementControllerHostInterface, SmbiosType042Property.InterfaceType);
#endregion
#region [public] {static} (IPropertyKey) InterfaceTypeSpecificData: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Management Controller Interface Type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementControllerHostInterface"/></description></item>
/// <item><description>Property: <see cref="SmbiosType042Property.InterfaceTypeSpecificData"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey InterfaceTypeSpecificData => new PropertyKey(SmbiosStructure.ManagementControllerHostInterface, SmbiosType042Property.InterfaceTypeSpecificData);
#endregion
#region [public] {static} (IPropertyKey) Protocols: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Management Controller Interface Type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementControllerHostInterface"/></description></item>
/// <item><description>Property: <see cref="SmbiosType042Property.Protocols"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ManagementControllerHostInterfaceProtocolRecordsCollection"/></para>
/// </para>
/// </summary>
public static IPropertyKey Protocols => new PropertyKey(SmbiosStructure.ManagementControllerHostInterface, SmbiosType042Property.Protocols);
#endregion
#region nested classes
#region [public] {static} (class) Protocol: Contains the key definition for the 'Protocols' section
/// <summary>
/// Contains the key definition for the <b>Elements</b> section.
/// </summary>
public static class Protocol
{
#region [public] {static} (IPropertyKey) ProtocolType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Management Controller Interface Type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementControllerHostInterface"/></description></item>
/// <item><description>Property: <see cref="SmbiosType042Property.ProtocolType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ProtocolType => new PropertyKey(SmbiosStructure.ManagementControllerHostInterface, SmbiosType042Property.ProtocolType);
#endregion
#region [public] {static} (IPropertyKey) ProtocolTypeSpecificData: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Protocol type specific data.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ManagementControllerHostInterface"/></description></item>
/// <item><description>Property: <see cref="SmbiosType042Property.ProtocolTypeSpecificData"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey ProtocolTypeSpecificData => new PropertyKey(SmbiosStructure.ManagementControllerHostInterface, SmbiosType042Property.ProtocolTypeSpecificData);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) TpmDevice: Contains the key definitions available for a type 043 [TpmDevice] structure
/// <summary>
/// Contains the key definitions available for a type 043 [<see cref="SmbiosStructure.TpmDevice"/>] structure.
/// </summary>
public static class TpmDevice
{
#region [public] {static} (IPropertyKey) VendorId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Specified as four ASCII characters.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TpmDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType043Property.VendorId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey VendorId => new PropertyKey(SmbiosStructure.TpmDevice, SmbiosType043Property.VendorId);
#endregion
#region [public] {static} (IPropertyKey) VendorIdDescription: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Vendor Id description.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TpmDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType043Property.VendorIdDescription"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey VendorIdDescription => new PropertyKey(SmbiosStructure.TpmDevice, SmbiosType043Property.VendorIdDescription);
#endregion
#region [public] {static} (IPropertyKey) MajorSpecVersion: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Major TPM version supported by the TPM device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TpmDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType043Property.MajorSpecVersion"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey MajorSpecVersion => new PropertyKey(SmbiosStructure.TpmDevice, SmbiosType043Property.MajorSpecVersion);
#endregion
#region [public] {static} (IPropertyKey) MinorSpecVersion: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Minor TPM version supported by the TPM device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TpmDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType043Property.MinorSpecVersion"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey MinorSpecVersion => new PropertyKey(SmbiosStructure.TpmDevice, SmbiosType043Property.MinorSpecVersion);
#endregion
#region [public] {static} (IPropertyKey) FirmwareVersion: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>TPM firmware version.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TpmDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType043Property.FirmwareVersion"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="Tpm.TpmFirmwareVersion"/></para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareVersion => new PropertyKey(SmbiosStructure.TpmDevice, SmbiosType043Property.FirmwareVersion);
#endregion
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of descriptive information of the TPM device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TpmDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType043Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(SmbiosStructure.TpmDevice, SmbiosType043Property.Description);
#endregion
#region [public] {static} (IPropertyKey) Characteristics: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>TPM device characteristics information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TpmDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType043Property.Characteristics"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Characteristics => new PropertyKey(SmbiosStructure.TpmDevice, SmbiosType043Property.Characteristics);
#endregion
#region [public] {static} (IPropertyKey) OemDefined: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>OEM- or BIOS vendor-specific information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.TpmDevice"/></description></item>
/// <item><description>Property: <see cref="SmbiosType043Property.OemDefined"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// </summary>
public static IPropertyKey OemDefined => new PropertyKey(SmbiosStructure.TpmDevice, SmbiosType043Property.OemDefined);
#endregion
}
#endregion
#region [public] {static} (class) ProcessorAdditionalInformation: Contains the key definitions available for a type 044 [Processor Additional Information] structure
/// <summary>
/// Contains the key definitions available for a type 044 [<see cref="SmbiosStructure.ProcessorAdditionalInformation"/>] structure.
/// </summary>
public static class ProcessorAdditionalInformation
{
#region [public] {static} (IPropertyKey) VendorId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with the processor structure (Type 004).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ProcessorAdditionalInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType044Property.ReferencedHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.3+</para>
/// </para>
/// </summary>
public static IPropertyKey ReferencedHandle => new PropertyKey(SmbiosStructure.ProcessorAdditionalInformation, SmbiosType044Property.ReferencedHandle);
#endregion
#region [public] {static} (IPropertyKey) ProcessorSpecificBlock: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Processor-specific block.</para>
/// <para>The format of processor-specific data varies between different processor architecture.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.ProcessorAdditionalInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType044Property.ProcessorSpecificBlock"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="Smbios.ProcessorSpecificInformationBlock"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.3+</para>
/// </para>
/// </summary>
public static IPropertyKey ProcessorSpecificBlock => new PropertyKey(SmbiosStructure.ProcessorAdditionalInformation, SmbiosType044Property.ProcessorSpecificBlock);
#endregion
}
#endregion
#region [public] {static} (class) FirmwareInventoryInformation: Contains the key definitions available for a type 045 [Firmware Inventory Information] structure
/// <summary>
/// Contains the key definitions available for a type 045 [<see cref="SmbiosStructure.FirmwareInventoryInformation"/>] structure.
/// </summary>
public static class FirmwareInventoryInformation
{
#region [public] {static} (IPropertyKey) FirmwareComponentName: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of the Firmware Component Name.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType045Property.FirmwareComponentName"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareComponentName => new PropertyKey(SmbiosStructure.FirmwareInventoryInformation, SmbiosType045Property.FirmwareComponentName);
#endregion
#region [public] {static} (IPropertyKey) FirmwareVersion: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of the Firmware Version of this firmware. The format of this value is defined by the Version Format.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType045Property.FirmwareVersion"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareVersion => new PropertyKey(SmbiosStructure.FirmwareInventoryInformation, SmbiosType045Property.FirmwareVersion);
#endregion
#region [public] {static} (IPropertyKey) FirmwareVersionFormat: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Describes the format of the Firmware Version and the Lowest Supported Firmware Version.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType045Property.FirmwareVersionFormat"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareVersionFormat => new PropertyKey(SmbiosStructure.FirmwareInventoryInformation, SmbiosType045Property.FirmwareVersionFormat);
#endregion
#region [public] {static} (IPropertyKey) FirmwareId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of the Firmware ID of this firmware. The format of this value is defined by the Firmware ID Format.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType045Property.FirmwareId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareId => new PropertyKey(SmbiosStructure.FirmwareInventoryInformation, SmbiosType045Property.FirmwareId);
#endregion
#region [public] {static} (IPropertyKey) FirmwareIdFormat: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Describes the format of the Firmware ID.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType045Property.FirmwareIdFormat"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareIdFormat => new PropertyKey(SmbiosStructure.FirmwareInventoryInformation, SmbiosType045Property.FirmwareIdFormat);
#endregion
#region [public] {static} (IPropertyKey) FirmwareReleaseDate: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of the firmware release date. The date string, if supplied, follows the Date-Time values format.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType045Property.FirmwareReleaseDate"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareReleaseDate => new PropertyKey(SmbiosStructure.FirmwareInventoryInformation, SmbiosType045Property.FirmwareReleaseDate);
#endregion
#region [public] {static} (IPropertyKey) FirmwareManufacturer: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of the firmware release date. The date string, if supplied, follows the Date-Time values format.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType045Property.FirmwareManufacturer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareManufacturer => new PropertyKey(SmbiosStructure.FirmwareInventoryInformation, SmbiosType045Property.FirmwareManufacturer);
#endregion
#region [public] {static} (IPropertyKey) LowestSupportedFirmwareVersion: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of the lowest version to which this firmware can be rolled back to. The format of this value is defined by the Version Format.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType045Property.LowestSupportedFirmwareVersion"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey LowestSupportedFirmwareVersion => new PropertyKey(SmbiosStructure.FirmwareInventoryInformation, SmbiosType045Property.LowestSupportedFirmwareVersion);
#endregion
#region [public] {static} (IPropertyKey) FirmwareImageSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Size of the firmware image that is currently programmed in the device, in bytes. If the Firmware Image Size is unknown, the field is set to FFFFFFFFFFFFFFFFh</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType045Property.FirmwareImageSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareImageSize => new PropertyKey(SmbiosStructure.FirmwareInventoryInformation, SmbiosType045Property.FirmwareImageSize, PropertyUnit.Bytes);
#endregion
#region [public] {static} (IPropertyKey) FirmwareCharacteristics: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Firmware characteristics information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType045Property.FirmwareCharacteristics"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareCharacteristics => new PropertyKey(SmbiosStructure.FirmwareInventoryInformation, SmbiosType045Property.FirmwareCharacteristics);
#endregion
#region [public] {static} (IPropertyKey) FirmwareState: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Firmware state information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType045Property.FirmwareState"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareState => new PropertyKey(SmbiosStructure.FirmwareInventoryInformation, SmbiosType045Property.FirmwareState);
#endregion
#region [public] {static} (IPropertyKey) NumberOfAssociatedComponents: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Defines how many Associated Component Handles are associated with this firmware.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType045Property.NumberOfAssociatedComponents"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey NumberOfAssociatedComponents => new PropertyKey(SmbiosStructure.FirmwareInventoryInformation, SmbiosType045Property.NumberOfAssociatedComponents);
#endregion
#region [public] {static} (IPropertyKey) AssociatedComponentHandles: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Lists the <b>SMBIOS</b> structure handles that are associated with this firmware.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="SmbiosType045Property.AssociatedComponentHandles"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey AssociatedComponentHandles => new PropertyKey(SmbiosStructure.FirmwareInventoryInformation, SmbiosType045Property.AssociatedComponentHandles);
#endregion
}
#endregion
#region [public] {static} (class) StringProperty: Contains the key definitions available for a type 046 [String Property] structure
/// <summary>
/// Contains the key definitions available for a type 044 [<see cref="SmbiosStructure.StringProperty"/>] structure.
/// </summary>
public static class StringProperty
{
#region [public] {static} (IPropertyKey) PropertyId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with the processor structure (Type 004).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.StringProperty"/></description></item>
/// <item><description>Property: <see cref="SmbiosType046Property.PropertyId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey PropertyId => new PropertyKey(SmbiosStructure.StringProperty, SmbiosType046Property.PropertyId);
#endregion
#region [public] {static} (IPropertyKey) PropertyValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with the processor structure (Type 004).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.StringProperty"/></description></item>
/// <item><description>Property: <see cref="SmbiosType046Property.PropertyValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey PropertyValue => new PropertyKey(SmbiosStructure.StringProperty, SmbiosType046Property.PropertyValue);
#endregion
#region [public] {static} (IPropertyKey) ParentHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with the processor structure (Type 004).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.StringProperty"/></description></item>
/// <item><description>Property: <see cref="SmbiosType046Property.ParentHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey ParentHandle => new PropertyKey(SmbiosStructure.StringProperty, SmbiosType046Property.ParentHandle);
#endregion
}
#endregion
#region [public] {static} (class) Inactive: Contains the key definitions available for a type 126 [Inactive] structure
/// <summary>
/// Contains the key definitions available for a type 126 [<see cref="SmbiosStructure.Inactive"/>] structure.
/// </summary>
public static class Inactive
{
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates end of structures. Always returns the '<b>Inactive</b>' string.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.Inactive"/></description></item>
/// <item><description>Property: <see cref="SmbiosType126Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>Any version</para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(SmbiosStructure.Inactive, SmbiosType126Property.Description);
#endregion
}
#endregion
#region [public] {static} (class) EndOfTable: Contains the key definitions available for a type 127 [End-Of-Table] structure
/// <summary>
/// Contains the key definitions available for a type 127 [<see cref="SmbiosStructure.EndOfTable"/>] structure.
/// </summary>
public static class EndOfTable
{
#region [public] {static} (IPropertyKey) Status: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates end of structures. Always returns the '<b>End Of Table Structures</b>' string.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="SmbiosStructure.EndOfTable"/></description></item>
/// <item><description>Property: <see cref="SmbiosType127Property.Status"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>Any version</para>
/// </para>
/// </summary>
public static IPropertyKey Status => new PropertyKey(SmbiosStructure.EndOfTable, SmbiosType127Property.Status);
#endregion
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemEventLog/SupportedLogTypeDescriptors.md
# DmiProperty.SystemEventLog.SupportedLogTypeDescriptors property
Gets a value representing the key to retrieve the property value.
Number of supported event log type descriptors.
Key Composition
* Structure: SystemEventLog
* Property: SupportedLogTypeDescriptors
* Unit: None
Return Value
Type: Byte
```csharp
public static IPropertyKey SupportedLogTypeDescriptors { get; }
```
## See Also
* class [SystemEventLog](../DmiProperty.SystemEventLog.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiStructureCollection/GetProperties.md
# DmiStructureCollection.GetProperties method
Returns a Result that contains the result of the operation.
```csharp
public QueryPropertyCollectionResult GetProperties(IPropertyKey propertyKey)
```
| parameter | description |
| --- | --- |
| propertyKey | Key to the property to obtain |
## Return Value
A QueryPropertyCollectionResult reference that contains the result of the operation, to check if the operation is correct, the Success property will be true and the Result property will contain the Result; Otherwise, the the Success property will be false and the Errors property will contain the errors associated with the operation, if they have been filled in.
The type of the Result property is IEnumerable where T is PropertyItem.
## See Also
* class [DmiStructureCollection](../DmiStructureCollection.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDeviceMappedAddress/PartitionRowPosition.md
# DmiProperty.MemoryDeviceMappedAddress.PartitionRowPosition property
Gets a value representing the key to retrieve the property value.
Position of the referenced Memory Device in a row of the address partition. The value 0 is reserved. If the position is unknown, the field contains FFh.
Key Composition
* Structure: MemoryDeviceMappedAddress
* Property: PartitionRowPosition
* Unit: None
Return Value
Type: Byte
Remarks
2.1+
```csharp
public static IPropertyKey PartitionRowPosition { get; }
```
## See Also
* class [MemoryDeviceMappedAddress](../DmiProperty.MemoryDeviceMappedAddress.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.VoltageProbe.md
# DmiProperty.VoltageProbe class
Contains the key definitions available for a type 026 [VoltageProbe] structure.
```csharp
public static class VoltageProbe
```
## Public Members
| name | description |
| --- | --- |
| static [Accuracy](DmiProperty.VoltageProbe/Accuracy.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Description](DmiProperty.VoltageProbe/Description.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MaximumValue](DmiProperty.VoltageProbe/MaximumValue.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MinimumValue](DmiProperty.VoltageProbe/MinimumValue.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [NominalValue](DmiProperty.VoltageProbe/NominalValue.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [OemDefined](DmiProperty.VoltageProbe/OemDefined.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Resolution](DmiProperty.VoltageProbe/Resolution.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Tolerance](DmiProperty.VoltageProbe/Tolerance.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static class [LocationAndStatus](DmiProperty.VoltageProbe.LocationAndStatus.md) | Contains the key definition for the Location And Status section. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/DmiStructure.cs
using System.Diagnostics;
using iTin.Core.Hardware.Common;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Represents a structure <see cref="DMI"/>.
/// </summary>
public sealed class DmiStructure
{
#region private members
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private DmiClassCollection _elementsCollection;
#endregion
#region constructor/s
/// <summary>
/// Initialize a new instance of the class <see cref="DmiStructure"/>.
/// </summary>
/// <param name="class">Structure.</param>
/// <param name="context">a <see cref="SMBIOS"/> reference.</param>
internal DmiStructure(DmiStructureClass @class, SMBIOS context)
{
Class = @class;
Context = context;
}
#endregion
#region public readonly properties
/// <summary>
/// Gets a value that represents the class implemented.
/// </summary>
/// <value>
/// One of the values of the enumeration <see cref="DmiStructureClass"/> that represents the implemented class.
/// </value>
public DmiStructureClass Class { get; }
/// <summary>
/// Gets the collection of available items.
/// </summary>
/// <value>
/// Object <see cref="DmiClassCollection"/> that contains the collection of <see cref="DmiClass"/> objects available.
/// If there is no object <see cref="DmiClass"/>, <b>null</b> is returned.
/// </value>
public DmiClassCollection Elements => _elementsCollection ??= new DmiClassCollection(this);
/// <summary>
/// Gets a value that represents the structure friendly name.
/// </summary>
/// <returns>
/// The structure friendly name
/// </returns>
public string FriendlyClassName => Class.GetPropertyName();
#endregion
#region internal readonly properties
/// <summary>
/// Gets a value that represents the <see cref="SMBIOS"/> reference context.
/// </summary>
/// <value>
/// A <see cref="SMBIOS"/> reference context.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
internal SMBIOS Context { get; }
#endregion
#region public methods
/// <summary>
/// Returns the structure description.
/// </summary>
/// <returns>
/// The structure description.
/// </returns>
public string GetStructureDescrition() => Class.GetPropertyDescription();
#endregion
#region public override methods
/// <summary>
/// Returns a <see cref="string"/> that represents this instance.
/// </summary>
/// <returns>
/// A <see cref="string"/> that represents this instance.
/// </returns>
/// <remarks>
/// This method returns a string that represents this instance.
/// </remarks>
public override string ToString() => $"Class = {Class}";
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.TpmDevice/MajorSpecVersion.md
# DmiProperty.TpmDevice.MajorSpecVersion property
Gets a value representing the key to retrieve the property value.
Major TPM version supported by the TPM device.
Key Composition
* Structure: TpmDevice
* Property: MajorSpecVersion
* Unit: None
Return Value
Type: Byte
```csharp
public static IPropertyKey MajorSpecVersion { get; }
```
## See Also
* class [TpmDevice](../DmiProperty.TpmDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType042 [Management Controller Host Interface].cs
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 042: Management Controller Host Interface.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 42 Management Controller Host Interface structure |
// | indicator. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE Length of the structure, a minimum of 09h. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Interface BYTE ENUM Management Controller Interface Type. |
// | Type |
// | Refer to Management Component Transport Protocol |
// | (MCTP) IDs and Codes (DSP0239) for the definition of |
// | the Interface Type values. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Interface Type BYTE Varies |
// | Specific Data |
// | Data Length |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h Interface Type N Varies Management Controller Host Interface Data as specified|
// | Specific Data BYTEs by the Interface Type. Refer to DSP0239 to locate the |
// | value. |
// | This field has a minimum of four bytes. If interface |
// | type = OEM then the first four bytes are the vendor |
// | ID (MSB first), as assigned by the Internet Assigned |
// | Numbers Authority (IANA). |
// | This format uses the "Enterprise Number" that is |
// | assigned and maintained by IANA (www.iana.org) as the |
// | means of identifying a particular vendor, company, or |
// | organization. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h + N Number of N X X number of Protocol Records for this Host Interface |
// | Protocol Type |
// | Records |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h + N Protocol M Varies Protocol Records |
// | Records BYTEs |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Management Controller Host Interface (Type 42) structure.
/// </summary>
internal sealed class SmbiosType042 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType042"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType042(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private readonly properties
/// <summary>
/// Gets a value representing the '<b>Interface Type</b>' field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte InterfaceType => Reader.GetByte(0x04);
/// <summary>
/// Gets a value representing the '<b>Interface Type Specific Data Lenght</b>' field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte InterfaceTypeSpecificDataLenght => Reader.GetByte(0x05);
/// <summary>
/// Gets a value representing the '<b>Interface Type Specific Data</b>' field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ReadOnlyCollection<byte> InterfaceTypeSpecificData =>
#if NETSTANDARD2_1 || NET5_0_OR_GREATER
new ReadOnlyCollection<byte>(Reader.GetBytes(0x06, InterfaceTypeSpecificDataLenght).ToArray());
#else
new ReadOnlyCollection<byte>(Reader.GetBytes(0x06, InterfaceTypeSpecificDataLenght));
#endif
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
properties.Add(SmbiosProperty.ManagementControllerHostInterface.InterfaceType, GetInterfaceType(InterfaceType));
if (StructureInfo.Length >= 0x07)
{
properties.Add(SmbiosProperty.ManagementControllerHostInterface.InterfaceTypeSpecificData, InterfaceTypeSpecificData);
}
if (StructureInfo.Length >= 0x08 + InterfaceTypeSpecificDataLenght)
{
properties.Add(SmbiosProperty.ManagementControllerHostInterface.Protocols, new ManagementControllerHostInterfaceProtocolRecordsCollection(GetProtocolRecords()));
}
}
#endregion
#region private methods
/// <summary>
/// Returns a protocol records collection.
/// </summary>
/// <returns>
/// Protocol records collection
/// </returns>
private IEnumerable<ManagementControllerHostInterfaceProtocolRecord> GetProtocolRecords()
{
var protocolRecords = new Collection<ManagementControllerHostInterfaceProtocolRecord>();
var n = InterfaceTypeSpecificDataLenght;
var numberOfProtocolsRecords = Reader.GetByte((byte)(0x06 + n));
var offset = (byte)0;
for (var x = 0; x < numberOfProtocolsRecords ; x++)
{
var init = (byte)(0x07 + n + offset);
if (StructureInfo.Length <= init + 1)
{
break;
}
var m = Reader.GetByte((byte) (init + 0x01));
offset = (byte) (0x02 + m);
#if NETSTANDARD2_1 || NET5_0_OR_GREATER
var protocolRecordsBytes = Reader.GetBytes(init, m).ToArray();
#else
var protocolRecordsBytes = Reader.GetBytes(init, m);
#endif
protocolRecords.Add(new ManagementControllerHostInterfaceProtocolRecord(protocolRecordsBytes));
}
return protocolRecords;
}
#endregion
#region BIOS Specification 3.2.0 (26/04/2018)
/// <summary>
/// Gets a string representing the type of interface.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The type of interface.
/// </returns>
private static string GetInterfaceType(byte code)
{
string[] value =
{
"Unspecified", // 0x00
"SMBus 2.0 100 kHz compatible",
"SMBus 2.0 + I2C 100 kHz compatible",
"I2C 100 kHz compatible",
"I2C 400 kHz compatible" // 0x04
};
string[] value1 =
{
"PCIe 1.1 compatible", // 0x08
"PCIe 2.0 compatible",
"PCIe 2.1 compatible",
"PCIe 3.0 compatible" // 0x0b
};
string[] value2 =
{
"PCI compatible (PCI 1.0,2.0,2.1,2.2,2.3,3.0,PCI-X 1.0, PCI-X 2.0)", // 0x0f
"USB 1.1 compatible",
"USB 2.0 compatible",
"USB 3.0 compatible" // 0x12
};
string[] value3 =
{
"RMII / NC-SI", // 0x18
};
string[] value4 =
{
"KCS / Legacy", // 0x20
"KCS / PCI",
"Serial Host / Legacy (Fixed Address Decoding)",
"Serial Host / PCI (Base Class 7 Subclass 0)",
"Asynchronous Serial (Between MCs and IMDs)" // 0x24
};
if (code <= 0x04)
{
return value[code];
}
if (code >= 0x08 && code <= 0x0b)
{
return value1[code - 0x08];
}
if (code >= 0x0f && code <= 0x12)
{
return value2[code - 0x12];
}
if (code == 0x18)
{
return value3[0];
}
if (code >= 0x20 && code <= 0x24)
{
return value4[code - 0x20];
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiConnectOptions/MachineNameOrIpAddress.md
# DmiConnectOptions.MachineNameOrIpAddress property
```csharp
public string MachineNameOrIpAddress { get; set; }
```
## See Also
* class [DmiConnectOptions](../DmiConnectOptions.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.OnBoardDevices/DeviceType.md
# DmiProperty.OnBoardDevices.DeviceType property
Gets a value representing the key to retrieve the property value.
Device type.
Key Composition
* Structure: OnBoardDevices
* Property: DeviceType
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey DeviceType { get; }
```
## See Also
* class [OnBoardDevices](../DmiProperty.OnBoardDevices.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDeviceMappedAddress/InterleavePosition.md
# DmiProperty.MemoryDeviceMappedAddress.InterleavePosition property
Gets a value representing the key to retrieve the property value.
Position of the referenced Memory Device in an interleave.
Key Composition
* Structure: MemoryDeviceMappedAddress
* Property: InterleavePosition
* Unit: None
Return Value
Type: [`MemoryDeviceMappedAddressInterleavedPosition`](../../iTin.Hardware.Specification.Dmi/MemoryDeviceMappedAddressInterleavedPosition.md)
Remarks
2.1+
```csharp
public static IPropertyKey InterleavePosition { get; }
```
## See Also
* class [MemoryDeviceMappedAddress](../DmiProperty.MemoryDeviceMappedAddress.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Core/iTin.Core.Hardware/iTin.Core.Hardware.Windows.Specification.Smbios/FirmwareProvider.cs
namespace iTin.Core.Hardware.Windows.Specification.Smbios;
/// <summary>
/// Defines firmware tables
/// </summary>
public enum FirmwareProvider
{
/// <summary>
/// 'ACPI' table
/// </summary>
ACPI = 0x41435049,
/// <summary>
/// 'FIRM' table
/// </summary>
FIRM = 0x4649524D,
/// <summary>
/// 'RSMB' table
/// </summary>
RSMB = 0x52534D42
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.HardwareSecurity.HardwareSecuritySettings/FrontPanelResetStatus.md
# DmiProperty.HardwareSecurity.HardwareSecuritySettings.FrontPanelResetStatus property
Gets a value representing the key to retrieve the property value.
Returns current front panel reset status.
Key Composition
* Structure: HardwareSecurity
* Property: FrontPanelResetStatus
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey FrontPanelResetStatus { get; }
```
## See Also
* class [HardwareSecuritySettings](../DmiProperty.HardwareSecurity.HardwareSecuritySettings.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.OnBoardDevicesExtended/ReferenceDesignation.md
# DmiProperty.OnBoardDevicesExtended.ReferenceDesignation property
Gets a value representing the key to retrieve the property value.
Onboard device reference designation.
Key Composition
* Structure: OnBoardDevicesExtended
* Property: ReferenceDesignation
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey ReferenceDesignation { get; }
```
## See Also
* class [OnBoardDevicesExtended](../DmiProperty.OnBoardDevicesExtended.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/Specific/Enums/ChassisContainedElementType.cs
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Defines the <b>DMI</b> structures associated with the chassis.
/// </summary>
public enum ChassisContainedElementType
{
/// <summary>
/// SystemEnclosure structure
/// </summary>
BaseBoardEnumeration = 0x00,
/// <summary>
/// <b>SMBIOS</b> structure
/// </summary>
SmbiosStructure = 0x01
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.ManagementControllerHostInterface.Protocol/ProtocolTypeSpecificData.md
# DmiProperty.ManagementControllerHostInterface.Protocol.ProtocolTypeSpecificData property
Gets a value representing the key to retrieve the property value.
Protocol type specific data.
Key Composition
* Structure: ManagementControllerHostInterface
* Property: ProtocolTypeSpecificData
* Unit: None
Return Value
Type: ReadOnlyCollection where T is Byte
```csharp
public static IPropertyKey ProtocolTypeSpecificData { get; }
```
## See Also
* class [Protocol](../DmiProperty.ManagementControllerHostInterface.Protocol.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemPowerSupply/IsRedundant.md
# DmiProperty.SystemPowerSupply.IsRedundant property
Gets a value representing the key to retrieve the property value.
Indicates whether it is redundant.
Key Composition
* Structure: SystemPowerSupply
* Property: IsRedundant
* Unit: None
Return Value
Type: Boolean
```csharp
public static IPropertyKey IsRedundant { get; }
```
## See Also
* class [SystemPowerSupply](../DmiProperty.SystemPowerSupply.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Chassis.Elements.md
# DmiProperty.Chassis.Elements class
Contains the key definition for the Elements section.
```csharp
public static class Elements
```
## Public Members
| name | description |
| --- | --- |
| static [ItemType](DmiProperty.Chassis.Elements/ItemType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Max](DmiProperty.Chassis.Elements/Max.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Min](DmiProperty.Chassis.Elements/Min.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [TypeSelect](DmiProperty.Chassis.Elements/TypeSelect.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [Chassis](./DmiProperty.Chassis.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType021 [Built-in Pointing Device].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Built-in Pointing Device (Type 21) structure.<br/>
/// For more information, please see <see cref="SmbiosType021"/>.
/// </summary>
internal sealed class DmiType021 : DmiBaseType<SmbiosType021>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType021"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType021(SmbiosType021 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion < DmiStructureVersion.v21)
{
return;
}
properties.Add(DmiProperty.BuiltInPointingDevice.NumberOfButtons, SmbiosStructure.GetPropertyValue(SmbiosProperty.BuiltInPointingDevice.NumberOfButtons));
properties.Add(DmiProperty.BuiltInPointingDevice.Type, SmbiosStructure.GetPropertyValue(SmbiosProperty.BuiltInPointingDevice.Type));
properties.Add(DmiProperty.BuiltInPointingDevice.Interface, SmbiosStructure.GetPropertyValue(SmbiosProperty.BuiltInPointingDevice.Interface));
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor/CurrentSpeed.md
# DmiProperty.Processor.CurrentSpeed property
Gets a value representing the key to retrieve the property value.
Current processor speed (in MHz).
This field identifies the processor's speed at system boot; the processor may support more than one speed.
Key Composition
* Structure: Processor
* Property: CurrentSpeed
* Unit: MHz
Return Value
Type: UInt16
Remarks
2.0+
```csharp
public static IPropertyKey CurrentSpeed { get; }
```
## See Also
* class [Processor](../DmiProperty.Processor.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryModule/CurrentMemoryType.md
# DmiProperty.MemoryModule.CurrentMemoryType property
Gets a value representing the key to retrieve the property value.
Describes the physical characteristics of the memory modules that are supported by (and currently installed in) the system.
Key Composition
* Structure: MemoryModule
* Property: CurrentMemoryType
* Unit: None
Return Value
Type: ReadOnlyCollection where T is String
```csharp
public static IPropertyKey CurrentMemoryType { get; }
```
## See Also
* class [MemoryModule](../DmiProperty.MemoryModule.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiBaseType-1.md
# DmiBaseType<TSmbios> class
The DmiBaseType class provides functions to analyze the properties associated with a structure [`DMI`](../iTin.Hardware.Specification/DMI.md).
```csharp
public abstract class DmiBaseType<TSmbios> : IDmiType
```
| parameter | description |
| --- | --- |
| TSmbios | Smbios strucutre type |
## Public Members
| name | description |
| --- | --- |
| [ImplementedProperties](DmiBaseType-1/ImplementedProperties.md) { get; } | |
| [ImplementedVersion](DmiBaseType-1/ImplementedVersion.md) { get; } | Returns a value that indicates the implemented version of this [`DMI`](../iTin.Hardware.Specification/DMI.md) structure. |
| [GetProperty](DmiBaseType-1/GetProperty.md)(…) | Returns the value of specified property. Always returns the first appearance of the property. |
| [GetUnderlyingSmbiosStructure](DmiBaseType-1/GetUnderlyingSmbiosStructure.md)() | Returns a reference to the underlying smbios structure for this dmi type. |
| override [ToString](DmiBaseType-1/ToString.md)() | Returns a String that represents this instance. |
## Protected Members
| name | description |
| --- | --- |
| [DmiBaseType](DmiBaseType-1/DmiBaseType.md)(…) | Initializes a new instance of the class SmbiosBaseType by specifying the Header of the structure and current |
| [SmbiosStructure](DmiBaseType-1/SmbiosStructure.md) { get; } | Gets a reference to smbios structure. |
| [SmbiosVersion](DmiBaseType-1/SmbiosVersion.md) { get; } | Gets the current version of SMBIOS. |
| [Parse](DmiBaseType-1/Parse.md)(…) | Parse and populates the property collection for this structure. |
| virtual [PopulateProperties](DmiBaseType-1/PopulateProperties.md)(…) | Populates the property collection for this structure. |
## See Also
* interface [IDmiType](./IDmiType.md)
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Tpm/TpmCapabilityVendorId.cs
namespace iTin.Hardware.Specification.Tpm;
/// <summary>
/// Represents <b>TPM Capabilities Vendor ID (CAP_VID)</b>.
/// </summary>
public class TpmCapabilityVendorId
{
#region public static readonly properties
/// <summary>
/// AMD
/// </summary>
public static TpmCapabilityVendorId AMD => new TpmCapabilityVendorId {ASCII = "AMD", Description = "AMD", Hex = new byte[] {0x41, 0x4d, 0x44, 0x00}};
/// <summary>
/// Atmel
/// </summary>
public static TpmCapabilityVendorId Atmel => new TpmCapabilityVendorId {ASCII = "ATML", Description = "Atmel", Hex = new byte[] {0x41, 0x54, 0x4d, 0x4c}};
/// <summary>
/// Broadcom
/// </summary>
public static TpmCapabilityVendorId Broadcom => new TpmCapabilityVendorId {ASCII = "BRCM", Description = "Broadcom", Hex = new byte[] {0x42, 0x52, 0x43, 0x4d}};
/// <summary>
/// HPE
/// </summary>
public static TpmCapabilityVendorId HPE => new TpmCapabilityVendorId {ASCII = "HPE", Description = "HPE", Hex = new byte[] {0x48, 0x50, 0x45, 0x00}};
/// <summary>
/// IBM
/// </summary>
public static TpmCapabilityVendorId IBM => new TpmCapabilityVendorId {ASCII = "IBM ", Description = "IBM", Hex = new byte[] {0x49, 0x42, 0x4d, 0x00}};
/// <summary>
/// Infineon
/// </summary>
public static TpmCapabilityVendorId Infineon => new TpmCapabilityVendorId {ASCII = "IFX ", Description = "Infineon", Hex = new byte[] {0x49, 0x46, 0x58, 0x00}};
/// <summary>
/// Intel
/// </summary>
public static TpmCapabilityVendorId Intel => new TpmCapabilityVendorId {ASCII = "INTC ", Description = "Intel", Hex = new byte[] {0x49, 0x4e, 0x54, 0x43}};
/// <summary>
/// Lenovo
/// </summary>
public static TpmCapabilityVendorId Lenovo => new TpmCapabilityVendorId {ASCII = "LEN ", Description = "Lenovo", Hex = new byte[] {0x4c, 0x45, 0x4e, 0x00}};
/// <summary>
/// Microsoft
/// </summary>
public static TpmCapabilityVendorId Microsoft => new TpmCapabilityVendorId {ASCII = "MSFT", Description = "Microsoft", Hex = new byte[] {0x4d, 0x53, 0x46, 0x54}};
/// <summary>
/// National Semiconductor
/// </summary>
public static TpmCapabilityVendorId NationalSemiconductor => new TpmCapabilityVendorId {ASCII = "NSM ", Description = "National Semiconductor", Hex = new byte[] {0x4e, 0x53, 0x4d, 0x20}};
/// <summary>
/// Nationz
/// </summary>
public static TpmCapabilityVendorId Nationz => new TpmCapabilityVendorId {ASCII = "NTZ ", Description = "Nationz", Hex = new byte[] {0x4e, 0x54, 0x5a, 0x00}};
/// <summary>
/// Nuvoton Technology
/// </summary>
public static TpmCapabilityVendorId NuvotonTechnology => new TpmCapabilityVendorId {ASCII = "NTC ", Description = "Nuvoton Technology", Hex = new byte[] { 0x4e, 0x54, 0x43, 0x00}};
/// <summary>
/// Qualcomm
/// </summary>
public static TpmCapabilityVendorId Qualcomm => new TpmCapabilityVendorId {ASCII = "QCOM ", Description = "Qualcomm", Hex = new byte[] {0x51, 0x43, 0x4f, 0x4d}};
/// <summary>
/// SMSC
/// </summary>
public static TpmCapabilityVendorId SMSC => new TpmCapabilityVendorId {ASCII = "SMSC", Description = "SMSC", Hex = new byte[] {0x53, 0x4d, 0x53, 0x43}};
/// <summary>
/// ST Microelectronics
/// </summary>
public static TpmCapabilityVendorId STMicroelectronics => new TpmCapabilityVendorId {ASCII = "STM", Description = "ST Microelectronics", Hex = new byte[] {0x53, 0x54, 0x4d, 0x20}};
/// <summary>
/// Samsung
/// </summary>
public static TpmCapabilityVendorId Samsung => new TpmCapabilityVendorId {ASCII = "SMSN", Description = "Samsung", Hex = new byte[] {0x53, 0x4d, 0x53, 0x4e}};
/// <summary>
/// Sinosun
/// </summary>
public static TpmCapabilityVendorId Sinosun => new TpmCapabilityVendorId {ASCII = "SNS", Description = "Sinosun", Hex = new byte[] {0x53, 0x4e, 0x53, 0x00}};
/// <summary>
/// Texas Instruments
/// </summary>
public static TpmCapabilityVendorId TexasInstruments => new TpmCapabilityVendorId {ASCII = "TXN", Description = "Texas Instruments", Hex = new byte[] {0x54, 0x58, 0x4e, 0x00}};
/// <summary>
/// Winbond
/// </summary>
public static TpmCapabilityVendorId Winbond => new TpmCapabilityVendorId {ASCII = "WEC", Description = "Winbond", Hex = new byte[] {0x57, 0x45, 0x43, 0x00}};
/// <summary>
/// Fuzhou Rockchip
/// </summary>
public static TpmCapabilityVendorId FuzhouRockchip => new TpmCapabilityVendorId {ASCII = "ROCC", Description = "Fuzhou Rockchip", Hex = new byte[] {0x52, 0x4f, 0x43, 0x43}};
/// <summary>
/// Google
/// </summary>
public static TpmCapabilityVendorId Google => new TpmCapabilityVendorId {ASCII = "GOOG", Description = "Google", Hex = new byte[] {0x47, 0x4f, 0x4f, 0x47}};
#endregion
#region public properties
/// <summary>
/// Gets or sets a value representing the informative representation of the normative hexadecimal value
/// </summary>
/// <value>
/// Informative representation of the normative hexadecimal value.
/// </value>
public string ASCII { get; set; }
/// <summary>
/// Gets or sets a value representing Vendor Id description.
/// </summary>
/// <value>
/// Vendor Id as hexadecimal.
/// </value>
public string Description { get; set; }
/// <summary>
/// Gets or sets a value representing Vendor Id as hexadecimal.
/// </summary>
/// <value>
/// Vendor Id as hexadecimal.
/// </value>
public byte[] Hex { get; set; }
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor.Characteristics/Capable64Bits.md
# DmiProperty.Processor.Characteristics.Capable64Bits property
Gets a value representing the key to retrieve the property value.
64-bit Capable indicates the maximum data width capability of the processor. For example, this bit is set for Intel Itanium, AMD Opteron, and Intel Xeon(with EM64T) processors; this bit is cleared for Intel Xeon processors that do not have EM64T. Indicates the maximum capability of the processor and does not indicate the current enabled state.
Key Composition
* Structure: Processor
* Property: Capable64Bits
* Unit: None
Return Value
Type: Boolean
Remarks
2.5+
```csharp
public static IPropertyKey Capable64Bits { get; }
```
## See Also
* class [Characteristics](../DmiProperty.Processor.Characteristics.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/Specific/DmiChassisContainedElement.cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// This class represents an element of the structure <see cref="DmiType003"/>.
/// </summary>
public class DmiChassisContainedElement
{
#region private members
private readonly SmbiosPropertiesTable _reference;
#endregion
#region constructor/s
/// <summary>
/// Initialize a new instance of the class <see cref="DmiChassisContainedElement"/>.
/// </summary>
/// <param name="reference"><b>SMBIOS</b> properties.</param>
internal DmiChassisContainedElement(SmbiosPropertiesTable reference)
{
_reference = reference;
}
#endregion
#region public properties
/// <summary>
/// Gets the properties available for this structure.
/// </summary>
/// <value>
/// Availables properties.
/// </value>
public DmiClassPropertiesTable Properties =>
new()
{
{DmiProperty.Chassis.Elements.Min, _reference[SmbiosProperty.Chassis.Elements.Min]},
{DmiProperty.Chassis.Elements.Max, _reference[SmbiosProperty.Chassis.Elements.Max]},
{DmiProperty.Chassis.Elements.TypeSelect, _reference[SmbiosProperty.Chassis.Elements.TypeSelect]},
{DmiProperty.Chassis.Elements.ItemType, _reference[SmbiosProperty.Chassis.Elements.ItemType]}
};
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType004 [Processor Information].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Processor Information (Type 4) structure.<br/>
/// For more information, please see <see cref="SmbiosType004"/>.
/// </summary>
internal sealed class DmiType004 : DmiBaseType<SmbiosType004>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType004"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType004(SmbiosType004 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
#region 2.0+
if (ImplementedVersion >= DmiStructureVersion.v20)
{
properties.Add(DmiProperty.Processor.SocketDesignation, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.SocketDesignation));
properties.Add(DmiProperty.Processor.ProcessorType, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.ProcessorType));
properties.Add(DmiProperty.Processor.ProcessorVersion, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.ProcessorVersion));
properties.Add(DmiProperty.Processor.Family, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.Family));
properties.Add(DmiProperty.Processor.ProcessorManufacturer, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.ProcessorManufacturer));
properties.Add(DmiProperty.Processor.ProcessorId, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.ProcessorId));
properties.Add(DmiProperty.Processor.Voltage.IsLegacyMode, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.Voltage.IsLegacyMode));
properties.Add(DmiProperty.Processor.Voltage.SupportedVoltages, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.Voltage.SupportedVoltages));
object externakClockProperty = SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.ExternalClock);
ushort externakClock = (ushort)externakClockProperty;
if (externakClock != 0x00)
{
properties.Add(DmiProperty.Processor.ExternalClock, externakClock);
}
object maxSpeedProperty = SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.MaximunSpeed);
ushort maxSpeed = (ushort)maxSpeedProperty;
if (maxSpeed != 0x00)
{
properties.Add(DmiProperty.Processor.MaximumSpeed, maxSpeed);
}
properties.Add(DmiProperty.Processor.CurrentSpeed, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.CurrentSpeed));
properties.Add(DmiProperty.Processor.Status.CpuStatus, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.Status.CpuStatus));
properties.Add(DmiProperty.Processor.Status.SocketPopulated, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.Status.SocketPopulated));
properties.Add(DmiProperty.Processor.UpgradeMethod, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.UpgradeMethod));
}
#endregion
#region 2.1+
if (ImplementedVersion >= DmiStructureVersion.v21)
{
properties.Add(DmiProperty.Processor.L1CacheHandle, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.L1CacheHandle));
properties.Add(DmiProperty.Processor.L2CacheHandle, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.L2CacheHandle));
properties.Add(DmiProperty.Processor.L3CacheHandle, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.L3CacheHandle));
}
#endregion
#region 2.3+
if (ImplementedVersion >= DmiStructureVersion.v23)
{
properties.Add(DmiProperty.Processor.SerialNumber, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.SerialNumber));
properties.Add(DmiProperty.Processor.AssetTag, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.AssetTag));
properties.Add(DmiProperty.Processor.PartNumber, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.PartNumber));
}
#endregion
#region 2.5+
if (ImplementedVersion >= DmiStructureVersion.v25)
{
properties.Add(DmiProperty.Processor.CoreCount, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.CoreCount));
properties.Add(DmiProperty.Processor.CoreEnabled, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.CoreEnabled));
properties.Add(DmiProperty.Processor.ThreadCount, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.ThreadCount));
properties.Add(DmiProperty.Processor.Characteristics.Arm64SocIdSupported, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.Characteristics.Arm64SocIdSupported));
properties.Add(DmiProperty.Processor.Characteristics.Capable64Bits, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.Characteristics.Capable64Bits));
properties.Add(DmiProperty.Processor.Characteristics.Capable128Bits, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.Characteristics.Capable128Bits));
properties.Add(DmiProperty.Processor.Characteristics.MultiCore, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.Characteristics.MultiCore));
properties.Add(DmiProperty.Processor.Characteristics.HardwareThreadPerCore, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.Characteristics.HardwareThreadPerCore));
properties.Add(DmiProperty.Processor.Characteristics.ExecuteProtectionSupport, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.Characteristics.ExecuteProtectionSupport));
properties.Add(DmiProperty.Processor.Characteristics.EnhancedVirtualizationInstructions, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.Characteristics.EnhancedVirtualizationInstructions));
properties.Add(DmiProperty.Processor.Characteristics.PowerPerformanceControlSupport, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.Characteristics.PowerPerformanceControlSupport));
}
#endregion
#region 3.6+
if (ImplementedVersion >= DmiStructureVersion.v36)
{
properties.Add(DmiProperty.Processor.ThreadEnabled, SmbiosStructure.GetPropertyValue(SmbiosProperty.Processor.ThreadEnabled));
}
#endregion
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType009 [Slot Information].cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using iTin.Core;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 009: System Slots
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length Value Description |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.0+ Type BYTE 9 System Slot Structure Indicator |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.0+ Length BYTE Varies 0Ch for version 2.0 |
// | 0Dh for versiones 2.1 a 2.5 |
// | 11h for version 2.6 and later. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 2.0+ Handle WORD Varies |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 2.0+ Slot Designation BYTE STRING String number for reference designation |
// | EXAMPLE: ‘PCI-1’,0 |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h 2.0+ Slot Type BYTE ENUM Note: For more information, GetSlotType(byte) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h 2.0+ Slot Data BYTE ENUM Note: For more information, GetDataBusWidth(byte) |
// | Bus Width |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h 2.0+ Current Usage BYTE ENUM Note: For more information, GetCurrentUsage(byte) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h 2.0+ Slot Length BYTE ENUM Note: For more information, GetLength(byte) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 09h 2.0+ Slot ID WORD Varies Note: For more information, GetId(byte, byte, byte) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Bh 2.0+ Slot BYTE Bit Field Note: For more information, GetCharacteristics(byte, byte) |
// | Characteristics 1 |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ch 2.1+ Slot BYTE Bit Field Note: For more information, GetCharacteristics(byte, byte) |
// | Characteristics 2 |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Dh 2.6+ Segment Group WORD Varies Note: For more information, GetSegmentBusFuction(int) |
// | Number (Base) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Fh 2.6+ Bus Number (Base) BYTE Varies |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 10h 2.6+ Device/Function BYTE Bit field Bits 7:3 – device number |
// | Number (Base) Bits 2:0 – function number |
// | Note: For more information, GetBusDeviceFunction(byte, byte) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 11h 3.2 Data Bus Width BYTE Varies Indicate electrical bus width of base |
// | (Base) Segment/Bus/Device/Function/Width |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 12h 3.2 Peer(S/B/D/F/Width) BYTE Varies Number of peer Segment/Bus/Device/Function/Width |
// | grouping count (n) groups that follow |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 13h 3.2 Peer(S/B/D/F/Width) 5*n Varies Peer Segment/Bus/Device/Function |
// | groups BYTE present in the slot; see 7.10.9 |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 13h + 3.4 Slot Information BYTE Varies Please see SlotInformation |
// | 5*n |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 14 + 3.4 Slot Physical Width BYTE Varies Please see GetDataBusWidth() |
// | 5*n |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 15h + 3.4 Slot Pitch WORD Varies Please see SlotPitch |
// | 5*n |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 17h + 3.5 Slot Height BYTE Varies Please see SlotHeight |
// | 5*n |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Slot Information (Type 9) structure.
/// </summary>
internal sealed class SmbiosType009 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType009"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType009(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
#region Version 2.0+ fields
/// <summary>
/// Gets a value representing the <b>Slot Designation</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string SlotDesignation => GetString(0x04);
/// <summary>
/// Gets a value representing the <b>Slot Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte SlotType => Reader.GetByte(0x05);
/// <summary>
/// Gets a value representing the <b>Data Width</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte DataWidth => Reader.GetByte(0x06);
/// <summary>
/// Gets a value representing the <b>Current Usage</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte CurrentUsage => Reader.GetByte(0x07);
/// <summary>
/// Gets a value representing the <b>Length</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Length => Reader.GetByte(0x08);
/// <summary>
/// Gets a value representing the <b>Adapter</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Adapter => Reader.GetByte(0x09);
/// <summary>
/// Gets a value representing the <b>Socket</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Socket => Reader.GetByte(0x0a);
/// <summary>
/// Gets a value representing the <b>Characteristics1</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Characteristics1 => Reader.GetByte(0x0b);
#endregion
#region Version 2.1+ fields
/// <summary>
/// Gets a value representing the <b>Characteristics2</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Characteristics2 => Reader.GetByte(0x0c);
#endregion
#region Version 2.6+ fields
/// <summary>
/// Gets a value representing the <b>Segment Bus Function</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort SegmentBusFunction => (ushort)Reader.GetWord(0x0d);
/// <summary>
/// Gets a value representing the <b>Bus</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Bus => Reader.GetByte(0x0f);
/// <summary>
/// Gets a value representing the <b>Device Function Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte DeviceFunctionNumber => Reader.GetByte(0x10);
/// <summary>
/// Gets a value representing the <b>Device</b> feature of the <b>Device/Function Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Device => (byte) ((DeviceFunctionNumber & 0xf8) >> 3);
/// <summary>
/// Gets a value representing the <b>Function</b> feature of the <b>Device/Function Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Function => (byte) (DeviceFunctionNumber & 0x07);
#endregion
#region Version 3.2 fields
/// <summary>
/// Gets a value representing the <b>Base Data Bus Width</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte BaseDataBusWidth => Reader.GetByte(0x11);
/// <summary>
/// Gets a value representing the <b>Peer Grouping Count (n)</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte GroupingCount => Reader.GetByte(0x12);
#if NETSTANDARD2_1 || NET5_0_OR_GREATER
/// <summary>
/// Gets a value representing the <b>Peer (S/B/D/F/Width) groups</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private Span<byte> RawGroups => Reader.GetBytes(0x13, (byte)(5 * GroupingCount));
#else
/// <summary>
/// Gets a value representing the <b>Peer (S/B/D/F/Width) groups</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte[] RawGroups => Reader.GetBytes(0x13, (byte)(5 * GroupingCount));
#endif
#endregion
#region Version 3.4 fields
/// <summary>
/// Gets a value representing the <b>Slot Information</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte SlotInformation => Reader.GetByte((byte)(0x14 + (5 * GroupingCount)));
/// <summary>
/// Gets a value representing the <b>Slot Physical Width</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte SlotPhysicalWidth => Reader.GetByte((byte)(0x15 + (5 * GroupingCount)));
/// <summary>
/// Gets a value representing the <b>Slot Pitch</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort SlotPitch => (ushort)Reader.GetWord((byte)(0x16 + (5 * GroupingCount)));
#endregion
#region Version 3.5 fields
/// <summary>
/// Gets a value representing the <b>Slot Height</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte SlotHeight => Reader.GetByte((byte)(0x18 + (5 * GroupingCount)));
#endregion
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
#region 2.0+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v20)
{
properties.Add(SmbiosProperty.SystemSlots.SlotDesignation, SlotDesignation);
properties.Add(SmbiosProperty.SystemSlots.SlotType, GetSlotType(SlotType));
properties.Add(SmbiosProperty.SystemSlots.SlotDataBusWidth, GetDataBusWidth(DataWidth));
properties.Add(SmbiosProperty.SystemSlots.CurrentUsage, GetCurrentUsage(CurrentUsage));
properties.Add(SmbiosProperty.SystemSlots.SlotLength, GetLength(Length));
properties.Add(SmbiosProperty.SystemSlots.SlotId, GetId(SlotType, Adapter, Socket));
properties.Add(SmbiosProperty.SystemSlots.Characteristics, GetCharacteristics(Characteristics1, 0xff));
}
#endregion
#region 2.1+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v21)
{
properties[SmbiosProperty.SystemSlots.Characteristics] = GetCharacteristics(Characteristics1, Characteristics2);
}
#endregion
#region 2.6+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v26)
{
properties.Add(SmbiosProperty.SystemSlots.SegmentBusFunction, GetSegmentBusFunction(SegmentBusFunction));
properties.Add(SmbiosProperty.SystemSlots.BusDeviceFunction, GetBusDeviceFunction(Bus, Device, Function));
}
#endregion
#region 3.2
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v32)
{
var slotType = GetSlotType(SlotType).ToLowerInvariant();
var canEvaluate = slotType.Contains("agp") || slotType.Contains("pci");
if (canEvaluate)
{
IEnumerable<PeerDevice> peersDevices = GetPeerElements(RawGroups);
properties.Add(SmbiosProperty.SystemSlots.PeerDevices, new PeerDevicesCollection(peersDevices));
}
}
#endregion
#region 3.4
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v34)
{
if (SlotType == 0xC4)
{
properties.Add(SmbiosProperty.SystemSlots.SlotInformation, $"PCI Express Generation {SlotInformation}");
}
properties.Add(SmbiosProperty.SystemSlots.SlotPhysicalWidth, GetDataBusWidth(DataWidth));
properties.Add(SmbiosProperty.SystemSlots.SlotPitch, SlotPitch);
}
#endregion
#region 3.5
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v35)
{
properties.Add(SmbiosProperty.SystemSlots.SlotHeight, GetSlotHeight(SlotHeight));
}
#endregion
}
#endregion
#region BIOS Specification 3.7.0 (23/07/2023)
/// <summary>
/// Gets a string representing Bus / Device / Function of the slot.
/// </summary>
/// <param name="bus">Bus.</param>
/// <param name="device">Device.</param>
/// <param name="function">Función.</param>
/// <returns>
/// Bus/Device/Function slot information
/// </returns>
private static string GetBusDeviceFunction(byte bus, byte device, byte function) => $"Bus = {bus}, Device = {device}, Function = {function}";
/// <summary>
/// Gets a collection with the characteristics of the slot.
/// </summary>
/// <param name="code1">General characteristics.</param>
/// <param name="code2">Specific characteristics.</param>
/// <returns>
/// A collection with the characteristics of the slot.
/// </returns>
private static ReadOnlyCollection<string> GetCharacteristics(byte code1, byte code2)
{
string[] value =
{
"Characteristics Unknown", // 0x00
"Provides 5.0 Volts",
"Provides 3.3 Volts",
"Opening is shared",
"PC Card-16 is supported",
"Cardbus is supported",
"Zoom Video is supported",
"Modem ring resume is supported" // 0x07
};
string[] value1 =
{
"PME signal is supported", // 0x00
"Hot-plug devices are supported",
"SMBus signal is supported",
"PCIe slot supports bifurcation",
"Slot supports async/surprise removal" // 0x04
};
var items = new List<string>();
for (byte i = 0; i <= 7; i++)
{
bool addCharacteristic = code1.CheckBit(i);
if (addCharacteristic)
{
items.Add(value[i]);
}
}
if (code2 != 0xff)
{
for (byte i = 0; i <= 4; i++)
{
bool addCharacteristic = code2.CheckBit(i);
if (addCharacteristic)
{
items.Add(value1[i]);
}
}
// see v3.6.0
var bit5 = code2.CheckBit(5);
var bit6 = code2.CheckBit(6);
if (bit5 == false && bit6 == false)
{
items.Add("Non CXL-capable slot");
}
else if(bit5 && bit6 == false)
{
items.Add("Flexbus slot, CXL 2.0 capable (backward compatible to 1.0)");
}
else
{
items.Add("Flexbus slot, CXL 1.0 capable");
}
// v3.7.0
var bit7 = code2.CheckBit(7);
if (bit7)
{
items.Add("Flexbus slot, CXL 3.0 capable");
}
}
return items.AsReadOnly();
}
/// <summary>
/// Gets a string representing the current slot usage.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The current slot usage.
/// </returns>
private static string GetCurrentUsage(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"Available",
"In use",
"Unavailable", // 0x05 - e.g., connected to a processor that is not installed
};
if (code >= 0x01 && code <= 0x05)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string representing the width of the data bus in the slot.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The width of the data bus in the slot.
/// </returns>
private static string GetDataBusWidth(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"8-bit",
"16-bit",
"32-bit",
"64-bit",
"128-bit",
"x1",
"x2",
"x4",
"x8",
"x12",
"x16",
"x32" // 0x0E
};
if (code >= 0x01 && code <= 0x0E)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string that identifies the slot.
/// </summary>
/// <param name="type">Slot typet.</param>
/// <param name="adpater">First value to analyze.</param>
/// <param name="socket">Second value to analyze.</param>
/// <returns>
/// Slot identifier.
/// </returns>
private static string GetId(byte type, byte adpater, byte socket)
{
return type switch
{
0x04 => // MCA
$"{adpater:X}",
0x05 => // EISA
$"{adpater:X}",
0x06 => // PCI
$"{adpater:X}",
0x0E => // PCI
$"{adpater:X}",
0x0F => // AGP
$"{adpater:X}",
0x10 => // AGP
$"{adpater:X}",
0x11 => // AGP
$"{adpater:X}",
0x12 => // PCI-X
$"{adpater:X}",
0x13 => // AGP
$"{adpater:X}",
0xA5 => // PCI Express
$"{adpater:X}",
0x07 => // PCMCIA
$"ID: Adapter {adpater:X}, Socket {socket:X}",
_ => SmbiosHelper.OutOfSpec
};
}
/// <summary>
/// Gets a string that identifies the physical width of the slot.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// Ancho físico del slot.
/// </returns>
private static string GetLength(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"Short Length",
"Long Length",
"2.5\" drive form factor",
"3.5\" drive form factor" // 0x06
};
if (code >= 0x01 && code <= 0x06)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
#if NETSTANDARD2_1 || NET5_0_OR_GREATER
/// <summary>
/// Gets the list of peer information.
/// </summary>
/// <param name="rawData">Raw information.</param>
/// <returns>
/// Peers
/// </returns>
private static IEnumerable<PeerDevice> GetPeerElements(Span<byte> rawData)
{
var peerElements = new Collection<PeerDevice>();
for (var i = 0; i < rawData.Length; i += 0x05)
{
var peer = new byte[0x05];
Array.Copy(rawData.ToArray(), i, peer, 0, 0x05);
peerElements.Add(new PeerDevice(peer));
}
return peerElements;
}
#else
/// <summary>
/// Gets the list of peer information.
/// </summary>
/// <param name="rawData">Raw information.</param>
/// <returns>
/// Peers
/// </returns>
private static IEnumerable<PeerDevice> GetPeerElements(byte[] rawData)
{
Collection<PeerDevice> peerElements = new Collection<PeerDevice>();
for (int i = 0; i < rawData.Length; i += 0x05)
{
var peer = new byte[0x05];
Array.Copy(rawData, i, peer, 0, 0x05);
peerElements.Add(new PeerDevice(peer));
}
return peerElements;
}
#endif
/// <summary>
/// Gets a string representing SegmentBusFuction.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// Segment Bus function.
/// </returns>
private static string GetSegmentBusFunction(ushort code) => $"{code:X}";
/// <summary>
/// Gets a string indicating the slot type.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// Slot type.
/// </returns>
private static string GetSlotType(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"ISA",
"MCA",
"EISA",
"PCI",
"PC Card (PCMCIA)",
"VLB",
"Proprietary",
"Processor Card",
"Proprietary Memory Card",
"I/O Riser Card",
"NuBus",
"PCI-66",
"AGP",
"AGP 2x",
"AGP 4x",
"PCI-X",
"AGP 8x",
"M.2 Socket 1-DP (Mechanical Key A)",
"M.2 Socket 1-SD (Mechanical Key E)",
"M.2 Socket 2 (Mechanical Key B)",
"M.2 Socket 3 (Mechanical Key M)",
"MXM Type I",
"MXM Type II",
"MXM Type III (standard connector)",
"MXM Type III (HE connector)",
"MXM Type IV",
"MXM 3.0 Type A",
"MXM 3.0 Type B",
"PCI Express Gen 2 SFF-8639",
"PCI Express Gen 3 SFF-8639",
"PCI Express Mini 52-pin (CEM spec. 2.0) with bottom-side keep-outs",
"PCI Express Mini 52-pin (CEM spec. 2.0) without bottom-side keep-outs",
"PCI Express Gen 4 SFF-8639 (U.2)",
"PCI Express Gen 5 SFF-8639 (U.2)",
"OCP NIC 3.0 Small Form Factor (SFF)",
"OCP NIC 3.0 Large Form Factor (LFF)",
"OCP NIC Prior to 3.0" // 0x28h
};
string[] value1 =
{
"CXL Flexbus 1.0" // 0x30
};
string[] value2 =
{
"PC-98/C20", // 0xA0
"PC-98/C24",
"PC-98/E",
"PC-98/Local Bus",
"PC-98/Card",
"PCI Express",
"PCI Express x1",
"PCI Express x2",
"PCI Express x4",
"PCI Express x8",
"PCI Express x16",
"PCI Express Gen 2",
"PCI Express Gen 2 x1",
"PCI Express Gen 2 x2",
"PCI Express Gen 2 x4",
"PCI Express Gen 2 x8",
"PCI Express Gen 2 x16",
"PCI Express Gen 3",
"PCI Express Gen 3 x1",
"PCI Express Gen 3 x2",
"PCI Express Gen 3 x4",
"PCI Express Gen 3 x8",
"PCI Express Gen 3 x16",
"PCI Express Gen 4",
"PCI Express Gen 4 x1",
"PCI Express Gen 4 x2",
"PCI Express Gen 4 x4",
"PCI Express Gen 4 x8",
"PCI Express Gen 4 x16",
"PCI Express Gen 5",
"PCI Express Gen 5 x1",
"PCI Express Gen 5 x2",
"PCI Express Gen 5 x4",
"PCI Express Gen 5 x8",
"PCI Express Gen 5 x16",
"PCI Express Gen 6 and Beyond",
"Enterprise and Datacenter 1U E1 Form Factor Slot",
"Enterprise and Datacenter 3\" E3 Form Factor Slot" // 0xC6
};
if (code >= 0x01 && code <= 0x28)
{
return value[code - 0x01];
}
if (code >= 0x30 && code < 0xA0)
{
return value1[code - 0x01];
}
if (code >= 0xA0 && code <= 0xC3)
{
return value2[code - 0xA0];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string that identifies the maximum supported card height for the slot.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// Maximum supported card height for the slot.
/// </returns>
private static string GetSlotHeight(byte code)
{
string[] value =
{
"Not applicable", // 0x00
"Other",
"Unknown",
"Full height",
"Low-profile" // 0x04
};
if (code >= 0x00 && code <= 0x04)
{
return value[code];
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor.Characteristics.md
# DmiProperty.Processor.Characteristics class
Contains the key definition for the Characteristics section.
```csharp
public static class Characteristics
```
## Public Members
| name | description |
| --- | --- |
| static [Arm64SocIdSupported](DmiProperty.Processor.Characteristics/Arm64SocIdSupported.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Capable128Bits](DmiProperty.Processor.Characteristics/Capable128Bits.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Capable64Bits](DmiProperty.Processor.Characteristics/Capable64Bits.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [EnhancedVirtualizationInstructions](DmiProperty.Processor.Characteristics/EnhancedVirtualizationInstructions.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ExecuteProtectionSupport](DmiProperty.Processor.Characteristics/ExecuteProtectionSupport.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [HardwareThreadPerCore](DmiProperty.Processor.Characteristics/HardwareThreadPerCore.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MultiCore](DmiProperty.Processor.Characteristics/MultiCore.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [PowerPerformanceControlSupport](DmiProperty.Processor.Characteristics/PowerPerformanceControlSupport.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [Processor](./DmiProperty.Processor.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.IpmiDevice.Interrupt/SpecifiedInfo.md
# DmiProperty.IpmiDevice.Interrupt.SpecifiedInfo property
Gets a value representing the key to retrieve the property value.
Interrupt information specified.
Key Composition
* Structure: IpmiDevice
* Property: SpecifiedInfo
* Unit: None
Return Value
Type: Boolean
```csharp
public static IPropertyKey SpecifiedInfo { get; }
```
## See Also
* class [Interrupt](../DmiProperty.IpmiDevice.Interrupt.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/SmbiosStructure.cs
using iTin.Core.Hardware.Common;
namespace iTin.Hardware.Specification.Smbios;
/// <summary>
/// Known <see cref="SMBIOS"/> structures.
/// </summary>
public enum SmbiosStructure
{
/// <summary>
/// <b>Bios</b> structure, for more information please see <see cref="SmbiosType000"/>.
/// </summary>
[PropertyName("BIOS")]
[PropertyDescription("")]
Bios = 0x00,
/// <summary>
/// <b>System</b> structure, for more information please see <see cref="SmbiosType001"/>.
/// </summary>
[PropertyName("System")]
[PropertyDescription("")]
System = 0x01,
/// <summary>
/// <b>BaseBoard</b> structure, for more information please see <see cref="SmbiosType002"/>.
/// </summary>
[PropertyName("Base Board")]
[PropertyDescription("")]
BaseBoard = 0x02,
/// <summary>
/// <b>System Enclosure</b> structure, for more information please see <see cref="SmbiosType003"/>.
/// </summary>
[PropertyName("System Enclosure")]
[PropertyDescription("")]
SystemEnclosure = 0x03,
/// <summary>
/// <b>Processor</b> structure, for more information please see <see cref="SmbiosType004"/>.
/// </summary>
[PropertyName("Processor")]
[PropertyDescription("")]
Processor = 0x04,
/// <summary>
/// <b>Memory Controller</b> (obsolete) structure, for more information please see <see cref="SmbiosType005"/>.
/// </summary>
[PropertyName("Memory Controller")]
[PropertyDescription("")]
MemoryController = 0x05,
/// <summary>
/// <b>Memory Module</b> (obsolete) structure, for more information please see <see cref="SmbiosType006"/>.
/// </summary>
[PropertyName("Memory Module")]
[PropertyDescription("")]
MemoryModule = 0x06,
/// <summary>
/// <b>Cache Memory</b> structure, for more information please see <see cref="SmbiosType007"/>.
/// </summary>
[PropertyName("Cache")]
[PropertyDescription("")]
Cache = 0x07,
/// <summary>
/// <b>Port Connector</b> structure, for more information please see <see cref="SmbiosType008"/>.
/// </summary>
[PropertyName("Port Connector")]
[PropertyDescription("")]
PortConnector = 0x08,
/// <summary>
/// <b>System Slots</b> structure, for more information please see <see cref="SmbiosType009"/>.
/// </summary>
[PropertyName("System Slots")]
[PropertyDescription("")]
SystemSlots = 0x09,
/// <summary>
/// <b>On Board Devices</b> structure, for more information please see <see cref="SmbiosType010"/>.
/// </summary>
[PropertyName("On Board Devices")]
[PropertyDescription("")]
OnBoardDevices = 0x0a,
/// <summary>
/// <b>OEM Strings</b> structure, for more information please see <see cref="SmbiosType011"/>.
/// </summary>
[PropertyName("OEM Strings")]
[PropertyDescription("")]
OemStrings = 0x0b,
/// <summary>
/// <b>System Configuration Options</b> structure, for more information please see <see cref="SmbiosType012"/>.
/// </summary>
[PropertyName("System Configuration Options")]
[PropertyDescription("")]
SystemConfigurationOptions = 0x0c,
/// <summary>
/// <b>Bios Language</b> structure, for more information please see <see cref="SmbiosType013"/>.
/// </summary>
[PropertyName("Bios Language")]
[PropertyDescription("")]
BiosLanguage = 0x0d,
/// <summary>
/// <b>Group Associations</b> structure, for more information please see <see cref="SmbiosType014"/>.
/// </summary>
[PropertyName("Group Associations")]
[PropertyDescription("")]
GroupAssociations = 0x0e,
/// <summary>
/// <b>System Event Log</b> structure, for more information please see <see cref="SmbiosType015"/>.
/// </summary>
[PropertyName("System Event Log")]
[PropertyDescription("")]
SystemEventLog = 0x0f,
/// <summary>
/// <b>Physical Memory Array</b> structure, for more information please see <see cref="SmbiosType016"/>.
/// </summary>
[PropertyName("Physical Memory Array")]
[PropertyDescription("")]
PhysicalMemoryArray = 0x10,
/// <summary>
/// <b>Memory Device</b> structure, for more information please see <see cref="SmbiosType017"/>.
/// </summary>
[PropertyName("Memory Device")]
[PropertyDescription("")]
MemoryDevice = 0x11,
/// <summary>
/// <b>32-Bit Memory Error Information</b> structure, for more information please see <see cref="SmbiosType018"/>.
/// </summary>
[PropertyName("32-Bit Memory Error")]
[PropertyDescription("")]
BitMemoryError32 = 0x12,
/// <summary>
/// <b>Memory Array Mapped Address</b> structure, for more information please see <see cref="SmbiosType019"/>.
/// </summary>
[PropertyName("Memory Array Mapped Address")]
[PropertyDescription("")]
MemoryArrayMappedAddress = 0x13,
/// <summary>
/// <b>Memory Device Mapped Address</b> structure, for more information please see <see cref="SmbiosType020"/>.
/// </summary>
[PropertyName("Memory Device Mapped Address")]
[PropertyDescription("")]
MemoryDeviceMappedAddress = 0x14,
/// <summary>
/// <b>Built-in Pointing Device</b> structure, for more information please see <see cref="SmbiosType021"/>.
/// </summary>
[PropertyName("Built-In Pointing Device")]
[PropertyDescription("")]
BuiltInPointingDevice = 0x15,
/// <summary>
/// <b>Portable Battery</b> structure, for more information please see <see cref="SmbiosType022"/>.
/// </summary>
[PropertyName("Portable Battery")]
[PropertyDescription("")]
PortableBattery = 0x16,
/// <summary>
/// <b>System Reset</b> structure, for more information please see <see cref="SmbiosType023"/>.
/// </summary>
[PropertyName("System Reset")]
[PropertyDescription("")]
SystemReset = 0x17,
/// <summary>
/// <b>Hardware Security</b> structure, for more information please see <see cref="SmbiosType024"/>.
/// </summary>
[PropertyName("Hardware Security")]
[PropertyDescription("")]
HardwareSecurity = 0x18,
/// <summary>
/// <b>System Power Controls</b> structure, for more information please see <see cref="SmbiosType025"/>.
/// </summary>
[PropertyName("System Power Controls")]
[PropertyDescription("")]
SystemPowerControls = 0x19,
/// <summary>
/// <b>Voltage Probe</b> structure, for more information please see <see cref="SmbiosType026"/>.
/// </summary>
[PropertyName("Voltage Probe")]
[PropertyDescription("")]
VoltageProbe = 0x1a,
/// <summary>
/// <b>Cooling Device</b> structure, for more information please see <see cref="SmbiosType027"/>.
/// </summary>
[PropertyName("Cooling Device")]
[PropertyDescription("")]
CoolingDevice = 0x1b,
/// <summary>
/// <b>Temperature Probe</b> structure, for more information please see <see cref="SmbiosType028"/>.
/// </summary>
[PropertyName("Temperature Probe")]
[PropertyDescription("")]
TemperatureProbe = 0x1c,
/// <summary>
/// <b>Electrical Current Probe</b> structure, for more information please see <see cref="SmbiosType029"/>.
/// </summary>
[PropertyName("Bios")]
[PropertyDescription("")]
ElectricalCurrentProbe = 0x1d,
/// <summary>
/// <b>Out-Of-Band Remote</b> structure, for more information please see <see cref="SmbiosType030"/>.
/// </summary>
[PropertyName("Out Of Band Remote")]
[PropertyDescription("")]
OutOfBandRemote = 0x1e,
/// <summary>
/// <b>Boot Integrity Services (BIS) Entry Point</b> structure, for more information please see <see cref="SmbiosType031"/>.
/// </summary>
[PropertyName("Boot Integrity Services Entry Point")]
[PropertyDescription("")]
BootIntegrityServicesEntryPoint = 0x1f,
/// <summary>
/// <b>System Boot Information</b> structure, for more information please see <see cref="SmbiosType032"/>.
/// </summary>
[PropertyName("System Boot")]
[PropertyDescription("")]
SystemBoot = 0x20,
/// <summary>
/// <b>64-Bit Memory Error Information</b> structure, for more information please see <see cref="SmbiosType033"/>.
/// </summary>
[PropertyName("64-Bit Memory Error")]
[PropertyDescription("")]
BitMemoryError64 = 0x21,
/// <summary>
/// <b>Management Device</b> structure, for more information please see <see cref="SmbiosType034"/>.
/// </summary>
[PropertyName("Management Device")]
[PropertyDescription("")]
ManagementDevice = 0x22,
/// <summary>
/// <b>Management Device Component</b> structure, for more information please see <see cref="SmbiosType035"/>.
/// </summary>
[PropertyName("Management Device Component")]
[PropertyDescription("")]
ManagementDeviceComponent = 0x23,
/// <summary>
/// <b>Management Device Threshold Data</b> structure, for more information please see <see cref="SmbiosType036"/>.
/// </summary>
[PropertyName("Management Device Threshold Data")]
[PropertyDescription("")]
ManagementDeviceThresholdData = 0x24,
/// <summary>
/// <b>Memory Channel</b> structure, for more information please see <see cref="SmbiosType037"/>.
/// </summary>
[PropertyName("Memory Channel")]
[PropertyDescription("")]
MemoryChannel = 0x25,
/// <summary>
/// <b>IPMI Device Information</b> structure, for more information please see <see cref="SmbiosType038"/>.
/// </summary>
[PropertyName("IPMI Device")]
[PropertyDescription("")]
IpmiDevice = 0x26,
/// <summary>
/// <b>System Power Supply</b> structure, for more information please see <see cref="SmbiosType039"/>.
/// </summary>
[PropertyName("System Power Supply")]
[PropertyDescription("")]
SystemPowerSupply = 0x27,
/// <summary>
/// <b>Additional Information</b> structure, for more information please see <see cref="SmbiosType040"/>.
/// </summary>
[PropertyName("Additional Information")]
[PropertyDescription("")]
AdditionalInformation = 0x28,
/// <summary>
/// <b>OnBoard Devices Extended Information</b> structure, for more information please see <see cref="SmbiosType041"/>.
/// </summary>
[PropertyName("On Board Devices Extended")]
[PropertyDescription("")]
OnBoardDevicesExtended = 0x29,
/// <summary>
/// <b>Management Controller Host Interface</b> structure, for more information please see <see cref="SmbiosType042"/>.
/// </summary>
[PropertyName("Management Controller Host Interface")]
[PropertyDescription("")]
ManagementControllerHostInterface = 0x2A,
/// <summary>
/// <b>TPM Device</b> structure, for more information please see <see cref="SmbiosType043"/>.
/// </summary>
[PropertyName("TPM Device")]
[PropertyDescription("")]
TpmDevice = 0x2b,
/// <summary>
/// <b>Processor Additional Information</b> structure, for more information please see <see cref="SmbiosType044"/>.
/// </summary>
[PropertyName("Processor Additional Information")]
[PropertyDescription("")]
ProcessorAdditionalInformation = 0x2c,
/// <summary>
/// <b> Firmware Inventory Information</b> structure, for more information please see <see cref="SmbiosType045"/>.
/// </summary>
[PropertyName(" Firmware Inventory Information")]
[PropertyDescription("")]
FirmwareInventoryInformation = 0x2d,
/// <summary>
/// <b>String Property</b> structure, for more information please see <see cref="SmbiosType046"/>.
/// </summary>
[PropertyName("String Property")]
[PropertyDescription("")]
StringProperty = 0x2e,
/// <summary>
/// <b>Inactive</b> structure, for more information please see <see cref="SmbiosType126"/>.
/// </summary>
[PropertyName("Inactive")]
[PropertyDescription("")]
Inactive = 0x7e,
/// <summary>
/// <b>End-Of-Table</b> structure, for more information please see <see cref="SmbiosType127"/>.
/// </summary>
[PropertyName("End Of Table")]
[PropertyDescription("")]
EndOfTable = 0x7f,
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PhysicalMemoryArray.md
# DmiProperty.PhysicalMemoryArray class
Contains the key definitions available for a type 016 [PhysicalMemoryArray] structure.
```csharp
public static class PhysicalMemoryArray
```
## Public Members
| name | description |
| --- | --- |
| static [Location](DmiProperty.PhysicalMemoryArray/Location.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MaximumCapacity](DmiProperty.PhysicalMemoryArray/MaximumCapacity.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MemoryErrorCorrection](DmiProperty.PhysicalMemoryArray/MemoryErrorCorrection.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MemoryErrorInformationHandle](DmiProperty.PhysicalMemoryArray/MemoryErrorInformationHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [NumberOfMemoryDevices](DmiProperty.PhysicalMemoryArray/NumberOfMemoryDevices.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Use](DmiProperty.PhysicalMemoryArray/Use.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemSlots/SlotPhysicalWidth.md
# DmiProperty.SystemSlots.SlotPhysicalWidth property
Gets a value representing the key to retrieve the property value.
Indicates the physical width of the slot whereas [`SlotDataBusWidth`](./SlotDataBusWidth.md) property indicates the electrical width of the slot.
Key Composition
* Structure: SystemSlots
* Property: SlotPhysicalWidth
* Unit: None
Return Value
Type: String
Remarks
3.4
```csharp
public static IPropertyKey SlotPhysicalWidth { get; }
```
## See Also
* class [SystemSlots](../DmiProperty.SystemSlots.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Cache.md
# DmiProperty.Cache class
Contains the key definitions available for a type 007 [Cache Information] structure.
```csharp
public static class Cache
```
## Public Members
| name | description |
| --- | --- |
| static [Associativity](DmiProperty.Cache/Associativity.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [CacheSpeed](DmiProperty.Cache/CacheSpeed.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [CurrentSramType](DmiProperty.Cache/CurrentSramType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ErrorCorrectionType](DmiProperty.Cache/ErrorCorrectionType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [InstalledCacheSize](DmiProperty.Cache/InstalledCacheSize.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [InstalledCacheSize2](DmiProperty.Cache/InstalledCacheSize2.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MaximumCacheSize](DmiProperty.Cache/MaximumCacheSize.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MaximumCacheSize2](DmiProperty.Cache/MaximumCacheSize2.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SocketDesignation](DmiProperty.Cache/SocketDesignation.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SupportedSramTypes](DmiProperty.Cache/SupportedSramTypes.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SystemCacheType](DmiProperty.Cache/SystemCacheType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static class [CacheConfiguration](DmiProperty.Cache.CacheConfiguration.md) | Contains the key definition for the CacheConfiguration section. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType045 [Firmware Inventory Information].cs
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using iTin.Core;
using iTin.Core.Helpers.Enumerations;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 045: Firmware Inventory Information.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 45 Firmware Inventory Information |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE Varies Length of the structure, computed by the BIOS as 24 + |
// | (2 *n), where n is the Number of Associated |
// | Components |
// | NOTE: To allow future structure growth by appending |
// | information after the Associated Components |
// | Handles list, this field must not be used to |
// | determine the number of Associated Components |
// | Handles specified within the structure. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies Handle, or instance number, associated with the |
// | structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Firmware BYTE STRING String number of the Firmware Component Name. |
// | Component Name EXAMPLE: ‘BMC Firmware’,0 |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Firmware BYTE STRING String number of the Firmware Version of this |
// | Version firmware. |
// | The format of this value is defined by the Version |
// | Format. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h Version Format BYTE Varies |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h Firmware ID BYTE STRING String number of the Firmware ID of this firmware. |
// | The format of this value is defined by the Firmware |
// | ID Format. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h Firmware ID BYTE Varies |
// | Format |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 09h Release BYTE STRING String number of the firmware release date |
// | Date The date string, if supplied, follows the Date-Tim |
// | values format, as defined in DSP0266. |
// | |
// | EXAMPLE: '2021-05-15T04:14:33+06:00',0 |
// | |
// | EXAMPLE: When the time is unknown or not specified. |
// | '2021-05-15T00:00:00Z',0 |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ah Manufacturer BYTE STRING String number of the manufacturer or producer of this |
// | firmware |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Bh Lowest BYTE STRING String number of the lowest version to which this |
// | Supported firmware can be rolled back to. The format of this |
// | Firmware value is defined by the Version Format. |
// | Version |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ch Image Size QWORD Varies Size of the firmware image that is currently |
// | programmed in the device, in bytes. If the Firmware |
// | Image Size is unknown, the field is set to |
// | FFFFFFFFFFFFFFFFh |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 14h Characteristics WORD Bit Field Firmware characteristics information |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 16h State BYTE Varies Firmware state information |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 17h Number of BYTE Varies Defines how many Associated Component Handles are |
// | Associated associated with this firmware. |
// | Components (n) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 18h Associated n WORDS Varies Lists the SMBIOS structure handles that are |
// | Components associated with this firmware, if any. Value of |
// | Handles Number of Associated Components field (n) defines the |
// | count. |
// | |
// | NOTE: This list may contain zero or more handles to |
// | any SMBIOS structure that represents a device |
// | with a firmware component. For example, this |
// | |
// | · Type 9 handle (for describing the firmware of |
// | a device in a slot) |
// | |
// | · Type 17 handle (for describing the firmware |
// | of a memory device) |
// | |
// | · Type 41 handle (for describing the firmware |
// | of an onboard device) |
// | |
// | · Type 43 handle (for describing the firmware |
// | of a TPM device) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Firmware Inventory Information (Type 45) structure.
/// </summary>
internal sealed class SmbiosType045 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType045"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType045(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private readonly properties
#region Version 3.5 fields
/// <summary>
/// Gets a value representing the <b>Firmware Component Name</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string FirmwareComponentName => GetString(0x04);
/// <summary>
/// Gets a value representing the <b>Firmware Version</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string FirmwareVersion => GetString(0x05);
/// <summary>
/// Gets a value representing the <b>Firmware Version Format</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte FirmwareVersionFormat => Reader.GetByte(0x06);
/// <summary>
/// Gets a value representing the <b>Firmware Id</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string FirmwareId => GetString(0x07);
/// <summary>
/// Gets a value representing the <b>Firmware Id Format</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte FirmwareIdFormat => Reader.GetByte(0x08);
/// <summary>
/// Gets a value representing the <b>Firmware Release Date</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string FirmwareReleaseDate => GetString(0x09);
/// <summary>
/// Gets a value representing the <b>Firmware Manufacturer</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string FirmwareManufacturer => GetString(0x0a);
/// <summary>
/// Gets a value representing the <b>Lowest Supported Firmware Version</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string LowestSupportedFirmwareVersion => GetString(0x0b);
/// <summary>
/// Gets a value representing the <b>Firmware Image Size</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ulong FirmwareImageSize => (ulong) Reader.GetQuadrupleWord(0x17);
/// <summary>
/// Gets a value representing the <b>Firmware Characteristics</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int FirmwareCharacteristics => Reader.GetWord(0x14);
/// <summary>
/// Gets a value representing the <b>Firmware State</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte FirmwareState => Reader.GetByte(0x16);
/// <summary>
/// Gets a value representing the <b>Number Of Associated Components (n)</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte NumberOfAssociatedComponentsCount => Reader.GetByte(0x17);
#endregion
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
#region 3.5
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v35)
{
properties.Add(SmbiosProperty.FirmwareInventoryInformation.FirmwareComponentName, FirmwareComponentName);
properties.Add(SmbiosProperty.FirmwareInventoryInformation.FirmwareVersion, FirmwareVersion);
properties.Add(SmbiosProperty.FirmwareInventoryInformation.FirmwareVersionFormat, GetFirmwareVersionFormat(FirmwareVersionFormat));
properties.Add(SmbiosProperty.FirmwareInventoryInformation.FirmwareId, FirmwareId);
properties.Add(SmbiosProperty.FirmwareInventoryInformation.FirmwareIdFormat, GetFirmwareIdFormat(FirmwareIdFormat));
properties.Add(SmbiosProperty.FirmwareInventoryInformation.FirmwareReleaseDate, FirmwareReleaseDate);
properties.Add(SmbiosProperty.FirmwareInventoryInformation.FirmwareManufacturer, FirmwareManufacturer);
properties.Add(SmbiosProperty.FirmwareInventoryInformation.LowestSupportedFirmwareVersion, LowestSupportedFirmwareVersion);
properties.Add(SmbiosProperty.FirmwareInventoryInformation.FirmwareImageSize, FirmwareImageSize);
properties.Add(SmbiosProperty.FirmwareInventoryInformation.FirmwareCharacteristics, GetFirmwareCharacteristics(FirmwareCharacteristics));
properties.Add(SmbiosProperty.FirmwareInventoryInformation.FirmwareState, GetFirmwareState(FirmwareState));
properties.Add(SmbiosProperty.FirmwareInventoryInformation.NumberOfAssociatedComponents, NumberOfAssociatedComponentsCount);
properties.Add(SmbiosProperty.FirmwareInventoryInformation.AssociatedComponentHandles, GetAssociatedComponentHandles(NumberOfAssociatedComponentsCount));
}
#endregion
}
#endregion
#region BIOS Specification 3.5.0 (15/09/2021)
/// <summary>
/// Gets a string representing the current firmware version format.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The current firmware version format.
/// </returns>
private static string GetFirmwareVersionFormat(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"Disabled",
"Enabled",
"Absent",
"StandbyOffline",
"StandbySpare",
"UnavailableOffline", // 0x08
};
if (code >= 0x01 && code <= 0x08)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string representing the current firmware id format.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The current firmware id format.
/// </returns>
private static string GetFirmwareIdFormat(byte code)
{
if (code >= 0x00 && code <= 0x01)
{
string[] value =
{
"Free-form string",
"UEFI GUID or UEFI Firmware Management Protocol Image TypeId"
};
if (code >= 0x00 && code <= 0x01)
{
return value[code];
}
}
else if (code >= 0x02 && code <= 0x7f)
{
return "Future assignment by this specification";
}
return "BIOS Vendor/OEM-specific";
}
/// <summary>
/// Gets a string representing the current firmware Characteristics.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The current firmware Characteristics.
/// </returns>
private static ReadOnlyCollection<string> GetFirmwareCharacteristics(int code)
{
var values = new Collection<string>();
var isUpdatable = code.CheckBit(Bits.Bit00);
if (isUpdatable)
{
values.Add("Updatable: This firmware can be updated by software.");
}
var writeProtect = code.CheckBit(Bits.Bit01);
if (writeProtect)
{
values.Add("Write-Protect: This firmware is in a write-protected state.");
}
return new ReadOnlyCollection<string>(values);
}
/// <summary>
/// Gets a string representing the current firmware state.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The current firmware state.
/// </returns>
private static string GetFirmwareState(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"Disabled",
"Enabled",
"Absent",
"StandbyOffline",
"StandbySpare",
"UnavailableOffline", // 0x08
};
if (code >= 0x01 && code <= 0x08)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
private IEnumerable<uint> GetAssociatedComponentHandles(byte count)
{
var values = new Collection<uint>();
for (byte i = 0, offset=0; i < count; i++, offset+=2)
{
values.Add((uint) Reader.GetWord((byte)(0x18 + offset)));
}
return values;
}
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType014 [Group Associations].cs
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using iTin.Core;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 014: Group Associations.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 14 Group Associations Indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE Varies 5 + (3 bytes for each item in the group). |
// | The user of this structure determines the number of |
// | items as (Length - 5) / 3. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Group Name BYTE STRING String number of string describing the group |
// | Note: See GroupName |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Item Type BYTE Varies Item (Structure) Type of this member |
// | Note: See GetContainedElements(byte[], int) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h Item Handle WORD Varies Handle corresponding to this structure |
// | Note: See GetContainedElements(byte[], int) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Group Associations (Type 14) structure.
/// </summary>
internal sealed class SmbiosType014 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType014"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType014(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Group Name</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string GroupName => GetString(0x04);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
properties.Add(SmbiosProperty.GroupAssociations.GroupName, GroupName);
int n = (StructureInfo.Length - 5) / 3;
byte[] containedElementsArray = StructureInfo.RawData.Extract(0x05, n * 3).ToArray();
IEnumerable<GroupAssociationElement> containedElements = GetContainedElements(containedElementsArray, n);
properties.Add(SmbiosProperty.GroupAssociations.ContainedElements, new GroupAssociationElementCollection(containedElements));
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets the list of items that this group contains.
/// </summary>
/// <param name="rawValueArray">Raw information.</param>
/// <param name="n">Number of items to be treated.</param>
/// <returns>
/// Collection of elements contained in this group.
/// </returns>
private static IEnumerable<GroupAssociationElement> GetContainedElements(byte[] rawValueArray, int n)
{
int m = rawValueArray.Length / n;
Collection<GroupAssociationElement> containedElements = new Collection<GroupAssociationElement>();
for (int i = 0; i < rawValueArray.Length; i += m)
{
byte[] value = rawValueArray.Extract(i, m).ToArray();
containedElements.Add(new GroupAssociationElement(value));
}
return containedElements;
}
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/Specific/DmiMemoryChannelElement.cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// This class represents an element of the structure <see cref="DmiType037"/>.
/// </summary>
public class DmiMemoryChannelElement
{
#region private members
private readonly SmbiosPropertiesTable _reference;
#endregion
#region constructor/s
/// <summary>
/// Initialize a new instance of the class <see cref="DmiMemoryChannelElement"/>.
/// </summary>
/// <param name="reference"><b>SMBIOS</b> properties.</param>
internal DmiMemoryChannelElement(SmbiosPropertiesTable reference)
{
_reference = reference;
}
#endregion
#region public properties
/// <summary>
/// Gets the properties available for this structure.
/// </summary>
/// <value>
/// Availables properties.
/// </value>
public DmiClassPropertiesTable Properties =>
new()
{
{DmiProperty.MemoryChannel.MemoryDevices.Load, _reference[SmbiosProperty.MemoryChannel.MemoryDevices.Load]},
{DmiProperty.MemoryChannel.MemoryDevices.Handle, _reference[SmbiosProperty.MemoryChannel.MemoryDevices.Handle]}
};
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType036 [Management Device Threshold Data].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Management Device Threshold Data (Type 36) structure.<br/>
/// For more information, please see <see cref="SmbiosType036"/>.
/// </summary>
internal sealed class DmiType036 : DmiBaseType<SmbiosType036>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType036"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType036(SmbiosType036 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion < DmiStructureVersion.Latest)
{
return;
}
ushort lowerNonCritical = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.ManagementDeviceThresholdData.LowerNonCritical);
if (lowerNonCritical != 0x8000)
{
properties.Add(DmiProperty.ManagementDeviceThresholdData.LowerNonCritical, lowerNonCritical);
}
ushort upperNonCritical = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.ManagementDeviceThresholdData.UpperNonCritical);
if (upperNonCritical != 0x8000)
{
properties.Add(DmiProperty.ManagementDeviceThresholdData.UpperNonCritical, upperNonCritical);
}
ushort lowerCritical = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.ManagementDeviceThresholdData.LowerCritical);
if (lowerCritical != 0x8000)
{
properties.Add(DmiProperty.ManagementDeviceThresholdData.LowerCritical, lowerCritical);
}
ushort upperCritical = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.ManagementDeviceThresholdData.UpperCritical);
if (upperCritical != 0x8000)
{
properties.Add(DmiProperty.ManagementDeviceThresholdData.UpperCritical, upperCritical);
}
ushort lowerNonRecoverable = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.ManagementDeviceThresholdData.LowerNonRecoverable);
if (lowerNonRecoverable != 0x8000)
{
properties.Add(DmiProperty.ManagementDeviceThresholdData.LowerNonRecoverable, lowerNonRecoverable);
}
ushort upperNonRecoverable = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.ManagementDeviceThresholdData.UpperNonRecoverable);
if (upperNonRecoverable != 0x8000)
{
properties.Add(DmiProperty.ManagementDeviceThresholdData.UpperNonRecoverable, upperNonRecoverable);
}
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryModule.md
# DmiProperty.MemoryModule class
Contains the key definitions available for a type 006, obsolete [MemoryModule Information] structure.
```csharp
public static class MemoryModule
```
## Public Members
| name | description |
| --- | --- |
| static [BankConnections](DmiProperty.MemoryModule/BankConnections.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [CurrentMemoryType](DmiProperty.MemoryModule/CurrentMemoryType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [CurrentSpeed](DmiProperty.MemoryModule/CurrentSpeed.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [EnabledSize](DmiProperty.MemoryModule/EnabledSize.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ErrorStatus](DmiProperty.MemoryModule/ErrorStatus.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [InstalledSize](DmiProperty.MemoryModule/InstalledSize.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SocketDesignation](DmiProperty.MemoryModule/SocketDesignation.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Chassis/ContainedElements.md
# DmiProperty.Chassis.ContainedElements property
Gets a value representing the key to retrieve the property value.
Number of contained Element records that follow, in the range 0 to 255.
Key Composition
* Structure: SystemEnclosure
* Property: ContainedElements
* Unit: None
Return Value
Type: [`DmiChassisContainedElementCollection`](../../iTin.Hardware.Specification.Dmi/DmiChassisContainedElementCollection.md)
Remarks
2.3+
```csharp
public static IPropertyKey ContainedElements { get; }
```
## See Also
* class [Chassis](../DmiProperty.Chassis.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiMemoryControllerContainedElementCollection.md
# DmiMemoryControllerContainedElementCollection class
Represents a collection of memory device identifiers.
```csharp
public sealed class DmiMemoryControllerContainedElementCollection : ReadOnlyCollection<int>
```
## Public Members
| name | description |
| --- | --- |
| override [ToString](DmiMemoryControllerContainedElementCollection/ToString.md)() | Returns a class String that represents the current object. |
## See Also
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor/CoreEnabled2.md
# DmiProperty.Processor.CoreEnabled2 property
Gets a value representing the key to retrieve the property value.
Number of enabled cores per processor socket. Supports core enabled counts >255 If this field is present, it holds the core enabled count for the processor socket. Core Enabled will also hold the core enabled count, except for core counts that are 256 or greater. In that case, core enabled shall be set to FFh and core enabled 2 will hold the count.
Key Composition
* Structure: Processor
* Property: CoreEnabled2
* Unit: None
Return Value
Type: UInt16
Remarks
3.0+
```csharp
public static IPropertyKey CoreEnabled2 { get; }
```
## See Also
* class [Processor](../DmiProperty.Processor.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice.md
# DmiProperty.MemoryDevice class
Contains the key definitions available for a type 017 [MemoryDevice] structure.
```csharp
public static class MemoryDevice
```
## Public Members
| name | description |
| --- | --- |
| static [AssetTag](DmiProperty.MemoryDevice/AssetTag.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [BankLocator](DmiProperty.MemoryDevice/BankLocator.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [CacheSize](DmiProperty.MemoryDevice/CacheSize.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [ConfiguredMemoryClockSpeed](DmiProperty.MemoryDevice/ConfiguredMemoryClockSpeed.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [ConfiguredVoltage](DmiProperty.MemoryDevice/ConfiguredVoltage.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [DataWidth](DmiProperty.MemoryDevice/DataWidth.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [DeviceLocator](DmiProperty.MemoryDevice/DeviceLocator.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [DeviceSet](DmiProperty.MemoryDevice/DeviceSet.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [ExtendedConfiguredMemorySpeed](DmiProperty.MemoryDevice/ExtendedConfiguredMemorySpeed.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [ExtendedSpeed](DmiProperty.MemoryDevice/ExtendedSpeed.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [FirmwareVersion](DmiProperty.MemoryDevice/FirmwareVersion.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [FormFactor](DmiProperty.MemoryDevice/FormFactor.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [LogicalSize](DmiProperty.MemoryDevice/LogicalSize.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [Manufacturer](DmiProperty.MemoryDevice/Manufacturer.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [MaximumVoltage](DmiProperty.MemoryDevice/MaximumVoltage.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [MemoryErrorInformationHandle](DmiProperty.MemoryDevice/MemoryErrorInformationHandle.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [MemoryOperatingModeCapability](DmiProperty.MemoryDevice/MemoryOperatingModeCapability.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MemorySubsystemControllerManufacturerId](DmiProperty.MemoryDevice/MemorySubsystemControllerManufacturerId.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [MemorySubsystemControllerProductId](DmiProperty.MemoryDevice/MemorySubsystemControllerProductId.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [MemoryTechnology](DmiProperty.MemoryDevice/MemoryTechnology.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MemoryType](DmiProperty.MemoryDevice/MemoryType.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [MinimumVoltage](DmiProperty.MemoryDevice/MinimumVoltage.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [ModuleManufacturerId](DmiProperty.MemoryDevice/ModuleManufacturerId.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [ModuleProductId](DmiProperty.MemoryDevice/ModuleProductId.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [NonVolatileSize](DmiProperty.MemoryDevice/NonVolatileSize.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [PartNumber](DmiProperty.MemoryDevice/PartNumber.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [PhysicalMemoryArrayHandle](DmiProperty.MemoryDevice/PhysicalMemoryArrayHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [PMIC0ManufacturerId](DmiProperty.MemoryDevice/PMIC0ManufacturerId.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [PMIC0RevisionNumber](DmiProperty.MemoryDevice/PMIC0RevisionNumber.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [Rank](DmiProperty.MemoryDevice/Rank.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [RCDManufacturerId](DmiProperty.MemoryDevice/RCDManufacturerId.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [RCDRevisionNumber](DmiProperty.MemoryDevice/RCDRevisionNumber.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [SerialNumber](DmiProperty.MemoryDevice/SerialNumber.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [Size](DmiProperty.MemoryDevice/Size.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [Speed](DmiProperty.MemoryDevice/Speed.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [TotalWidth](DmiProperty.MemoryDevice/TotalWidth.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [TypeDetail](DmiProperty.MemoryDevice/TypeDetail.md) { get; } | Gets a value representing the key to retrieve the property. |
| static [VolatileSize](DmiProperty.MemoryDevice/VolatileSize.md) { get; } | Gets a value representing the key to retrieve the property. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType037 [Memory Channel].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Memory Channel (Type 37) structure.<br/>
/// For more information, please see <see cref="SmbiosType037"/>.
/// </summary>
sealed class DmiType037 : DmiBaseType<SmbiosType037>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType037"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType037(SmbiosType037 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion < DmiStructureVersion.Latest)
{
return;
}
properties.Add(DmiProperty.MemoryChannel.ChannelType, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryChannel.ChannelType));
properties.Add(DmiProperty.MemoryChannel.MaximunChannelLoad, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryChannel.MaximumChannelLoad));
object devices = SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryChannel.Devices);
if (devices != null)
{
properties.Add(DmiProperty.MemoryChannel.Devices, new DmiMemoryChannelElementCollection((MemoryChannelElementCollection) devices));
}
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiStructureClass.md
# DmiStructureClass enumeration
Known [`DMI`](../iTin.Hardware.Specification/DMI.md) structures.
```csharp
public enum DmiStructureClass
```
## Values
| name | value | description |
| --- | --- | --- |
| Bios | `0` | Bios structure, for more information please see DmiType000. |
| System | `1` | System structure, for more information please see DmiType001. |
| BaseBoard | `2` | BaseBoard structure, for more information please see DmiType002. |
| SystemEnclosure | `3` | System Enclosure structure, for more information please see DmiType003. |
| Processor | `4` | Processor structure, for more information please see DmiType004. |
| MemoryController | `5` | Memory Controller (obsolete) structure, for more information please see DmiType005. |
| MemoryModule | `6` | Memory Module (obsolete) structure, for more information please see DmiType006. |
| Cache | `7` | Cache Memory structure, for more information please see DmiType007. |
| PortConnector | `8` | Port Connector structure, for more information please see DmiType008. |
| SystemSlots | `9` | System Slots structure, for more information please see DmiType009. |
| OnBoardDevices | `10` | On Board Devices structure, for more information please see DmiType010. |
| OemStrings | `11` | OEM Strings structure, for more information please see DmiType011. |
| SystemConfigurationOptions | `12` | System Configuration Options structure, for more information please see DmiType012. |
| BiosLanguage | `13` | Bios Language structure, for more information please see DmiType013. |
| GroupAssociations | `14` | Group Associations structure, for more information please see DmiType014. |
| SystemEventLog | `15` | System Event Log structure, for more information please see DmiType015. |
| PhysicalMemoryArray | `16` | Physical Memory Array structure, for more information please see DmiType016. |
| MemoryDevice | `17` | Memory Device structure, for more information please see DmiType017. |
| BitMemoryError32 | `18` | 32-Bit Memory Error Information structure, for more information please see DmiType018. |
| MemoryArrayMappedAddress | `19` | Memory Array Mapped Address structure, for more information please see DmiType019. |
| MemoryDeviceMappedAddress | `20` | Memory Device Mapped Address structure, for more information please see DmiType020. |
| BuiltInPointingDevice | `21` | Built-in Pointing Device structure, for more information please see DmiType021. |
| PortableBattery | `22` | Portable Battery structure, for more information please see DmiType022. |
| SystemReset | `23` | System Reset structure, for more information please see DmiType023. |
| HardwareSecurity | `24` | Hardware Security structure, for more information please see DmiType024. |
| SystemPowerControls | `25` | System Power Controls structure, for more information please see DmiType025. |
| VoltageProbe | `26` | Voltage Probe structure, for more information please see DmiType026. |
| CoolingDevice | `27` | Cooling Device structure, for more information please see DmiType027. |
| TemperatureProbe | `28` | Temperature Probe structure, for more information please see DmiType028. |
| ElectricalCurrentProbe | `29` | Electrical Current Probe structure, for more information please see DmiType029. |
| OutOfBandRemote | `30` | Out-Of-Band Remote structure, for more information please see DmiType030. |
| BootIntegrityServicesEntryPoint | `31` | Boot Integrity Services (BIS) Entry Point structure, for more information please see DmiType031. |
| SystemBoot | `32` | System Boot Information structure, for more information please see DmiType032. |
| BitMemoryError64 | `33` | 64-Bit Memory Error Information structure, for more information please see DmiType033. |
| ManagementDevice | `34` | Management Device structure, for more information please see DmiType034. |
| ManagementDeviceComponent | `35` | Management Device Component structure, for more information please see DmiType035. |
| ManagementDeviceThresholdData | `36` | Management Device Threshold Data structure, for more information please see DmiType036. |
| MemoryChannel | `37` | Memory Channel structure, for more information please see DmiType037. |
| IpmiDevice | `38` | IPMI Device Information structure, for more information please see DmiType038. |
| SystemPowerSupply | `39` | System Power Supply structure, for more information please see DmiType039. |
| AdditionalInformation | `40` | Additional Information structure, for more information please see DmiType040. |
| OnBoardDevicesExtended | `41` | OnBoard Devices Extended Information structure, for more information please see DmiType041. |
| ManagementControllerHostInterface | `42` | Management Controller Host Interface structure, for more information please see DmiType042. |
| TpmDevice | `43` | TPM Device structure, for more information please see DmiType043. |
| ProcessorAdditionalInformation | `44` | TPM Device structure, for more information please see DmiType044. |
| FirmwareInventoryInformation | `45` | Firmware Inventory Information structure, for more information please see DmiType045. |
| StringProperty | `46` | String Property structure, for more information please see DmiType046. |
| Inactive | `126` | Inactive structure, for more information please see DmiType126. |
| EndOfTable | `127` | End-Of-Table structure, for more information please see DmiType127. |
## See Also
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/DmiStructureFactory.cs
using iTin.Hardware.Specification.Smbios;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// The static class <see cref="DmiStructureFactory"/> creates the <see cref="DMI"/> structures.
/// </summary>
internal static class DmiStructureFactory
{
/// <summary>
/// Create list of available structures.
/// </summary>
/// <param name="smbiosType">Structure information.</param>
/// <param name="smbiosVersion"><see cref="SMBIOS"/> version.</param>
/// <returns>
/// A class whichs implements <see cref="IDmiType"/> interface.
/// </returns>
public static IDmiType Create(SmbiosBaseType smbiosType, int smbiosVersion)
{
IDmiType result = smbiosType switch
{
SmbiosType000 type000 => new DmiType000(type000, smbiosVersion),
SmbiosType001 type001 => new DmiType001(type001, smbiosVersion),
SmbiosType002 type002 => new DmiType002(type002, smbiosVersion),
SmbiosType003 type003 => new DmiType003(type003, smbiosVersion),
SmbiosType004 type004 => new DmiType004(type004, smbiosVersion),
SmbiosType005 type005 => new DmiType005(type005, smbiosVersion),
SmbiosType006 type006 => new DmiType006(type006, smbiosVersion),
SmbiosType007 type007 => new DmiType007(type007, smbiosVersion),
SmbiosType008 type008 => new DmiType008(type008, smbiosVersion),
SmbiosType009 type009 => new DmiType009(type009, smbiosVersion),
SmbiosType010 type010 => new DmiType010(type010, smbiosVersion),
SmbiosType011 type011 => new DmiType011(type011, smbiosVersion),
SmbiosType012 type012 => new DmiType012(type012, smbiosVersion),
SmbiosType013 type013 => new DmiType013(type013, smbiosVersion),
SmbiosType014 type014 => new DmiType014(type014, smbiosVersion),
SmbiosType015 type015 => new DmiType015(type015, smbiosVersion),
SmbiosType016 type016 => new DmiType016(type016, smbiosVersion),
SmbiosType017 type017 => new DmiType017(type017, smbiosVersion),
SmbiosType018 type018 => new DmiType018(type018, smbiosVersion),
SmbiosType019 type019 => new DmiType019(type019, smbiosVersion),
SmbiosType020 type020 => new DmiType020(type020, smbiosVersion),
SmbiosType021 type021 => new DmiType021(type021, smbiosVersion),
SmbiosType022 type022 => new DmiType022(type022, smbiosVersion),
SmbiosType023 type023 => new DmiType023(type023, smbiosVersion),
SmbiosType024 type024 => new DmiType024(type024, smbiosVersion),
SmbiosType025 type025 => new DmiType025(type025, smbiosVersion),
SmbiosType026 type026 => new DmiType026(type026, smbiosVersion),
SmbiosType027 type027 => new DmiType027(type027, smbiosVersion),
SmbiosType028 type028 => new DmiType028(type028, smbiosVersion),
SmbiosType029 type029 => new DmiType029(type029, smbiosVersion),
SmbiosType030 type030 => new DmiType030(type030, smbiosVersion),
SmbiosType031 type031 => new DmiType031(type031, smbiosVersion),
SmbiosType032 type032 => new DmiType032(type032, smbiosVersion),
SmbiosType033 type033 => new DmiType033(type033, smbiosVersion),
SmbiosType034 type034 => new DmiType034(type034, smbiosVersion),
SmbiosType035 type035 => new DmiType035(type035, smbiosVersion),
SmbiosType036 type036 => new DmiType036(type036, smbiosVersion),
SmbiosType037 type037 => new DmiType037(type037, smbiosVersion),
SmbiosType038 type038 => new DmiType038(type038, smbiosVersion),
SmbiosType039 type039 => new DmiType039(type039, smbiosVersion),
SmbiosType040 type040 => new DmiType040(type040, smbiosVersion),
SmbiosType041 type041 => new DmiType041(type041, smbiosVersion),
SmbiosType042 type042 => new DmiType042(type042, smbiosVersion),
SmbiosType043 type043 => new DmiType043(type043, smbiosVersion),
SmbiosType044 type044 => new DmiType044(type044, smbiosVersion),
SmbiosType045 type045 => new DmiType045(type045, smbiosVersion),
SmbiosType046 type046 => new DmiType046(type046, smbiosVersion),
SmbiosType126 type126 => new DmiType126(type126, smbiosVersion),
SmbiosType127 type127 => new DmiType127(type127, smbiosVersion),
_ => null
};
return result;
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Bios/BiosReleaseDate.md
# DmiProperty.Bios.BiosReleaseDate property
Gets a value representing the key to retrieve the property value.
String number of the BIOS release date. The date string, if supplied, is in either mm/dd/yy or mm/dd/yyyy format. If the year portion of the string is two digits, the year is assumed to be 19yy. The mm/dd/yyyy format is required for SMBIOS version 2.3 and later.
Key Composition
* Structure: Bios
* Property: BiosReleaseDate
* Unit: None
Return Value
Type: String
Remarks
2.0+
```csharp
public static IPropertyKey BiosReleaseDate { get; }
```
## See Also
* class [Bios](../DmiProperty.Bios.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType006 [Memory Module Information (Obsolete)].cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using iTin.Core;
using iTin.Core.Helpers.Enumerations;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 006: Memory Module Information.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length deviceProperty Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 6 Memory Module Configuration Indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE 0Ch |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Socket BYTE STRING Number of null-terminated string |
// | Designation EXAMPLE: ‘J202’,0 |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Bank BYTE Varies Each nibble indicates a bank (RAS#) connection; 0xF |
// | Connections means no connection. |
// | EXAMPLE: If banks 1 & 3 (RAS# 1 & 3) were connected |
// | to a SIMM socket the byte for that socket |
// | would be 13h. |
// | If only bank 2 (RAS 2) were connected, the |
// | byte for that socket would be 2Fh. |
// | Note: Please see, GetBankConnections(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h Current Speed BYTE Varies The speed of the memory module, in ns (for example, |
// | 70d for a 70ns module). |
// | If the speed is unknown, the field is set to 0. |
// | Note: Please see, GetMemorySpeeds(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h Current Memory WORD Bit Field Note: Please see, GetCurrentMemoryTypes(int) |
// | Type |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 09h Installed Size BYTE Varies Note: Please see, GetSize(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ah Enabled Size BYTE Varies Note: Please see, GetSize(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Bh Error Status BYTE Varies Bits 07:03 - Reserved, must be zero |
// | |
// | Bit 02 - If set, the Error Status information |
// | should be obtained from the event log; |
// | bits 1 and 0 are reserved. |
// | |
// | Bit 01 - Correctable errors received for the |
// | module, if set. This bit is reset only |
// | during a system reset. |
// | |
// | Bit 00 - Uncorrectable errors received for the |
// | module, if set. All or a portion of the |
// | module has been disabled. This bit is |
// | only reset on power-on. |
// | Note: Please see, GetErrorStatus(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Memory Module Information (Type 6, Obsolete) structure.
/// </summary>
internal sealed class SmbiosType006 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType006"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType006(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Socket Designation</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string SocketDesignation => Strings[StructureInfo.RawData[0x04]];
/// <summary>
/// Gets a value representing the <b>Bank Connections</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte BankConnections => Reader.GetByte(0x05);
/// <summary>
/// Gets a value representing the <b>Current Speed</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte CurrentSpeed => Reader.GetByte(0x06);
/// <summary>
/// Gets a value representing the <b>Current Memory Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int CurrentMemoryType => Reader.GetWord(0x07);
/// <summary>
/// Gets a value representing the <b>Installed Size</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte InstalledSize => Reader.GetByte(0x09);
/// <summary>
/// Gets a value representing the <b>Enabled Size</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte EnabledSize => Reader.GetByte(0x0a);
/// <summary>
/// Gets a value representing the <b>Error Status</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ErrorStatus => Reader.GetByte(0x0b);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion <= SmbiosStructureVersion.Latest)
{
return;
}
properties.Add(SmbiosProperty.MemoryModule.SocketDesignation, SocketDesignation);
properties.Add(SmbiosProperty.MemoryModule.BankConnections, GetBankConnections(BankConnections));
properties.Add(SmbiosProperty.MemoryModule.CurrentSpeed, GetMemorySpeeds(CurrentSpeed));
properties.Add(SmbiosProperty.MemoryModule.CurrentMemoryType, GetCurrentMemoryTypes(CurrentMemoryType));
properties.Add(SmbiosProperty.MemoryModule.InstalledSize, GetSize(InstalledSize));
properties.Add(SmbiosProperty.MemoryModule.EnabledSize, GetSize(EnabledSize));
properties.Add(SmbiosProperty.MemoryModule.ErrorStatus, GetErrorStatus(ErrorStatus));
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets a collection that represents the available memory banks.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// An available memory bank collection
/// </returns>
private static ReadOnlyCollection<string> GetBankConnections(byte code)
{
var items = new List<string>();
byte[] nibbles = code.ToNibbles();
foreach (byte nibble in nibbles)
{
if (nibble != 0x0f)
{
items.Add($"RAS#{nibble}");
}
}
return items.AsReadOnly();
}
/// <summary>
/// Gets a collection of supported memory types.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// An supported memory type collection
/// </returns>
private static ReadOnlyCollection<string> GetCurrentMemoryTypes(int code)
{
string[] deviceProperty =
{
"Other", // 0x00
"Unknown",
"Standard",
"Fast Page Mode",
"EDO",
"Parity",
"ECC",
"SIMM",
"DIMM",
"Burst EDO",
"SDRAM" // 0x0a
};
var items = new List<string>();
for (byte i = 0x00; i <= 0x0a; i++)
{
bool addType = code.CheckBit(i);
if (addType)
{
items.Add(deviceProperty[i]);
}
}
return items.AsReadOnly();
}
/// <summary>
/// Gets a string representing the error state.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// Error state.
/// </returns>
private static string GetErrorStatus(byte code)
{
string[] deviceProperty =
{
"No erros", // 0x00
"Correctable",
"View Event Log" // 0x02
};
if (code <= 0x02)
{
return deviceProperty[code];
}
return "Reserved";
}
/// <summary>
/// Gets a collection of supported speeds.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// A collection of supported speeds.
/// </returns>
private static ReadOnlyCollection<string> GetMemorySpeeds(byte code)
{
string[] deviceProperty =
{
"Other", // 0x00
"Unknown",
"70",
"60",
"50" // 0x04
};
List<string> items = new List<string>();
if (code == 0x00)
{
items.Add(deviceProperty[0x01]);
}
for (byte i = 0x00; i <= 0x04; i++)
{
bool addSpeed = code.CheckBit(i);
if (addSpeed)
{
items.Add(deviceProperty[i]);
}
}
return items.AsReadOnly();
}
// •————————————————————————————————————————————————————————————————————————————————————————•
// | BitsOffset Description |
// •————————————————————————————————————————————————————————————————————————————————————————•
// | Bit 07 Defines whether the memory module has: |
// | 0b - A single-bank connection |
// | 1b - Double-bank connection |
// | |
// | Bits 00:06 Size (n), where 2^n is the size in MB. |
// | Special-case: |
// | 7Dh - Not determinable (Installed Size only) |
// | 7Eh - Module is installed, but no memory has been enabled |
// | 7Fh - Not installed |
// •————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Returns a collection of available sizes.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// An available size collection.
/// </returns>
private static ReadOnlyCollection<string> GetSize(byte code)
{
var items = new List<string>();
switch(code)
{
case 0x7d:
items.Add("indeterminable");
break;
case 0x7e:
items.Add("Installed but not enabled");
break;
case 0x7f:
items.Add("Not installed");
break;
default:
int pow = code & 0x7f;
double size = Math.Pow(2, pow);
bool isdoubleBank = code.CheckBit(Bits.Bit07);
items.Add(isdoubleBank ? "double-bank" : "single-bank");
items.Add($"{size}");
break;
}
return items.AsReadOnly();
}
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/DmiClassPropertiesTable.cs
using iTin.Core.Hardware.Common.ComponentModel;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="BasePropertiesTable"/> class that stores the available properties for each data table.
/// </summary>
public class DmiClassPropertiesTable : BasePropertiesTable
{
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/IDmiType/ImplementedProperties.md
# IDmiType.ImplementedProperties property
Returns a list of implemented properties for a structure
```csharp
public IEnumerable<IPropertyKey> ImplementedProperties { get; }
```
## Return Value
A list of implemented properties for a structure.
## See Also
* interface [IDmiType](../IDmiType.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Core/iTin.Core.Hardware/iTin.Core.Hardware.Windows.Specification.Smbios/Firmware.cs
using System;
using System.Runtime.InteropServices;
using System.Text;
using iTin.Core.Interop.Windows.Development.SystemServices.SystemInformation.Firmware;
namespace iTin.Core.Hardware.Windows.Specification.Smbios;
/// <summary>
/// Methods for handle system firmware tables.
/// Based on <c>open-hardware-monitor</c> project, for more info, please see: https://searchcode.com/codesearch/view/3147305/ [Michael Möller].
/// </summary>
public static class Firmware
{
/// <summary>
/// Returns an array that contains the tables associated with the specified provider.
/// </summary>
/// <param name="provider">Table provider</param>
/// <returns>
/// Tables associated with the specified provider
/// </returns>
public static string[] EnumerateTables(FirmwareProvider provider)
{
int size;
try
{
size = NativeMethods.EnumSystemFirmwareTables((uint)provider, IntPtr.Zero, 0);
}
catch (DllNotFoundException)
{
return null;
}
catch (EntryPointNotFoundException)
{
return null;
}
IntPtr nativeBuffer = Marshal.AllocHGlobal(size);
NativeMethods.EnumSystemFirmwareTables((uint)provider, nativeBuffer, size);
byte[] buffer = nativeBuffer.ToByteArray(0, size);
string[] result = new string[size / 4];
for (int i = 0; i < result.Length; i++)
{
result[i] = Encoding.ASCII.GetString(buffer, 4 * i, 4);
}
return result;
}
/// <summary>
/// Returns raw data from the specified provider table.
/// </summary>
/// <param name="provider">Table provider</param>
/// <param name="table">Table name</param>
/// <returns>
/// Raw data for specified table.
/// </returns>
public static byte[] GetTable(FirmwareProvider provider, string table)
{
int id = table[3] << 24 | table[2] << 16 | table[1] << 8 | table[0];
return GetTable(provider, id);
}
/// <summary>
/// Returns raw data from the specified provider table.
/// </summary>
/// <param name="provider">Table provider</param>
/// <param name="table">Table name</param>
/// <returns>
/// Raw data for specified table.
/// </returns>
private static byte[] GetTable(FirmwareProvider provider, int table)
{
int size;
try
{
size = NativeMethods.GetSystemFirmwareTable((uint)provider, table, IntPtr.Zero, 0);
}
catch (DllNotFoundException)
{
return null;
}
catch (EntryPointNotFoundException)
{
return null;
}
if (size <= 0)
{
return null;
}
IntPtr nativeBuffer = Marshal.AllocHGlobal(size);
NativeMethods.GetSystemFirmwareTable((uint)provider, table, nativeBuffer, size);
return Marshal.GetLastWin32Error() != 0
? null
: nativeBuffer.ToByteArray(0, size);
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.IpmiDevice.Interrupt.md
# DmiProperty.IpmiDevice.Interrupt class
Definition of keys for the 'Interrupt' section.
```csharp
public static class Interrupt
```
## Public Members
| name | description |
| --- | --- |
| static [Polarity](DmiProperty.IpmiDevice.Interrupt/Polarity.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SpecifiedInfo](DmiProperty.IpmiDevice.Interrupt/SpecifiedInfo.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [TriggerMode](DmiProperty.IpmiDevice.Interrupt/TriggerMode.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [IpmiDevice](./DmiProperty.IpmiDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType005 [Memory Controller Information (Type 5, Obsolete)].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Memory Controller Information (Type 5, Obsolete) structure.<br/>
/// For more information, please see <see cref="SmbiosType005"/>.
/// </summary>
internal sealed class DmiType005 : DmiBaseType<SmbiosType005>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType005"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType005(SmbiosType005 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
properties.Add(DmiProperty.MemoryController.ErrorDetectingMethod, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryController.ErrorDetectingMethod));
properties.Add(DmiProperty.MemoryController.ErrorCorrectingCapabilities, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryController.ErrorCorrectingCapabilities));
properties.Add(DmiProperty.MemoryController.SupportedInterleave, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryController.SupportedInterleave));
properties.Add(DmiProperty.MemoryController.CurrentInterleave, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryController.CurrentInterleave));
properties.Add(DmiProperty.MemoryController.MaximumMemoryModuleSize, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryController.MaximumMemoryModuleSize));
properties.Add(DmiProperty.MemoryController.SupportedSpeeds, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryController.SupportedSpeeds));
properties.Add(DmiProperty.MemoryController.SupportedMemoryTypes, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryController.SupportedMemoryTypes));
properties.Add(DmiProperty.MemoryController.MemoryModuleVoltages, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryController.MemoryModuleVoltages));
properties.Add(DmiProperty.MemoryController.NumberMemorySlots, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryController.NumberMemorySlots));
object containedMemoryModules = SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryController.ContainedMemoryModules);
if (containedMemoryModules == null)
{
return;
}
properties.Add(DmiProperty.MemoryController.ContainedMemoryModules, new DmiMemoryControllerContainedElementCollection((MemoryControllerContainedElementCollection)containedMemoryModules));
properties.Add(DmiProperty.MemoryController.EnabledErrorCorrectingCapabilities, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryController.EnabledErrorCorrectingCapabilities));
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiStructureCollection/Contains.md
# DmiStructureCollection.Contains method
Determines whether the element with the specified key is in the collection.
```csharp
public bool Contains(DmiStructureClass resultKey)
```
| parameter | description |
| --- | --- |
| resultKey | One of the Results of SmbiosStructure that represents the key of the object [`DmiStructure`](../DmiStructure.md) to search. |
## Return Value
true if the object [`DmiStructure`](../DmiStructure.md) with the *resultKey* is in the collection; otherwise, it is false.
## Exceptions
| exception | condition |
| --- | --- |
| InvalidEnumArgumentException | |
## See Also
* enum [DmiStructureClass](../DmiStructureClass.md)
* class [DmiStructureCollection](../DmiStructureCollection.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Specific/PeerDevicesCollection.cs
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
namespace iTin.Hardware.Specification.Smbios;
/// <summary>
/// Represents a collection of objects <see cref="PeerDevice"/>.
/// </summary>
public sealed class PeerDevicesCollection : ReadOnlyCollection<PeerDevice>
{
#region constructor/s
/// <summary>
/// Initialize a new instance of the class <see cref="PeerDevicesCollection"/>.
/// </summary>
/// <param name="elements">Item list.</param>
internal PeerDevicesCollection(IEnumerable<PeerDevice> elements) : base(elements.ToList())
{
}
#endregion
#region public override methods
/// <summary>
/// Returns a class <see cref="string"/> that represents the current object.
/// </summary>
/// <returns>
/// Object <see cref="string"/> that represents the current <see cref="PeerDevicesCollection"/> class.
/// </returns>
/// <remarks>
/// This method returns a string that includes the number of available items.
/// </remarks>
public override string ToString() => $"Peers={Items.Count}";
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryChannel/ChannelType.md
# DmiProperty.MemoryChannel.ChannelType property
Gets a value representing the key to retrieve the property value.
Type of memory associated with the channel.
Key Composition
* Structure: MemoryChannel
* Property: ChannelType
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey ChannelType { get; }
```
## See Also
* class [MemoryChannel](../DmiProperty.MemoryChannel.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/SpecificDmiBaseType/PopulateProperties.md
# SpecificDmiBaseType.PopulateProperties method
Populates the property collection for this structure.
```csharp
protected virtual void PopulateProperties(DmiClassPropertiesTable properties)
```
| parameter | description |
| --- | --- |
| properties | Collection of properties of this structure. |
## See Also
* class [DmiClassPropertiesTable](../DmiClassPropertiesTable.md)
* class [SpecificDmiBaseType](../SpecificDmiBaseType.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.IpmiDevice.BaseAdressModifier.md
# DmiProperty.IpmiDevice.BaseAdressModifier class
Contains the key definition for the Base Adress Modifier section.
```csharp
public static class BaseAdressModifier
```
## Public Members
| name | description |
| --- | --- |
| static [LsBit](DmiProperty.IpmiDevice.BaseAdressModifier/LsBit.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [RegisterSpacing](DmiProperty.IpmiDevice.BaseAdressModifier/RegisterSpacing.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [IpmiDevice](./DmiProperty.IpmiDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Core/iTin.Core.Interop/iTin.Core.Interop.Windows.Smbios/Development/SystemServices/SystemInformation/Firmware/Enumerations/KnownProvider.cs
namespace iTin.Core.Interop.Windows.Development.SystemServices.SystemInformation.Firmware;
/// <summary>
/// Defines firmware tables
/// </summary>
public enum KnownProvider
{
/// <summary>
/// ACPI
/// </summary>
ACPI = (byte)'A' << 24 | (byte)'C' << 16 | (byte)'P' << 8 | (byte)'I',
/// <summary>
/// FIRM
/// </summary>
FIRM = (byte)'F' << 24 | (byte)'I' << 16 | (byte)'R' << 8 | (byte)'M',
/// <summary>
/// RSMB
/// </summary>
RSMB = (byte)'R' << 24 | (byte)'S' << 16 | (byte)'M' << 8 | (byte)'B'
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/MemorySizeUnit.md
# MemorySizeUnit enumeration
Defines the unit of measurement of the memory.
```csharp
public enum MemorySizeUnit
```
## Values
| name | value | description |
| --- | --- | --- |
| KB | `-1` | Memory expressed in kilobytes |
| MB | `0` | Memory expressed in megabytes |
| GB | `1` | Memory expressed in gigabytes |
| Reserved | `2` | Undefined |
## See Also
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiManagementControllerHostInterfaceProtocolRecordsCollection.md
# DmiManagementControllerHostInterfaceProtocolRecordsCollection class
Represents a collection of objects [`DmiManagementControllerHostInterfaceProtocolRecordsCollection`](./DmiManagementControllerHostInterfaceProtocolRecordsCollection.md).
```csharp
public sealed class DmiManagementControllerHostInterfaceProtocolRecordsCollection :
ReadOnlyCollection<DmiManagementControllerHostInterfaceProtocolRecord>
```
## Public Members
| name | description |
| --- | --- |
| override [ToString](DmiManagementControllerHostInterfaceProtocolRecordsCollection/ToString.md)() | Returns a class String that represents the current object. |
## See Also
* class [DmiManagementControllerHostInterfaceProtocolRecord](./DmiManagementControllerHostInterfaceProtocolRecord.md)
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/DmiConnectOptions.cs
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Defines remote user parameters
/// </summary>
public class DmiConnectOptions
{
/// <summary>
///
/// </summary>
/// <value>
/// </value>
public string MachineNameOrIpAddress { get; set; }
/// <summary>
///
/// </summary>
/// <value>
/// </value>
public string UserName { get; set; }
/// <summary>
///
/// </summary>
/// <value>
/// </value>
public string Password { get; set; }
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/DmiProperty.cs
using System;
using System.Collections.ObjectModel;
using System.Diagnostics.CodeAnalysis;
using iTin.Core.Hardware.Common;
namespace iTin.Hardware.Specification.Dmi.Property
{
/// <summary>
/// Defines available keys for the available devices of a system.
/// </summary>
public static partial class DmiProperty
{
#region [public] {static} (class) Bios: Contains the key definitions available for a type 000 [Bios Information] structure
/// <summary>
/// Contains the key definitions available for a type 000 [<see cref="DmiStructureClass.Bios"/> Information] structure.
/// </summary>
public static class Bios
{
#region version 2.0+
#region [public] {static} (IPropertyKey) Vendor: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of the BIOS Vendor’s Name.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Bios"/></description></item>
/// <item><description>Property: <see cref="DmiType000Property.Vendor"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Vendor => new PropertyKey(DmiStructureClass.Bios, DmiType000Property.Vendor);
#endregion
#region [public] {static} (IPropertyKey) BiosVersion: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of the BIOS Version.</para>
/// <para>This value is a free-form string that may contain core and <b>OEM</b> version information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Bios"/></description></item>
/// <item><description>Property: <see cref="DmiType000Property.BiosVersion"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey BiosVersion => new PropertyKey(DmiStructureClass.Bios, DmiType000Property.BiosVersion);
#endregion
#region [public] {static} (IPropertyKey) BiosStartSegment: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Segment location of BIOS starting address. This value is a free-form string that may contain core and <b>OEM</b> version information.
/// The size of the runtime BIOS image can be computed by subtracting the Starting Address Segment from 10000h and multiplying the result by 16.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Bios"/></description></item>
/// <item><description>Property: <see cref="DmiType000Property.BiosStartSegment"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey BiosStartSegment => new PropertyKey(DmiStructureClass.Bios, DmiType000Property.BiosStartSegment);
#endregion
#region [public] {static} (IPropertyKey) BiosReleaseDate: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// String number of the BIOS release date. The date string, if supplied, is in either mm/dd/yy or mm/dd/yyyy format. If the year portion of the string is two digits, the year is assumed to be 19yy.
/// The mm/dd/yyyy format is required for SMBIOS version 2.3 and later.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Bios"/></description></item>
/// <item><description>Property: <see cref="DmiType000Property.BiosReleaseDate"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey BiosReleaseDate => new PropertyKey(DmiStructureClass.Bios, DmiType000Property.BiosReleaseDate);
#endregion
#region [public] {static} (IPropertyKey) Characteristics: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Defines which functions the BIOS supports: <b>PCI</b>, <b>PCMCIA</b>, <b>Flash</b>, etc.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Bios"/></description></item>
/// <item><description>Property: <see cref="DmiType000Property.Characteristics"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Characteristics => new PropertyKey(DmiStructureClass.Bios, DmiType000Property.Characteristics);
#endregion
#endregion
#region version 2.4+
#region [public] {static} (IPropertyKey) CharacteristicsExtensionByte1: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Defines which functions the BIOS supports.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Bios"/></description></item>
/// <item><description>Property: <see cref="DmiType000Property.CharacteristicsExtensionByte1"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey CharacteristicsExtensionByte1 => new PropertyKey(DmiStructureClass.Bios, DmiType000Property.CharacteristicsExtensionByte1);
#endregion
#region [public] {static} (IPropertyKey) CharacteristicsExtensionByte2: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Defines which functions the BIOS supports.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Bios"/></description></item>
/// <item><description>Property: <see cref="DmiType000Property.CharacteristicsExtensionByte2"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey CharacteristicsExtensionByte2 => new PropertyKey(DmiStructureClass.Bios, DmiType000Property.CharacteristicsExtensionByte2);
#endregion
#region [public] {static} (IPropertyKey) SystemBiosMajorRelease: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the major release of the System BIOS.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Bios"/></description></item>
/// <item><description>Property: <see cref="DmiType000Property.SystemBiosMajorRelease"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="Nullable{T}"/> where <b>T</b> is <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.4+</para>
/// </para>
/// </summary>
public static IPropertyKey SystemBiosMajorRelease => new PropertyKey(DmiStructureClass.Bios, DmiType000Property.SystemBiosMajorRelease);
#endregion
#region [public] {static} (IPropertyKey) SystemBiosMinorRelease: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the minor release of the System BIOS.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Bios"/></description></item>
/// <item><description>Property: <see cref="DmiType000Property.SystemBiosMinorRelease"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="Nullable{T}"/> where <b>T</b> is <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.4+</para>
/// </para>
/// </summary>
public static IPropertyKey SystemBiosMinorRelease => new PropertyKey(DmiStructureClass.Bios, DmiType000Property.SystemBiosMinorRelease);
#endregion
#region [public] {static} (IPropertyKey) FirmwareMajorRelease: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the major release of the embedded controller firmware.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Bios"/></description></item>
/// <item><description>Property: <see cref="DmiType000Property.FirmwareMajorRelease"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="Nullable{T}"/> where <b>T</b> is <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.4+</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareMajorRelease => new PropertyKey(DmiStructureClass.Bios, DmiType000Property.FirmwareMajorRelease);
#endregion
#region [public] {static} (IPropertyKey) FirmwareMinorRelease: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the minor release of the embedded controller firmware.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Bios"/></description></item>
/// <item><description>Property: <see cref="DmiType000Property.FirmwareMinorRelease"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="Nullable{T}"/> where <b>T</b> is <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.4+</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareMinorRelease => new PropertyKey(DmiStructureClass.Bios, DmiType000Property.FirmwareMinorRelease);
#endregion
#endregion
#region version 2.0 - 3.1+
#region [public] {static} (IPropertyKey) BiosRomSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Size of the physical device containing the BIOS. For check measured unit, please see <see cref="BiosRomSizeUnit"/> property.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Bios"/></description></item>
/// <item><description>Property: <see cref="DmiType000Property.BiosRomSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+, 3.1+</para>
/// </para>
/// </summary>
public static IPropertyKey BiosRomSize => new PropertyKey(DmiStructureClass.Bios, DmiType000Property.BiosRomSize, PropertyUnit.None);
#endregion
#region [public] {static} (IPropertyKey) BiosRomSizeUnit: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Size of the physical device(s) containing the BIOS.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Bios"/></description></item>
/// <item><description>Property: <see cref="DmiType000Property.BiosRomSizeUnit"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="MemorySizeUnit"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+, 3.1+</para>
/// </para>
/// </summary>
public static IPropertyKey BiosRomSizeUnit => new PropertyKey(DmiStructureClass.Bios, DmiType000Property.BiosRomSizeUnit);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) System: Contains the key definitions available for a type 001 [System Information] structure
/// <summary>
/// Contains the key definitions available for a type 001 [<see cref="DmiStructureClass.System"/> Information] structure.
/// </summary>
public static class System
{
#region version 2.0+
#region [public] {static} (IPropertyKey) Manufacturer: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Manufacturer name</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.System"/></description></item>
/// <item><description>Property: <see cref="DmiType001Property.Manufacturer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Manufacturer => new PropertyKey(DmiStructureClass.System, DmiType001Property.Manufacturer);
#endregion
#region [public] {static} (IPropertyKey) ProductName: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Product name</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.System"/></description></item>
/// <item><description>Property: <see cref="DmiType001Property.ProductName"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ProductName => new PropertyKey(DmiStructureClass.System, DmiType001Property.ProductName);
#endregion
#region [public] {static} (IPropertyKey) Version: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Product Version.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.System"/></description></item>
/// <item><description>Property: <see cref="DmiType001Property.Version"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Version => new PropertyKey(DmiStructureClass.System, DmiType001Property.Version);
#endregion
#region [public] {static} (IPropertyKey) SerialNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Serial Number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.System"/></description></item>
/// <item><description>Property: <see cref="DmiType001Property.SerialNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SerialNumber => new PropertyKey(DmiStructureClass.System, DmiType001Property.SerialNumber);
#endregion
#endregion
#region version 2.1+
#region [public] {static} (IPropertyKey) UUID: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Universal unique ID number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.System"/></description></item>
/// <item><description>Property: <see cref="DmiType001Property.UUID"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey UUID => new PropertyKey(DmiStructureClass.System, DmiType001Property.UUID);
#endregion
#region [public] {static} (IPropertyKey) WakeUpType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the event that caused the system to power up.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.System"/></description></item>
/// <item><description>Property: <see cref="DmiType001Property.WakeUpType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey WakeUpType => new PropertyKey(DmiStructureClass.System, DmiType001Property.WakeUpType);
#endregion
#endregion
#region version 2.4+
#region [public] {static} (IPropertyKey) SkuNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// This text string identifies a particular computer configuration for sale.
/// It is sometimes also called a product ID or purchase order number.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.System"/></description></item>
/// <item><description>Property: <see cref="DmiType001Property.SkuNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.4+</para>
/// </para>
/// </summary>
public static IPropertyKey SkuNumber => new PropertyKey(DmiStructureClass.System, DmiType001Property.SkuNumber);
#endregion
#region [public] {static} (IPropertyKey) Family: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>This text string identifies the family to which a particular computer belongs.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.System"/></description></item>
/// <item><description>Property: <see cref="DmiType001Property.Family"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.4+</para>
/// </para>
/// </summary>
public static IPropertyKey Family => new PropertyKey(DmiStructureClass.System, DmiType001Property.Family);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) BaseBoard: Contains the key definitions available for a type 002 [Baseboard (or Module) Information] structure
/// <summary>
/// Contains the key definitions available for a type 002 [<see cref="DmiStructureClass.BaseBoard"/> (or Module) Information] structure.
/// </summary>
public static class BaseBoard
{
#region [public] {static} (IPropertyKey) Manufacturer: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Manufacturer name</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="DmiType002Property.Manufacturer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Manufacturer => new PropertyKey(DmiStructureClass.BaseBoard, DmiType002Property.Manufacturer);
#endregion
#region [public] {static} (IPropertyKey) Product: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Baseboard product.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="DmiType002Property.Product"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Product => new PropertyKey(DmiStructureClass.BaseBoard, DmiType002Property.Product);
#endregion
#region [public] {static} (IPropertyKey) Version: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Mainboard Version</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="DmiType002Property.Version"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Version => new PropertyKey(DmiStructureClass.BaseBoard, DmiType002Property.Version);
#endregion
#region [public] {static} (IPropertyKey) SerialNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Mainboard Serial Number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="DmiType002Property.SerialNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey SerialNumber => new PropertyKey(DmiStructureClass.BaseBoard, DmiType002Property.SerialNumber);
#endregion
#region [public] {static} (IPropertyKey) AssetTag: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Mainboard asset tag number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="DmiType002Property.AssetTag"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey AssetTag => new PropertyKey(DmiStructureClass.BaseBoard, DmiType002Property.AssetTag);
#endregion
#region [public] {static} (IPropertyKey) LocationInChassis: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String that describes this board's location.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="DmiType002Property.LocationInChassis"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey LocationInChassis => new PropertyKey(DmiStructureClass.BaseBoard, DmiType002Property.LocationInChassis);
#endregion
#region [public] {static} (IPropertyKey) ChassisHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with the chassis in which this board resides.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="DmiType002Property.ChassisHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="Nullable{T}"/> where <b>T</b> is <see cref="int"/></para>
/// </para>
/// </summary>
public static IPropertyKey ChassisHandle => new PropertyKey(DmiStructureClass.BaseBoard, DmiType002Property.ChassisHandle);
#endregion
#region [public] {static} (IPropertyKey) BoardType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Mainboard Type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="DmiType002Property.BoardType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey BoardType => new PropertyKey(DmiStructureClass.BaseBoard, DmiType002Property.BoardType);
#endregion
#region [public] {static} (IPropertyKey) NumberOfContainedObjectHandles: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number (0 to 255) of contained Object Handles that follow.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="DmiType002Property.NumberOfContainedObjectHandles"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey NumberOfContainedObjectHandles => new PropertyKey(DmiStructureClass.BaseBoard, DmiType002Property.NumberOfContainedObjectHandles);
#endregion
#region [public] {static} (IPropertyKey) ContainedElements: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>List of handles of other structures (for examples, Baseboard, Processor, Port, System Slots, Memory Device) that are contained by this baseboard.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="DmiType002Property.ContainedObjectHandles"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="BaseBoardContainedElementCollection"/></para>
/// </para>
/// </summary>
public static IPropertyKey ContainedElements => new PropertyKey(DmiStructureClass.BaseBoard, DmiType002Property.ContainedObjectHandles);
#endregion
#region nested classes
#region [public] {static} (class) Features: Contains the key definition for the 'Features' section
/// <summary>
/// Contains the key definition for the <b>Features</b> section.
/// </summary>
public static class Features
{
#region [public] {static} (IPropertyKey) IsHostingBoard: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if is hosting board.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="DmiType002Property.IsHostingBoard"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey IsHostingBoard => new PropertyKey(DmiStructureClass.BaseBoard, DmiType002Property.IsHostingBoard);
#endregion
#region [public] {static} (IPropertyKey) IsHotSwappable: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if mainboard is hot swappable.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="DmiType002Property.HotSwappable"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey IsHotSwappable => new PropertyKey(DmiStructureClass.BaseBoard, DmiType002Property.HotSwappable);
#endregion
#region [public] {static} (IPropertyKey) IsRemovable: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if mainboard is removable.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="DmiType002Property.IsRemovable"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey IsRemovable => new PropertyKey(DmiStructureClass.BaseBoard, DmiType002Property.IsRemovable);
#endregion
#region [public] {static} (IPropertyKey) IsReplaceable: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if mainboard is replaceable.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="DmiType002Property.IsReplaceable"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey IsReplaceable => new PropertyKey(DmiStructureClass.BaseBoard, DmiType002Property.IsReplaceable);
#endregion
#region [public] {static} (IPropertyKey) RequiredDaughterBoard: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if mainboard required a daughter board.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BaseBoard"/></description></item>
/// <item><description>Property: <see cref="DmiType002Property.RequiredDaughterBoard"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey RequiredDaughterBoard => new PropertyKey(DmiStructureClass.BaseBoard, DmiType002Property.RequiredDaughterBoard);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) Chassis: Contains the key definitions available for a type 003 [System Enclosure or Chassis] structure
/// <summary>
/// Contains the key definitions available for a type 003 [<see cref="DmiStructureClass.SystemEnclosure"/> Information] structure.
/// </summary>
public static class Chassis
{
#region version 2.0+
#region [public] {static} (IPropertyKey) Manufacturer: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Manufacturer name</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType001Property.Manufacturer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Manufacturer => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.Manufacturer);
#endregion
#region [public] {static} (IPropertyKey) Locked: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if chassis lock is present.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.Locked"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Locked => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.Locked);
#endregion
#region [public] {static} (IPropertyKey) ChassisType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Chassis Type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.ChassisType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ChassisType => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.ChassisType);
#endregion
#region [public] {static} (IPropertyKey) Version: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Chassis Version.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.Version"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Version => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.Version);
#endregion
#region [public] {static} (IPropertyKey) SerialNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Chassis Serial Number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.SerialNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SerialNumber => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.SerialNumber);
#endregion
#region [public] {static} (IPropertyKey) AssetTagNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Asset Tag Number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.AssetTagNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey AssetTagNumber => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.AssetTagNumber);
#endregion
#endregion
#region version 2.1+
#region [public] {static} (IPropertyKey) BootUpState: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>State of the enclosure when it was last booted.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.BootUpState"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey BootUpState => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.BootUpState);
#endregion
#region [public] {static} (IPropertyKey) PowerSupplyState: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>State of the enclosure’s power supply (or supplies) when last booted.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.PowerSupplyState"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey PowerSupplyState => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.PowerSupplyState);
#endregion
#region [public] {static} (IPropertyKey) ThermalState: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Thermal state of the enclosure when last booted.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.ThermalState"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey ThermalState => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.ThermalState);
#endregion
#region [public] {static} (IPropertyKey) SecurityStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Physical security status of the enclosure when last booted.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.SecurityStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey SecurityStatus => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.SecurityStatus);
#endregion
#endregion
#region version 2.3+
#region [public] {static} (IPropertyKey) OemDefined: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>OEM or BIOS vendor-specific information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.OemDefined"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey OemDefined => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.OemDefined);
#endregion
#region [public] {static} (IPropertyKey) Height: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Height of the enclosure, in 'U's A U is a standard unit of measure for the height of a rack or rack-mountable component and is equal to 1.75 inches or 4.445 cm.</para>
/// <para>A value of 00h indicates that the enclosure height is unspecified.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.Height"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.U"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey Height => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.Height, PropertyUnit.U);
#endregion
#region [public] {static} (IPropertyKey) NumberOfPowerCords: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of power cords associated with the enclosure or chassis.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.NumberOfPowerCords"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey NumberOfPowerCords => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.NumberOfPowerCords);
#endregion
#region [public] {static} (IPropertyKey) ContainedElements: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of contained Element records that follow, in the range 0 to 255.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.ContainedElements"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="DmiChassisContainedElementCollection"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey ContainedElements => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.ContainedElements);
#endregion
#endregion
#region version 2.7+
#region [public] {static} (IPropertyKey) SkuNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String describing the chassis or enclosure SKU number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.SkuNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey SkuNumber => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.SkuNumber);
#endregion
#endregion
#region nested classes
#region [public] {static} (class) Elements: Contains the key definition for the 'Elements' section
/// <summary>
/// Contains the key definition for the <b>Elements</b> section.
/// </summary>
public static class Elements
{
#region [public] {static} (IPropertyKey) ItemType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Type of element associated.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.ContainedType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey ItemType => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.ContainedType);
#endregion
#region [public] {static} (IPropertyKey) Min: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Specifies the minimum number of the element type that can be installed in the chassis for the chassis to properly operate, in the range 0 to 254.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.ContainedElementMinimum"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey Min => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.ContainedElementMinimum);
#endregion
#region [public] {static} (IPropertyKey) Max: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Specifies the maximum number of the element type that can be installed in the chassis, in the range 1 to 255.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.ContainedElementMaximum"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey Max => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.ContainedElementMaximum);
#endregion
#region [public] {static} (IPropertyKey) TypeSelect: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Type of select element associated.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEnclosure"/></description></item>
/// <item><description>Property: <see cref="DmiType003Property.ContainedTypeSelect"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ChassisContainedElementType"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey TypeSelect => new PropertyKey(DmiStructureClass.SystemEnclosure, DmiType003Property.ContainedTypeSelect);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) Processor: Contains the key definitions available for a type 004 [Processor Information] structure
/// <summary>
/// Contains the key definitions available for a type 004 [<see cref="DmiStructureClass.Processor"/> Information] structure.
/// </summary>
public static class Processor
{
#region version 2.0+
#region [public] {static} (IPropertyKey) SocketDesignation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Reference designation.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.SocketDesignation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SocketDesignation => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.SocketDesignation);
#endregion
#region [public] {static} (IPropertyKey) ProcessorType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String containing the type of processor.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.ProcessorType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ProcessorType => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.ProcessorType);
#endregion
#region [public] {static} (IPropertyKey) ProcessorFamily: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String containing the family of processor.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.ProcessorFamily"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Family => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.ProcessorFamily);
#endregion
#region [public] {static} (IPropertyKey) ProcessorManufacturer: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Processor manufacturer.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.ProcessorManufacturer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ProcessorManufacturer => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.ProcessorManufacturer);
#endregion
#region [public] {static} (IPropertyKey) ProcessorId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Raw processor identification data.</para>
/// <para>The Processor ID field contains processor-specific information that describes the processor’s features.</para>
/// <para>
/// <list type="bullet">
/// <item>
/// <term>x86</term>
/// <description>
/// <para>The field’s format depends on the processor’s support of the CPUID instruction. If the instruction is supported, the Processor ID field contains two DWORD-formatted values.</para>
/// <para>The first (offsets 08h-0Bh) is the EAX value returned by a CPUID instruction with input EAX set to 1; the second(offsets 0Ch-0Fh) is the EDX value returned by that instruction.</para>
/// </description>
/// </item>
/// <item>
/// <term>ARM32</term>
/// <description>
/// <para>The processor ID field contains two DWORD-formatted values. The first (offsets 08h-0Bh) is the contents of the Main ID Register(MIDR); the second(offsets 0Ch-0Fh) is zero.</para>
/// </description>
/// </item>
/// <item>
/// <term>ARM64</term>
/// <description>
/// <para>The processor ID field contains two DWORD-formatted values. The first (offsets 08h-0Bh) is the contents of the MIDR_EL1 register; the second (offsets 0Ch-0Fh) is zero.</para>
/// </description>
/// </item>
/// <item>
/// <term>RISC-V</term>
/// <description>
/// <para>The processor ID contains a QWORD Machine Vendor ID CSR (mvendroid) of RISC-V processor hart 0. More information of RISC-V class CPU feature is described in RISC-V processor additional information.</para>
/// </description>
/// </item>
/// </list>
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.ProcessorId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ProcessorId => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.ProcessorId);
#endregion
#region [public] {static} (IPropertyKey) ProcessorVersion: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String describing the processor.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.ProcessorVersion"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ProcessorVersion => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.ProcessorVersion);
#endregion
#region [public] {static} (IPropertyKey) ExternalClock: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>External Clock Frequency, in MHz.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.ExternalClock"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ExternalClock => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.ExternalClock, PropertyUnit.MHz);
#endregion
#region [public] {static} (IPropertyKey) MaximumSpeed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Maximum processor speed (in MHz) supported by the system for this processor socket 0E9h is for a 233 MHz processor. If the value is unknown, the field is set to 0.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.MaximumSpeed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MHz"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey MaximumSpeed => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.MaximumSpeed, PropertyUnit.MHz);
#endregion
#region [public] {static} (IPropertyKey) CurrentSpeed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Current processor speed (in MHz).</para>
/// <para>This field identifies the processor's speed at system boot; the processor may support more than one speed.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.CurrentSpeed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MHz"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CurrentSpeed => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.CurrentSpeed, PropertyUnit.MHz);
#endregion
#region [public] {static} (IPropertyKey) ProcessorUpgrade: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Processor upgrade value.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.ProcessorUpgrade"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey UpgradeMethod => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.ProcessorUpgrade);
#endregion
#endregion
#region version 2.1+
#region [public] {static} (IPropertyKey) L1CacheHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle of a cache information structure that defines the attributes of the primary (Level 1) cache for this processor.</para>
/// <para>
/// <list type="bullet">
/// <item><description>For version 2.1 and version 2.2 implementations, the value is 0FFFFh if the processor has no L1 cache.</description></item>
/// <item><description>For version 2.3 and later implementations, the value is 0FFFFh if the Cache Information structure is not provided.</description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.L1CacheHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey L1CacheHandle => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.L1CacheHandle);
#endregion
#region [public] {static} (IPropertyKey) L2CacheHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle of a cache information structure that defines the attributes of the secondary (Level 2) cache for this processor.</para>
/// <para>
/// <list type="bullet">
/// <item><description>For version 2.1 and version 2.2 implementations, the value is 0FFFFh if the processor has no L2 cache.</description></item>
/// <item><description>For version 2.3 and later implementations, the value is 0FFFFh if the Cache Information structure is not provided.</description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.L2CacheHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey L2CacheHandle => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.L2CacheHandle);
#endregion
#region [public] {static} (IPropertyKey) L3CacheHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle of a cache information structure that defines the attributes of the tertiary (Level 3) cache for this processor.</para>
/// <para>
/// <list type="bullet">
/// <item><description>For version 2.1 and version 2.2 implementations, the value is 0FFFFh if the processor has no L3 cache.</description></item>
/// <item><description>For version 2.3 and later implementations, the value is 0FFFFh if the Cache Information structure is not provided.</description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.L3CacheHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey L3CacheHandle => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.L3CacheHandle);
#endregion
#endregion
#region version 2.3+
#region [public] {static} (IPropertyKey) SerialNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Serial number of this processor. This value is set by the manufacturer and normally not changeable.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.SerialNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey SerialNumber => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.SerialNumber);
#endregion
#region [public] {static} (IPropertyKey) AssetTag: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Asset tag of this processor.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.AssetTag"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey AssetTag => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.AssetTag);
#endregion
#region [public] {static} (IPropertyKey) PartNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Asset tag of this processor.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.PartNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey PartNumber => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.PartNumber);
#endregion
#endregion
#region version 2.5+
#region [public] {static} (IPropertyKey) CoreCount: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Number of cores per processor socket. If the value is unknown, the field is set to 0.
/// Core Count is the number of cores detected by the BIOS for this processor socket. It does not necessarily indicate the full capability of the processor.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.CoreCount"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey CoreCount => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.CoreCount);
#endregion
#region [public] {static} (IPropertyKey) CoreEnabled: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of enabled cores per processor socket. If the value is unknown, the field is set 0.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.CoreEnabled"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey CoreEnabled => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.CoreEnabled);
#endregion
#region [public] {static} (IPropertyKey) ThreadCount: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Number of threads per processor socket. If the value is unknown, the field is set to 0.
/// For thread counts of 256 or greater, this property returns FFh and the <b>ThreadCount2</b> property is set to the number of threads.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.ThreadCount"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey ThreadCount => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.ThreadCount);
#endregion
#endregion
#region version 3.0+
#region [public] {static} (IPropertyKey) CoreCount2: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Number of cores per processor socket. Supports core counts >255.
/// If this field is present, it holds the core count for the processor socket.
/// Core Count will also hold the core count, except for core counts that are 256 or greater.
/// In that case, core Count shall be set to FFh and core Count 2 will hold the count.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.CoreCount2"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CoreCount2 => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.CoreCount2);
#endregion
#region [public] {static} (IPropertyKey) CoreEnabled2: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Number of enabled cores per processor socket. Supports core enabled counts >255
/// If this field is present, it holds the core enabled count for the processor socket.
/// Core Enabled will also hold the core enabled count, except for core counts that are 256 or greater.
/// In that case, core enabled shall be set to FFh and core enabled 2 will hold the count.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.CoreEnabled2"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CoreEnabled2 => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.CoreEnabled2);
#endregion
#region [public] {static} (IPropertyKey) ThreadCount2: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Number of threads per processor socket. Supports thread counts >255
/// If this field is present, it holds the thread count for the processor socket.
/// Thread Count will also hold the thread count, except for thread counts that are 256 or greater.
/// In that case, thread count shall be set to FFh and thread count 2 will hold the count.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.ThreadCount2"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ThreadCount2 => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.ThreadCount2);
#endregion
#endregion
#region version 3.6+
#region [public] {static} (IPropertyKey) ThreadEnabled: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Number of enabled threads per processor.
/// <list type="bullet">
/// <item><description>If the value is unknown, the field is set to 0000h.</description></item>
/// <item><description>If the value is valid, the field contains the thread enabled counts 1 to 65534, respectively </description></item>
/// <item><description>If the value is reserved, the field is set to ffffh</description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.ThreadEnabled"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.6+</para>
/// </para>
/// </summary>
public static IPropertyKey ThreadEnabled => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.ThreadEnabled);
#endregion
#endregion
#region nested classes
#region [public] {static} (class) Features: Contains the key definition for the 'Characteristics' section
/// <summary>
/// Contains the key definition for the <b>Characteristics</b> section.
/// </summary>
public static class Characteristics
{
#region [public] {static} (IPropertyKey) Arm64SocIdSupported: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>indicates that the processor supports returning a SoC ID value using the
/// SMCCC_ARCH_SOC_ID architectural call, as defined in the Arm SMC Calling Convention Specification v1.2 at
/// https://developer.arm.com/architectures/system-architectures/software-standards/smccc.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.Arm64SocIdSupported"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.4+</para>
/// </para>
/// </summary>
public static IPropertyKey Arm64SocIdSupported => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.Arm64SocIdSupported);
#endregion
#region [public] {static} (IPropertyKey) Capable64Bits: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// 64-bit Capable indicates the maximum data width capability of the processor.
/// For example, this bit is set for Intel Itanium, AMD Opteron, and Intel Xeon(with EM64T) processors; this bit is cleared for Intel Xeon processors that do not have EM64T.
/// Indicates the maximum capability of the processor and does not indicate the current enabled state.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.Capable64Bits"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey Capable64Bits => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.Capable64Bits);
#endregion
#region [public] {static} (IPropertyKey) Capable128Bits: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// 128-bit Capable indicates the maximum data width capability of the processor.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.Capable64Bits"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey Capable128Bits => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.Capable128Bits);
#endregion
#region [public] {static} (IPropertyKey) EnhancedVirtualizationInstructions: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates that the processor is capable of executing enhanced virtualization instructions. Does not indicate the present state of this feature.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.EnhancedVirtualizationInstructions"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey EnhancedVirtualizationInstructions => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.EnhancedVirtualizationInstructions);
#endregion
#region [public] {static} (IPropertyKey) ExecuteProtectionSupport: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Indicates that the processor supports marking specific memory regions as non-executable.
/// For example, this is the NX (No eXecute) feature of AMD processors and the XD (eXecute Disable) feature of Intel processors.
/// Does not indicate the present state of this feature.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.ExecuteProtectionSupport"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey ExecuteProtectionSupport => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.ExecuteProtectionSupport);
#endregion
#region [public] {static} (IPropertyKey) MultiCore: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates the processor has more than one core. Does not indicate the number of cores (Core Count) enabled by hardware or the number of cores (Core Enabled) enabled by BIOS.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.MultiCore"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey MultiCore => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.MultiCore);
#endregion
#region [public] {static} (IPropertyKey) HardwareThreadPerCore: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates that the processor supports multiple hardware threads per core. Does not indicate the state or number of threads.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.HardwareThreadPerCore"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey HardwareThreadPerCore => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.HardwareThreadPerCore);
#endregion
#region [public] {static} (IPropertyKey) PowerPerformanceControlSupport: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates that the processor is capable of load-based power savings. Does not indicate the present state of this feature.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.PowerPerformanceControlSupport"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.5+</para>
/// </para>
/// </summary>
public static IPropertyKey PowerPerformanceControlSupport => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.PowerPerformanceControlSupport);
#endregion
}
#endregion
#region [public] {static} (class) Status: Contains the key definition for the 'Status' section
/// <summary>
/// Contains the key definition for the <b>Status</b> section.
/// </summary>
public static class Status
{
#region [public] {static} (IPropertyKey) CpuStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String containing the current status of processor.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.CpuStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CpuStatus => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.CpuStatus);
#endregion
#region [public] {static} (IPropertyKey) SocketPopulated: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if CPU is populated.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.SocketPopulated"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SocketPopulated => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.SocketPopulated);
#endregion
}
#endregion
#region [public] {static} (class) Voltage: Contains the key definition for the 'Voltage' section
/// <summary>
/// Contains the key definition for the <b>Voltage</b> section.
/// </summary>
public static class Voltage
{
#region [public] {static} (IPropertyKey) IsLegacyMode: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicating 'legacy' mode for processor voltage</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.IsLegacyMode"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey IsLegacyMode => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.IsLegacyMode);
#endregion
#region [public] {static} (IPropertyKey) VoltageCapability: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Represent the specific voltages that the processor socket can accept.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Processor"/></description></item>
/// <item><description>Property: <see cref="DmiType004Property.VoltageCapability"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.V"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SupportedVoltages => new PropertyKey(DmiStructureClass.Processor, DmiType004Property.VoltageCapability, PropertyUnit.V);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) MemoryController: Contains the key definitions available for a type 005, obsolete [Memory Controller Information] structure
/// <summary>
/// Contains the key definitions available for a type 005, obsolete [<see cref="DmiStructureClass.MemoryController"/> Information] structure.
/// </summary>
public static class MemoryController
{
#region version 2.0+
#region [public] {static} (IPropertyKey) ErrorDetectingMethod: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Error detecting method.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryController"/></description></item>
/// <item><description>Property: <see cref="DmiType005Property.ErrorDetectingMethod"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ErrorDetectingMethod => new PropertyKey(DmiStructureClass.MemoryController, DmiType005Property.ErrorDetectingMethod);
#endregion
#region [public] {static} (IPropertyKey) ErrorCorrectingCapabilities: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Error detecting capabilities.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryController"/></description></item>
/// <item><description>Property: <see cref="DmiType005Property.ErrorCorrectingCapabilities"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ErrorCorrectingCapabilities => new PropertyKey(DmiStructureClass.MemoryController, DmiType005Property.ErrorCorrectingCapabilities);
#endregion
#region [public] {static} (IPropertyKey) SupportedInterleave: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Interleave supported.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryController"/></description></item>
/// <item><description>Property: <see cref="DmiType005Property.SupportedInterleave"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SupportedInterleave => new PropertyKey(DmiStructureClass.MemoryController, DmiType005Property.SupportedInterleave);
#endregion
#region [public] {static} (IPropertyKey) CurrentInterleave: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Current interleave.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryController"/></description></item>
/// <item><description>Property: <see cref="DmiType005Property.CurrentInterleave"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CurrentInterleave => new PropertyKey(DmiStructureClass.MemoryController, DmiType005Property.CurrentInterleave);
#endregion
#region [public] {static} (IPropertyKey) MaximumMemoryModuleSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Size of the largest memory module supported (per slot), specified as n, where 2**n is the maximum size in MB.
/// The maximum amount of memory supported by this controller is that value times the number of slots, as specified in <see cref="NumberMemorySlots"/> property.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryController"/></description></item>
/// <item><description>Property: <see cref="DmiType005Property.MaximumMemoryModuleSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="int"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey MaximumMemoryModuleSize => new PropertyKey(DmiStructureClass.MemoryController, DmiType005Property.MaximumMemoryModuleSize);
#endregion
#region [public] {static} (IPropertyKey) SupportedSpeeds: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>A string collection with supported speeds.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryController"/></description></item>
/// <item><description>Property: <see cref="DmiType005Property.SupportedSpeeds"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.ns"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SupportedSpeeds => new PropertyKey(DmiStructureClass.MemoryController, DmiType005Property.SupportedSpeeds, PropertyUnit.ns);
#endregion
#region [public] {static} (IPropertyKey) SupportedMemoryTypes: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>A string collection with supported memory types.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryController"/></description></item>
/// <item><description>Property: <see cref="DmiType005Property.SupportedMemoryTypes"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SupportedMemoryTypes => new PropertyKey(DmiStructureClass.MemoryController, DmiType005Property.SupportedMemoryTypes);
#endregion
#region [public] {static} (IPropertyKey) MemoryModuleVoltages: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>A string collection with memory module voltages.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryController"/></description></item>
/// <item><description>Property: <see cref="DmiType005Property.MemoryModuleVoltages"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryModuleVoltages => new PropertyKey(DmiStructureClass.MemoryController, DmiType005Property.MemoryModuleVoltages, PropertyUnit.V);
#endregion
#region [public] {static} (IPropertyKey) NumberMemorySlots: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of memory slots.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryController"/></description></item>
/// <item><description>Property: <see cref="DmiType005Property.NumberMemorySlots"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey NumberMemorySlots => new PropertyKey(DmiStructureClass.MemoryController, DmiType005Property.NumberMemorySlots);
#endregion
#region [public] {static} (IPropertyKey) ContainedMemoryModules: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contained memory modules reference.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryController"/></description></item>
/// <item><description>Property: <see cref="DmiType005Property.ContainedMemoryModules"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="DmiMemoryControllerContainedElementCollection"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey ContainedMemoryModules => new PropertyKey(DmiStructureClass.MemoryController, DmiType005Property.ContainedMemoryModules, PropertyUnit.None);
#endregion
#endregion
#region version 2.1+
#region [public] {static} (IPropertyKey) EnabledErrorCorrectingCapabilities: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the error-correcting capabilities that were enabled.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryController"/></description></item>
/// <item><description>Property: <see cref="DmiType005Property.EnabledErrorCorrectingCapabilities"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey EnabledErrorCorrectingCapabilities => new PropertyKey(DmiStructureClass.MemoryController, DmiType005Property.EnabledErrorCorrectingCapabilities);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) MemoryModule: Contains the key definitions available for a type 006, obsolete [Memory Module Information] structure
/// <summary>
/// Contains the key definitions available for a type 006, obsolete [<see cref="DmiStructureClass.MemoryModule"/> Information] structure.
/// </summary>
public static class MemoryModule
{
#region [public] {static} (IPropertyKey) SocketDesignation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number for reference designation.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryModule"/></description></item>
/// <item><description>Property: <see cref="DmiType006Property.SocketDesignation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey SocketDesignation => new PropertyKey(DmiStructureClass.MemoryModule, DmiType006Property.SocketDesignation);
#endregion
#region [public] {static} (IPropertyKey) BankConnections: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates a bank (RAS#) connection.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryModule"/></description></item>
/// <item><description>Property: <see cref="DmiType006Property.BankConnections"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey BankConnections => new PropertyKey(DmiStructureClass.MemoryModule, DmiType006Property.BankConnections);
#endregion
#region [public] {static} (IPropertyKey) CurrentSpeed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Speed of the memory module, in ns.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryModule"/></description></item>
/// <item><description>Property: <see cref="DmiType006Property.CurrentSpeed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.ns"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="Nullable{T}"/> where <b>T</b> is <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey CurrentSpeed => new PropertyKey(DmiStructureClass.MemoryModule, DmiType006Property.CurrentSpeed, PropertyUnit.ns);
#endregion
#region [public] {static} (IPropertyKey) CurrentMemoryType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Describes the physical characteristics of the memory modules that are supported by (and currently installed in) the system.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryModule"/></description></item>
/// <item><description>Property: <see cref="DmiType006Property.CurrentMemoryType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey CurrentMemoryType => new PropertyKey(DmiStructureClass.MemoryModule, DmiType006Property.CurrentMemoryType);
#endregion
#region [public] {static} (IPropertyKey) InstalledSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identify the size of the memory module that is installed in the socket, as determined by reading and correlating the module’s presence-detect information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryModule"/></description></item>
/// <item><description>Property: <see cref="DmiType006Property.InstalledSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey InstalledSize => new PropertyKey(DmiStructureClass.MemoryModule, DmiType006Property.InstalledSize, PropertyUnit.MB);
#endregion
#region [public] {static} (IPropertyKey) EnabledSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the amount of memory currently enabled for the system’s use from the module.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryModule"/></description></item>
/// <item><description>Property: <see cref="DmiType006Property.EnabledSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey EnabledSize => new PropertyKey(DmiStructureClass.MemoryModule, DmiType006Property.EnabledSize, PropertyUnit.MB);
#endregion
#region [public] {static} (IPropertyKey) ErrorStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies error status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryModule"/></description></item>
/// <item><description>Property: <see cref="DmiType006Property.ErrorStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ErrorStatus => new PropertyKey(DmiStructureClass.MemoryModule, DmiType006Property.ErrorStatus);
#endregion
}
#endregion
#region [public] {static} (class) Cache: Contains the key definitions available for a type 007 [Cache Information] structure
/// <summary>
/// Contains the key definitions available for a type 007 [<see cref="DmiStructureClass.Cache"/> Information] structure.
/// </summary>
public static class Cache
{
#region version 2.0+
#region [public] {static} (IPropertyKey) SocketDesignation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number for reference designation.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Cache"/></description></item>
/// <item><description>Property: <see cref="DmiType007Property.SocketDesignation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SocketDesignation => new PropertyKey(DmiStructureClass.Cache, DmiType007Property.SocketDesignation);
#endregion
#region [public] {static} (IPropertyKey) MaximumCacheSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Maximum size that can be installed.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Cache"/></description></item>
/// <item><description>Property: <see cref="DmiType007Property.MaximumCacheSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="int"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey MaximumCacheSize => new PropertyKey(DmiStructureClass.Cache, DmiType007Property.MaximumCacheSize, PropertyUnit.KB);
#endregion
#region [public] {static} (IPropertyKey) InstalledCacheSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Installed size.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Cache"/></description></item>
/// <item><description>Property: <see cref="DmiType007Property.InstalledCacheSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="int"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey InstalledCacheSize => new PropertyKey(DmiStructureClass.Cache, DmiType007Property.InstalledCacheSize, PropertyUnit.KB);
#endregion
#region [public] {static} (IPropertyKey) SupportedSramTypes: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String collection with supported SRAM types.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Cache"/></description></item>
/// <item><description>Property: <see cref="DmiType007Property.SupportedSramTypes"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SupportedSramTypes => new PropertyKey(DmiStructureClass.Cache, DmiType007Property.SupportedSramTypes);
#endregion
#region [public] {static} (IPropertyKey) CurrentSramType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Current SRAM type is installed.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Cache"/></description></item>
/// <item><description>Property: <see cref="DmiType007Property.SupportedSramTypes"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CurrentSramType => new PropertyKey(DmiStructureClass.Cache, DmiType007Property.CurrentSramType);
#endregion
#endregion
#region version 2.1+
#region [public] {static} (IPropertyKey) CacheSpeed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Cache module speed, in nanoseconds.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Cache"/></description></item>
/// <item><description>Property: <see cref="DmiType007Property.CacheSpeed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.ns"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey CacheSpeed => new PropertyKey(DmiStructureClass.Cache, DmiType007Property.CacheSpeed, PropertyUnit.ns);
#endregion
#region [public] {static} (IPropertyKey) ErrorCorrectionType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Error-correction scheme supported by this cache component.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Cache"/></description></item>
/// <item><description>Property: <see cref="DmiType007Property.ErrorCorrectionType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey ErrorCorrectionType => new PropertyKey(DmiStructureClass.Cache, DmiType007Property.ErrorCorrectionType);
#endregion
#region [public] {static} (IPropertyKey) SystemCacheType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Logical type of cache.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Cache"/></description></item>
/// <item><description>Property: <see cref="DmiType007Property.SystemCacheType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey SystemCacheType => new PropertyKey(DmiStructureClass.Cache, DmiType007Property.SystemCacheType);
#endregion
#region [public] {static} (IPropertyKey) Associativity: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Associativity of the cache.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Cache"/></description></item>
/// <item><description>Property: <see cref="DmiType007Property.Associativity"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Associativity => new PropertyKey(DmiStructureClass.Cache, DmiType007Property.Associativity);
#endregion
#endregion
#region version 3.1+
#region [public] {static} (IPropertyKey) MaximumCacheSize2: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>If is present, for cache sizes of 2047MB or smaller the value is equals to <see cref="MaximumCacheSize"/> property.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Cache"/></description></item>
/// <item><description>Property: <see cref="DmiType007Property.MaximumCacheSize2"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MaximumCacheSize2 => new PropertyKey(DmiStructureClass.Cache, DmiType007Property.MaximumCacheSize2, PropertyUnit.KB);
#endregion
#region [public] {static} (IPropertyKey) InstalledCacheSize2: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>If is present, for cache sizes of 2047MB or smaller the value is equals to <see cref="InstalledCacheSize"/> property.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Cache"/></description></item>
/// <item><description>Property: <see cref="DmiType007Property.InstalledCacheSize2"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.1+</para>
/// </para>
/// </summary>
public static IPropertyKey InstalledCacheSize2 => new PropertyKey(DmiStructureClass.Cache, DmiType007Property.InstalledCacheSize2, PropertyUnit.KB);
#endregion
#endregion
#region nested classes
#region [public] {static} (class) CacheConfiguration: Contains the key definition for the 'CacheConfiguration' section
/// <summary>
/// Contains the key definition for the <b>CacheConfiguration</b> section.
/// </summary>
public static class CacheConfiguration
{
#region [public] {static} (IPropertyKey) CacheEnabled: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if is enabled/disabled (at boot time).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Cache"/></description></item>
/// <item><description>Property: <see cref="DmiType007Property.CacheEnabled"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CacheEnabled => new PropertyKey(DmiStructureClass.Cache, DmiType007Property.CacheEnabled);
#endregion
#region [public] {static} (IPropertyKey) CacheLevel: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Returns cache level (1, 2, 3,...).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Cache"/></description></item>
/// <item><description>Property: <see cref="DmiType007Property.CacheLevel"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Level => new PropertyKey(DmiStructureClass.Cache, DmiType007Property.CacheLevel);
#endregion
#region [public] {static} (IPropertyKey) CacheLocation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Location, relative to the CPU module.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Cache"/></description></item>
/// <item><description>Property: <see cref="DmiType007Property.CacheLocation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Location => new PropertyKey(DmiStructureClass.Cache, DmiType007Property.CacheLocation);
#endregion
#region [public] {static} (IPropertyKey) OperationalMode: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Cache operational mode (Write Through, Write Back, ...).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Cache"/></description></item>
/// <item><description>Property: <see cref="DmiType007Property.OperationalMode"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey OperationalMode => new PropertyKey(DmiStructureClass.Cache, DmiType007Property.OperationalMode);
#endregion
#region [public] {static} (IPropertyKey) CacheSocketed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if cache is socketed.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Cache"/></description></item>
/// <item><description>Property: <see cref="DmiType007Property.CacheSocketed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CacheSocketed => new PropertyKey(DmiStructureClass.Cache, DmiType007Property.CacheSocketed);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) PortConnector: Contains the key definitions available for a type 008 [Port Connector Information] structure
/// <summary>
/// Contains the key definitions available for a type 008 [<see cref="DmiStructureClass.PortConnector"/> Information] structure.
/// </summary>
public static class PortConnector
{
#region [public] {static} (IPropertyKey) InternalReferenceDesignator: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number for Internal Reference Designator, that is, internal to the system enclosure.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortConnector"/></description></item>
/// <item><description>Property: <see cref="DmiType008Property.InternalReferenceDesignator"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey InternalReferenceDesignator => new PropertyKey(DmiStructureClass.PortConnector, DmiType008Property.InternalReferenceDesignator);
#endregion
#region [public] {static} (IPropertyKey) InternalConnectorType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Internal Connector type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortConnector"/></description></item>
/// <item><description>Property: <see cref="DmiType008Property.InternalConnectorType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey InternalConnectorType => new PropertyKey(DmiStructureClass.PortConnector, DmiType008Property.InternalConnectorType);
#endregion
#region [public] {static} (IPropertyKey) ExternalReferenceDesignator: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number for the External Reference Designation external to the system enclosure.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortConnector"/></description></item>
/// <item><description>Property: <see cref="DmiType008Property.ExternalReferenceDesignator"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ExternalReferenceDesignator => new PropertyKey(DmiStructureClass.PortConnector, DmiType008Property.ExternalReferenceDesignator);
#endregion
#region [public] {static} (IPropertyKey) ExternalConnectorType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>External Connector type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortConnector"/></description></item>
/// <item><description>Property: <see cref="DmiType008Property.ExternalConnectorType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ExternalConnectorType => new PropertyKey(DmiStructureClass.PortConnector, DmiType008Property.ExternalConnectorType);
#endregion
#region [public] {static} (IPropertyKey) PortType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Describes the function of the port.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortConnector"/></description></item>
/// <item><description>Property: <see cref="DmiType008Property.PortType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey PortType => new PropertyKey(DmiStructureClass.PortConnector, DmiType008Property.PortType);
#endregion
}
#endregion
#region [public] {static} (class) SystemSlots: Contains the key definitions available for a type 009 [System Slots] structure
/// <summary>
/// Contains the key definitions available for a type 009 [<see cref="DmiStructureClass.SystemSlots"/>] structure.
/// </summary>
public static class SystemSlots
{
#region version 2.0+
#region [public] {static} (IPropertyKey) SlotDesignation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number for reference designation.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.SlotDesignation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SlotDesignation => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.SlotDesignation);
#endregion
#region [public] {static} (IPropertyKey) SlotType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Slot type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.SlotType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SlotType => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.SlotType);
#endregion
#region [public] {static} (IPropertyKey) SlotDataBusWidth: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Slot Data Bus Width.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.SlotDataBusWidth"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SlotDataBusWidth => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.SlotDataBusWidth, PropertyUnit.None);
#endregion
#region [public] {static} (IPropertyKey) CurrentUsage: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Slot current usage.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.CurrentUsage"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey CurrentUsage => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.CurrentUsage);
#endregion
#region [public] {static} (IPropertyKey) SlotLength: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Slot length.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.SlotLength"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SlotLength => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.SlotLength);
#endregion
#region [public] {static} (IPropertyKey) SlotId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Slot Identifier.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.SlotId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey SlotId => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.SlotId);
#endregion
#endregion
#region version 2.0+ - 2.1+
#region [public] {static} (IPropertyKey) Characteristics: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Slot characteristics.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.SlotCharacteristics"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+, 2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Characteristics => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.SlotCharacteristics);
#endregion
#endregion
#region version 2.6+
#region [public] {static} (IPropertyKey) SegmentBusFunction: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Segment bus function.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.SegmentBusFunction"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+ - 2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey SegmentBusFunction => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.SegmentBusFunction);
#endregion
#region [public] {static} (IPropertyKey) BusDeviceFunction: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Bus device function.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.BusDeviceFunction"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.6+</para>
/// </para>
/// </summary>
public static IPropertyKey BusDeviceFunction => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.BusDeviceFunction);
#endregion
#endregion
#region version 3.2
#region [public] {static} (IPropertyKey) PeerDevices: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>The PCI Express Generation (e.g., PCI Express Generation 6).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.PeerDevices"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="DmiPeerDevicesCollection"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2</para>
/// </para>
/// </summary>
public static IPropertyKey PeerDevices => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.PeerDevices);
#endregion
#endregion
#region version 3.4
#region [public] {static} (IPropertyKey) SlotInformation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>The PCI Express Generation (e.g., PCI Express Generation 6).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.SlotInformation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.4</para>
/// </para>
/// </summary>
public static IPropertyKey SlotInformation => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.SlotInformation);
#endregion
#region [public] {static} (IPropertyKey) SlotPhysicalWidth: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates the physical width of the slot whereas <see cref="SystemSlots.SlotDataBusWidth"/> property indicates the electrical width of the slot.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.SlotPhysicalWidth"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.4</para>
/// </para>
/// </summary>
public static IPropertyKey SlotPhysicalWidth => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.SlotPhysicalWidth);
#endregion
#region [public] {static} (IPropertyKey) SlotPitch: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates the pitch of the slot in millimeters. The pitch is defined by each slot/card specification, but typically describes add-in card to add-in card pitch.</para>
/// <para>A value of 0 implies that the slot pitch is not given or is unknown.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.SlotPitch"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mm"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.4</para>
/// </para>
/// </summary>
public static IPropertyKey SlotPitch => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.SlotPitch, PropertyUnit.mm);
#endregion
#endregion
#region nested classes
#region [public] {static} (class) Peers: Contains the key definition for the 'Peers' section
/// <summary>
/// Contains the key definition for the <b>Peers</b> section.
/// </summary>
public static class Peers
{
#region [public] {static} (IPropertyKey) SegmentGroupNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Segment Group Number is defined in the PCI Firmware Specification. The value is 0 for a single-segment topology.</para>
/// <para>For PCI Express slots, Bus Number and Device/Function Number refer to the endpoint in the slot, not the upstream switch.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.SegmentGroupNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2</para>
/// </para>
/// </summary>
public static IPropertyKey SegmentGroupNumber => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.SegmentGroupNumber);
#endregion
#region [public] {static} (IPropertyKey) BusDeviceFunction: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Bus device function (Peer).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.BusDeviceFunctionPeer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2</para>
/// </para>
/// </summary>
public static IPropertyKey BusDeviceFunction => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.BusDeviceFunctionPeer);
#endregion
#region [public] {static} (IPropertyKey) DataBusWidth: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates electrical bus width of peer Segment/Bus/Device/Function.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemSlots"/></description></item>
/// <item><description>Property: <see cref="DmiType009Property.DataBusWidth"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2</para>
/// </para>
/// </summary>
public static IPropertyKey DataBusWidth => new PropertyKey(DmiStructureClass.SystemSlots, DmiType009Property.DataBusWidth);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) OnBoardDevices: Contains the key definitions available for a type 010, obsolete [On Board Devices Information] structure
/// <summary>
/// Contains the key definitions available for a type 010, obsolete [<see cref="DmiStructureClass.OnBoardDevices"/> Information] structure.
/// </summary>
public static class OnBoardDevices
{
#region [public] {static} (IPropertyKey) Enabled: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Device status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.OnBoardDevices"/></description></item>
/// <item><description>Property: <see cref="DmiType010Property.Enabled"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey Enabled => new PropertyKey(DmiStructureClass.OnBoardDevices, DmiType010Property.Enabled);
#endregion
#region [public] {static} (IPropertyKey) DeviceType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Device type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.OnBoardDevices"/></description></item>
/// <item><description>Property: <see cref="DmiType010Property.DeviceType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey DeviceType => new PropertyKey(DmiStructureClass.OnBoardDevices, DmiType010Property.DeviceType);
#endregion
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of device description.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.OnBoardDevices"/></description></item>
/// <item><description>Property: <see cref="DmiType010Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(DmiStructureClass.OnBoardDevices, DmiType010Property.Description);
#endregion
}
#endregion
#region [public] {static} (class) OemStrings: Contains the key definitions available for a type 011 [OEM Strings] structure
/// <summary>
/// Contains the key definitions available for a type 011 [<see cref="DmiStructureClass.OemStrings"/>] structure.
/// </summary>
public static class OemStrings
{
#region [public] {static} (IPropertyKey) Values: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains free-form strings defined by the OEM.</para>
/// <para>Examples of this are part numbers for system reference documents, contact information for the manufacturer, etc.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.OemStrings"/></description></item>
/// <item><description>Property: <see cref="DmiType011Property.Values"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Values => new PropertyKey(DmiStructureClass.OemStrings, DmiType011Property.Values);
#endregion
}
#endregion
#region [public] {static} (class) SystemConfigurationOptions: Contains the key definitions available for a type 012 [System Configuration Options] structure
/// <summary>
/// Contains the key definitions available for a type 012 [<see cref="DmiStructureClass.SystemConfigurationOptions"/>] structure.
/// </summary>
public static class SystemConfigurationOptions
{
#region [public] {static} (IPropertyKey) Values: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains information required to configure the baseboard’s Jumpers and Switches.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemConfigurationOptions"/></description></item>
/// <item><description>Property: <see cref="DmiType012Property.Values"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Values => new PropertyKey(DmiStructureClass.SystemConfigurationOptions, DmiType012Property.Values);
#endregion
}
#endregion
#region [public] {static} (class) BiosLanguage: Contains the key definitions available for a type 013 [BIOS Language Information] structure
/// <summary>
/// Contains the key definitions available for a type 013 [<see cref="DmiStructureClass.BiosLanguage"/> Information] structure.
/// </summary>
public static class BiosLanguage
{
#region version 2.0+
#region [public] {static} (IPropertyKey) InstallableLanguages: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of languages available. Each available language has a description string</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BiosLanguage"/></description></item>
/// <item><description>Property: <see cref="DmiType013Property.InstallableLanguages"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey InstallableLanguages => new PropertyKey(DmiStructureClass.BiosLanguage, DmiType013Property.InstallableLanguages);
#endregion
#region [public] {static} (IPropertyKey) Current: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Currently installed language.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BiosLanguage"/></description></item>
/// <item><description>Property: <see cref="DmiType013Property.Current"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.0+</para>
/// </para>
/// </summary>
public static IPropertyKey Current => new PropertyKey(DmiStructureClass.BiosLanguage, DmiType013Property.Current);
#endregion
#endregion
#region version 2.1+
#region [public] {static} (IPropertyKey) IsCurrentAbbreviated: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates if the abbreviated format is used.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BiosLanguage"/></description></item>
/// <item><description>Property: <see cref="DmiType013Property.IsCurrentAbbreviated"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey IsCurrentAbbreviated => new PropertyKey(DmiStructureClass.BiosLanguage, DmiType013Property.IsCurrentAbbreviated);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) GroupAssociations: Contains the key definitions available for a type 014 [Group Associations] structure
/// <summary>
/// Contains the key definitions available for a type 014 [<see cref="DmiStructureClass.GroupAssociations"/>] structure.
/// </summary>
public static class GroupAssociations
{
#region [public] {static} (IPropertyKey) ContainedElements: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>A collection of group association items.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.GroupAssociations"/></description></item>
/// <item><description>Property: <see cref="DmiType014Property.ContainedElements"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="DmiGroupAssociationElementCollection"/></para>
/// </para>
/// </summary>
public static IPropertyKey ContainedElements => new PropertyKey(DmiStructureClass.GroupAssociations, DmiType014Property.ContainedElements);
#endregion
#region [public] {static} (IPropertyKey) GroupName: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of string describing the group.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.GroupAssociations"/></description></item>
/// <item><description>Property: <see cref="DmiType014Property.GroupName"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey GroupName => new PropertyKey(DmiStructureClass.GroupAssociations, DmiType014Property.GroupName);
#endregion
#region nested classes
#region [public] {static} (class) Items: Contains the key definition for the 'Items' section
/// <summary>
/// Contains the key definition for the <b>Items</b> section.
/// </summary>
public static class Items
{
#region [public] {static} (IPropertyKey) Handle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle corresponding to a item collection.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.GroupAssociations"/></description></item>
/// <item><description>Property: <see cref="DmiType014Property.Handle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Handle => new PropertyKey(DmiStructureClass.GroupAssociations, DmiType014Property.Handle);
#endregion
#region [public] {static} (IPropertyKey) Structure: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Item (Structure) Type of this member.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.GroupAssociations"/></description></item>
/// <item><description>Property: <see cref="DmiType014Property.Structure"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="Smbios.SmbiosStructure"/></para>
/// </para>
/// </summary>
public static IPropertyKey Structure => new PropertyKey(DmiStructureClass.GroupAssociations, DmiType014Property.Structure);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) SystemEventLog: Contains the key definitions available for a type 015 [System Event Log] structure
/// <summary>
/// Contains the key definitions available for a type 015 [<see cref="DmiStructureClass.SystemEventLog"/>] structure.
/// </summary>
public static class SystemEventLog
{
#region [public] {static} (IPropertyKey) LogAreaLength: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>The length, in bytes, of the overall event log area</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="DmiType015Property.LogAreaLength"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="int"/></para>
/// </para>
/// </summary>
public static IPropertyKey LogAreaLength => new PropertyKey(DmiStructureClass.SystemEventLog, DmiType015Property.LogAreaLength);
#endregion
#region [public] {static} (IPropertyKey) LogHeaderStartOffset: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Defines the starting offset (or index) within the nonvolatile storage of the event-log’s header from the Access Method Address</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="DmiType015Property.LogHeaderStartOffset"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey LogHeaderStartOffset => new PropertyKey(DmiStructureClass.SystemEventLog, DmiType015Property.LogHeaderStartOffset);
#endregion
#region [public] {static} (IPropertyKey) DataStartOffset: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Defines the starting offset (or index) within the nonvolatile storage of the event-log’s first data byte, from the Access Method Address</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="DmiType015Property.DataStartOffset"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="int"/></para>
/// </para>
/// </summary>
public static IPropertyKey DataStartOffset => new PropertyKey(DmiStructureClass.SystemEventLog, DmiType015Property.DataStartOffset);
#endregion
#region [public] {static} (IPropertyKey) AccessMethod: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Defines the Location and Method used by higher-level software to access the log area</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="DmiType015Property.AccessMethod"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey AccessMethod => new PropertyKey(DmiStructureClass.SystemEventLog, DmiType015Property.AccessMethod);
#endregion
#region [public] {static} (IPropertyKey) LogStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Current status of the system event-log</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="DmiType015Property.LogStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey LogStatus => new PropertyKey(DmiStructureClass.SystemEventLog, DmiType015Property.LogStatus);
#endregion
#region [public] {static} (IPropertyKey) AccessMethodAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Access Method Address</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="DmiType015Property.AccessMethodAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey AccessMethodAddress => new PropertyKey(DmiStructureClass.SystemEventLog, DmiType015Property.AccessMethodAddress);
#endregion
#region [public] {static} (IPropertyKey) LogChangeToken: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Unique token that is reassigned every time the event log changes</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="DmiType015Property.LogChangeToken"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey LogChangeToken => new PropertyKey(DmiStructureClass.SystemEventLog, DmiType015Property.LogChangeToken);
#endregion
#region [public] {static} (IPropertyKey) LogHeaderFormat: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Unique token that is reassigned every time the event log changes</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="DmiType015Property.LogHeaderFormat"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey LogHeaderFormat => new PropertyKey(DmiStructureClass.SystemEventLog, DmiType015Property.LogHeaderFormat);
#endregion
#region [public] {static} (IPropertyKey) SupportedLogTypeDescriptors: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of supported event log type descriptors.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="DmiType015Property.SupportedLogTypeDescriptors"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey SupportedLogTypeDescriptors => new PropertyKey(DmiStructureClass.SystemEventLog, DmiType015Property.SupportedLogTypeDescriptors);
#endregion
#region [public] {static} (IPropertyKey) SupportedLogTypeDescriptors: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>List of Event Log Type Descriptors.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemEventLog"/></description></item>
/// <item><description>Property: <see cref="DmiType015Property.ListSupportedEventLogTypeDescriptors"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="DmiSupportedEventLogTypeDescriptorsCollection"/></para>
/// </para>
/// </summary>
public static IPropertyKey ListSupportedEventLogTypeDescriptors => new PropertyKey(DmiStructureClass.SystemEventLog, DmiType015Property.ListSupportedEventLogTypeDescriptors);
#endregion
}
#endregion
#region [public] {static} (class) PhysicalMemoryArray: Contains the key definitions available for a type 016 [Physical Memory Array] structure
/// <summary>
/// Contains the key definitions available for a type 016 [<see cref="DmiStructureClass.PhysicalMemoryArray"/>] structure.
/// </summary>
public static class PhysicalMemoryArray
{
#region version 2.1+
#region [public] {static} (IPropertyKey) Location: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Physical location of the Memory Array, whether on the system board or an add-in board.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PhysicalMemoryArray"/></description></item>
/// <item><description>Property: <see cref="DmiType016Property.Location"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Location => new PropertyKey(DmiStructureClass.PhysicalMemoryArray, DmiType016Property.Location);
#endregion
#region [public] {static} (IPropertyKey) Use: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Function for which the array is used.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PhysicalMemoryArray"/></description></item>
/// <item><description>Property: <see cref="DmiType016Property.Use"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Use => new PropertyKey(DmiStructureClass.PhysicalMemoryArray, DmiType016Property.Use);
#endregion
#region [public] {static} (IPropertyKey) MemoryErrorCorrection: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Primary hardware error correction or detection method supported by this memory array.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PhysicalMemoryArray"/></description></item>
/// <item><description>Property: <see cref="DmiType016Property.MemoryErrorCorrection"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryErrorCorrection => new PropertyKey(DmiStructureClass.PhysicalMemoryArray, DmiType016Property.MemoryErrorCorrection);
#endregion
#region [public] {static} (IPropertyKey) MemoryErrorInformationHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with any error that was previously detected for the array.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PhysicalMemoryArray"/></description></item>
/// <item><description>Property: <see cref="DmiType016Property.MemoryErrorInformationHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryErrorInformationHandle => new PropertyKey(DmiStructureClass.PhysicalMemoryArray, DmiType016Property.MemoryErrorInformationHandle);
#endregion
#region [public] {static} (IPropertyKey) NumberOfMemoryDevices: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of slots or sockets available for Memory devices in this array.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PhysicalMemoryArray"/></description></item>
/// <item><description>Property: <see cref="DmiType016Property.NumberOfMemoryDevices"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey NumberOfMemoryDevices => new PropertyKey(DmiStructureClass.PhysicalMemoryArray, DmiType016Property.NumberOfMemoryDevices);
#endregion
#endregion
#region version 2.1+, 2.7+
#region [public] {static} (IPropertyKey) MaximumCapacity: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Maximum memory capacity, in kilobytes, for this array.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PhysicalMemoryArray"/></description></item>
/// <item><description>Property: <see cref="DmiType016Property.MaximumCapacity"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+, 2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey MaximumCapacity => new PropertyKey(DmiStructureClass.PhysicalMemoryArray, DmiType016Property.MaximumCapacity, PropertyUnit.KB);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) MemoryDevice: Contains the key definitions available for a type 017 [Memory Device] structure
/// <summary>
/// Contains the key definitions available for a type 017 [<see cref="DmiStructureClass.MemoryDevice"/>] structure.
/// </summary>
public static class MemoryDevice
{
#region version 2.1+
#region [public] {static} (IPropertyKey) PhysicalMemoryArrayHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with the physical memory array to which this device belongs.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.PhysicalMemoryArrayHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey PhysicalMemoryArrayHandle => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.PhysicalMemoryArrayHandle);
#endregion
#region [public] {static} (IPropertyKey) MemoryErrorInformationHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// Handle, or instance number, associated with any error that was previously detected for the device.
/// If no error was detected returns <b>-1</b>.
/// If the system does not provide the error information returns <b>-2</b>.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.MemoryErrorInformationHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryErrorInformationHandle => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.MemoryErrorInformationHandle);
#endregion
#region [public] {static} (IPropertyKey) TotalWidth: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Total width, in bits, of this memory device, including any check or error-correction bits.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.TotalWidth"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bits"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey TotalWidth => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.TotalWidth, PropertyUnit.Bits);
#endregion
#region [public] {static} (IPropertyKey) DataWidth: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Data width, in bits, of this memory device A data width of 0 and a total width of 8 indicates that the device is being used solely to provide 8 error-correction bits</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.DataWidth"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bits"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey DataWidth => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.DataWidth, PropertyUnit.Bits);
#endregion
#region [public] {static} (IPropertyKey) Size: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Size of the memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.Size"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.KB"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Size => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.Size, PropertyUnit.KB);
#endregion
#region [public] {static} (IPropertyKey) FormFactor: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Implementation form factor for this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.FormFactor"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey FormFactor => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.FormFactor);
#endregion
#region [public] {static} (IPropertyKey) DeviceSet: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// Identifies when the Memory Device is one of a set of Memory Devices that must be populated with all
/// devices of the same type and size, and the set to which this device belongs.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.DeviceSet"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey DeviceSet => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.DeviceSet);
#endregion
#region [public] {static} (IPropertyKey) BankLocator: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>String number of the string that identifies the physically labeled bank where the memory device is located.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.BankLocator"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey BankLocator => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.BankLocator);
#endregion
#region [public] {static} (IPropertyKey) DeviceLocator: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>String number of the string that identifies the physically-labeled socket or board position where the memory device is located.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.DeviceLocator"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey DeviceLocator => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.DeviceLocator);
#endregion
#region [public] {static} (IPropertyKey) MemoryType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Type of memory used in this device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.MemoryType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryType => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.MemoryType);
#endregion
#region [public] {static} (IPropertyKey) TypeDetail: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Additional detail on the memory device type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.TypeDetail"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey TypeDetail => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.TypeDetail);
#endregion
#endregion
#region version 2.3+
#region [public] {static} (IPropertyKey) Speed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// Identifies the maximum capable speed of the device, in megatransfers per second(MT/s).
/// 0000h = the speed is unknown.
/// FFFFh = the speed is 65,535 MT/s or greater, and the actual speed is stored in the <see cref="ExtendedSpeed"/> property.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.Speed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MTs"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey Speed => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.Speed, PropertyUnit.MTs);
#endregion
#region [public] {static} (IPropertyKey) Manufacturer: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>String number for the manufacturer of this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.Manufacturer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey Manufacturer => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.Manufacturer);
#endregion
#region [public] {static} (IPropertyKey) SerialNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>String number for the serial number of this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.SerialNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey SerialNumber => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.SerialNumber);
#endregion
#region [public] {static} (IPropertyKey) AssetTag: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>String number for the asset tag of this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.AssetTag"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey AssetTag => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.AssetTag);
#endregion
#region [public] {static} (IPropertyKey) PartNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>String number for the part number of this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.PartNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey PartNumber => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.PartNumber);
#endregion
#endregion
#region version 2.6+
#region [public] {static} (IPropertyKey) Rank: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Rank.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.Rank"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.3+</para>
/// </para>
/// </summary>
public static IPropertyKey Rank => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.Rank);
#endregion
#endregion
#region version 2.7+
#region [public] {static} (IPropertyKey) ConfiguredMemoryClockSpeed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// Memory speed is expressed in megatransfers per second (MT/s). Previous revisions (3.0.0 and earlier) of this
/// specification used MHz to indicate clock speed.With double data rate memory, clock speed is distinct
/// from transfer rate, since data is transferred on both the rising and the falling edges of the clock signal.
/// This maintains backward compatibility with observed DDR implementations prior to this revision, which
/// already reported transfer rate instead of clock speed, e.g., DDR4-2133 (PC4-17000) memory was
/// reported as 2133 instead of 1066.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.ConfiguredMemoryClockSpeed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Variable"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey ConfiguredMemoryClockSpeed => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.ConfiguredMemoryClockSpeed, PropertyUnit.Variable);
#endregion
#endregion
#region version 2.8+
#region [public] {static} (IPropertyKey) MinimumVoltage: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Minimum operating voltage for this device, in millivolts.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.MinimumVoltage"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mV"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.8+</para>
/// </para>
/// </summary>
public static IPropertyKey MinimumVoltage => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.MinimumVoltage, PropertyUnit.mV);
#endregion
#region [public] {static} (IPropertyKey) MaximumVoltage: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Maximum operating voltage for this device, in millivolts.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.MaximumVoltage"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mV"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.8+</para>
/// </para>
/// </summary>
public static IPropertyKey MaximumVoltage => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.MaximumVoltage, PropertyUnit.mV);
#endregion
#region [public] {static} (IPropertyKey) ConfiguredVoltage: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Configured voltage for this device, in millivolts.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.ConfiguredVoltage"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mV"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.8+</para>
/// </para>
/// </summary>
public static IPropertyKey ConfiguredVoltage => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.ConfiguredVoltage, PropertyUnit.mV);
#endregion
#endregion
#region version 3.2+
#region [public] {static} (IPropertyKey) MemoryTechnology: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Memory technology type for this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.MemoryTechnology"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryTechnology => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.MemoryTechnology);
#endregion
#region [public] {static} (IPropertyKey) MemoryOperatingModeCapability: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>The operating modes supported by this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.MemoryOperatingModeCapability"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryOperatingModeCapability => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.MemoryOperatingModeCapability);
#endregion
#region [public] {static} (IPropertyKey) FirmwareVersion: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number for the firmware version of this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.FirmwareVersion"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareVersion => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.FirmwareVersion);
#endregion
#region [public] {static} (IPropertyKey) ModuleManufacturerId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>The two-byte module manufacturer ID found in the SPD of this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.ModuleManufacturerId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey ModuleManufacturerId => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.ModuleManufacturerId);
#endregion
#region [public] {static} (IPropertyKey) ModuleProductId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>The two-byte module product ID found in the SPD of this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.ModuleProductId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey ModuleProductId => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.ModuleProductId);
#endregion
#region [public] {static} (IPropertyKey) MemorySubSystemControllerManufacturerId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>The two-byte memory subsystem controller manufacturer ID found in the SPD of this memory device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.MemorySubSystemControllerManufacturerId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey MemorySubsystemControllerManufacturerId => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.MemorySubSystemControllerManufacturerId);
#endregion
#region [public] {static} (IPropertyKey) MemorySubSystemControllerProductId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>The two-byte memory subsystem controller product ID found in the SPD of this memory device; LSB first.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.MemorySubSystemControllerProductId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey MemorySubsystemControllerProductId => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.MemorySubSystemControllerProductId);
#endregion
#region [public] {static} (IPropertyKey) NonVolatileSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Size of the Non-volatile portion of the memory device in bytes.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.NonVolatileSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey NonVolatileSize => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.NonVolatileSize, PropertyUnit.Bytes);
#endregion
#region [public] {static} (IPropertyKey) VolatileSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Size of the volatile portion of the memory device in bytes.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.VolatileSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey VolatileSize => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.VolatileSize, PropertyUnit.Bytes);
#endregion
#region [public] {static} (IPropertyKey) CacheSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Size of the Cache portion of the memory device in bytes.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.CacheSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey CacheSize => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.CacheSize, PropertyUnit.Bytes);
#endregion
#region [public] {static} (IPropertyKey) LogicalSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Size of the Logical memory device in bytes.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.LogicalSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.2+</para>
/// </para>
/// </summary>
public static IPropertyKey LogicalSize => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.LogicalSize, PropertyUnit.Bytes);
#endregion
#endregion
#region version 3.3+
#region [public] {static} (IPropertyKey) ExtendedSpeed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Extended speed of the memory device. Identifies the maximum capable speed of the device, in megatransfers per second (MT/s).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.ExtendedSpeed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MTs"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.3+</para>
/// </para>
/// </summary>
public static IPropertyKey ExtendedSpeed => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.ExtendedSpeed, PropertyUnit.MTs);
#endregion
#region [public] {static} (IPropertyKey) ExtendedConfiguredMemorySpeed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>Extended configured memory speed of the memory device. Identifies the configured speed of the memory device, in megatransfers per second (MT/s).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.ExtendedConfiguredMemorySpeed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.MTs"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.3+</para>
/// </para>
/// </summary>
public static IPropertyKey ExtendedConfiguredMemorySpeed => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.ExtendedConfiguredMemorySpeed, PropertyUnit.MTs);
#endregion
#endregion
#region version 3.7+
#region [public] {static} (IPropertyKey) PMIC0ManufacturerId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// The PMIC0 Manufacturer ID indicates the manufacturer of the PMIC0 on memory device. This field shall
/// be set to the value of the SPD PMIC 0 Manufacturer ID Code.
/// A value of 0000h indicates the PMIC0 Manufacturer ID is unknown.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.PMIC0ManufacturerId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.7+</para>
/// </para>
/// </summary>
public static IPropertyKey PMIC0ManufacturerId => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.PMIC0ManufacturerId, PropertyUnit.None);
#endregion
#region [public] {static} (IPropertyKey) PMIC0RevisionNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// The PMIC0 Revision Number indicates the revision of the PMIC0 on memory device. This field shall be
/// set to the value of the SPD PMIC 0 Revision Number.
/// A value of FF00h indicates the PMIC0 Revision Number is unknown.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.PMIC0RevisionNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.7+</para>
/// </para>
/// </summary>
public static IPropertyKey PMIC0RevisionNumber => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.PMIC0RevisionNumber, PropertyUnit.None);
#endregion
#region [public] {static} (IPropertyKey) RCDManufacturerId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// The RCD Manufacturer ID indicates the manufacturer of the RCD on memory device. This field shall be
/// set to the value of the SPD Registering Clock Driver Manufacturer ID Code.
/// A value of 0000h indicates the RCD Manufacturer ID is unknown
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.RCDManufacturerId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.7+</para>
/// </para>
/// </summary>
public static IPropertyKey RCDManufacturerId => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.RCDManufacturerId, PropertyUnit.None);
#endregion
#region [public] {static} (IPropertyKey) RCDRevisionNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property.</para>
/// <para>
/// The RCD Revision Number indicates the revision of the RCD on memory device.
/// This field shall be set to the value of the SPD Register Revision Number.
/// A value of FF00h indicates the RCD Revision Number is unknown.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType017Property.RCDRevisionNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.7+</para>
/// </para>
/// </summary>
public static IPropertyKey RCDRevisionNumber => new PropertyKey(DmiStructureClass.MemoryDevice, DmiType017Property.RCDRevisionNumber, PropertyUnit.None);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) BitMemoryError32: Contains the key definitions available for a type 018 [32-Bit Memory Error Information] structure
/// <summary>
/// Contains the key definitions available for a type 018 [<see cref="DmiStructureClass.BitMemoryError32"/> Information] structure.
/// </summary>
public static class BitMemoryError32
{
#region version 2.1+
#region [public] {static} (IPropertyKey) ErrorType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Type of error that is associated with the current status reported for the memory array or device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BitMemoryError32"/></description></item>
/// <item><description>Property: <see cref="DmiType018Property.ErrorType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey ErrorType => new PropertyKey(DmiStructureClass.BitMemoryError32, DmiType018Property.ErrorType);
#endregion
#region [public] {static} (IPropertyKey) ErrorGranularity: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Granularity (for example, device versus Partition) to which the error can be resolved.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BitMemoryError32"/></description></item>
/// <item><description>Property: <see cref="DmiType018Property.ErrorGranularity"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey ErrorGranularity => new PropertyKey(DmiStructureClass.BitMemoryError32, DmiType018Property.ErrorGranularity);
#endregion
#region [public] {static} (IPropertyKey) ErrorOperation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Memory access operation that caused the error.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BitMemoryError32"/></description></item>
/// <item><description>Property: <see cref="DmiType018Property.ErrorOperation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey ErrorOperation => new PropertyKey(DmiStructureClass.BitMemoryError32, DmiType018Property.ErrorOperation);
#endregion
#region [public] {static} (IPropertyKey) VendorSyndrome: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Vendor-specific ECC syndrome or CRC data associated with the erroneous access.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BitMemoryError32"/></description></item>
/// <item><description>Property: <see cref="DmiType018Property.VendorSyndrome"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey VendorSyndrome => new PropertyKey(DmiStructureClass.BitMemoryError32, DmiType018Property.VendorSyndrome);
#endregion
#region [public] {static} (IPropertyKey) MemoryArrayErrorAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>32-bit physical address of the error based on the addressing of the bus to which the memory array is connected.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BitMemoryError32"/></description></item>
/// <item><description>Property: <see cref="DmiType018Property.MemoryArrayErrorAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryArrayErrorAddress => new PropertyKey(DmiStructureClass.BitMemoryError32, DmiType018Property.MemoryArrayErrorAddress);
#endregion
#region [public] {static} (IPropertyKey) DeviceErrorAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>32-bit physical address of the error relative to the start of the failing memory device, in bytes</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BitMemoryError32"/></description></item>
/// <item><description>Property: <see cref="DmiType018Property.DeviceErrorAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey DeviceErrorAddress => new PropertyKey(DmiStructureClass.BitMemoryError32, DmiType018Property.DeviceErrorAddress, PropertyUnit.Bytes);
#endregion
#region [public] {static} (IPropertyKey) ErrorResolution: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Range, in bytes, within which the error can be determined, when an error address is given</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BitMemoryError32"/></description></item>
/// <item><description>Property: <see cref="DmiType018Property.ErrorResolution"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey ErrorResolution => new PropertyKey(DmiStructureClass.BitMemoryError32, DmiType018Property.ErrorResolution, PropertyUnit.Bytes);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) MemoryArrayMappedAddress: Contains the key definitions available for a type 019 [Memory Array Mapped Address] structure
/// <summary>
/// Contains the key definitions available for a type 019 [<see cref="DmiStructureClass.MemoryArrayMappedAddress"/>] structure.
/// </summary>
public static class MemoryArrayMappedAddress
{
#region version 2.1+
#region [public] {static} (IPropertyKey) MemoryArrayHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para> Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Handle, or instance number, associated with the physical memory array to which this address range is mapped
/// multiple address ranges can be mapped to a single physical memory array.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryArrayMappedAddress"/></description></item>
/// <item><description>Property: <see cref="DmiType019Property.MemoryArrayHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryArrayHandle => new PropertyKey(DmiStructureClass.MemoryArrayMappedAddress, DmiType019Property.MemoryArrayHandle);
#endregion
#region [public] {static} (IPropertyKey) PartitionWidth: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para> Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of memory devices that form a single row of memory for the address partition defined by this structure.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryArrayMappedAddress"/></description></item>
/// <item><description>Property: <see cref="DmiType019Property.PartitionWidth"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey PartitionWidth => new PropertyKey(DmiStructureClass.MemoryArrayMappedAddress, DmiType019Property.PartitionWidth);
#endregion
#endregion
#region version 2.1+ - 2.7+
#region [public] {static} (IPropertyKey) StartingAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Physical address, of a range of memory mapped to the specified physical memory array.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryArrayMappedAddress"/></description></item>
/// <item><description>Property: <see cref="DmiType019Property.StartingAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+, 2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey StartingAddress => new PropertyKey(DmiStructureClass.MemoryArrayMappedAddress, DmiType019Property.StartingAddress, PropertyUnit.Bytes);
#endregion
#region [public] {static} (IPropertyKey) EndingAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Physical ending address.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryArrayMappedAddress"/></description></item>
/// <item><description>Property: <see cref="DmiType019Property.EndingAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+, 2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey EndingAddress => new PropertyKey(DmiStructureClass.MemoryArrayMappedAddress, DmiType019Property.EndingAddress, PropertyUnit.Bytes);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) MemoryDeviceMappedAddress: Contains the key definitions available for a type 020 [Memory Device Mapped Address] structure
/// <summary>
/// Contains the key definitions available for a type 020 [<see cref="DmiStructureClass.MemoryDeviceMappedAddress"/>] structure.
/// </summary>
public static class MemoryDeviceMappedAddress
{
#region version 2.1+
#region [public] {static} (IPropertyKey) MemoryDeviceHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Handle, or instance number, associated with the memory device structure to which this address range is mapped multiple address
/// ranges can be mapped to a single memory device.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDeviceMappedAddress"/></description></item>
/// <item><description>Property: <see cref="DmiType020Property.MemoryDeviceHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryDeviceHandle => new PropertyKey(DmiStructureClass.MemoryDeviceMappedAddress, DmiType020Property.MemoryDeviceHandle);
#endregion
#region [public] {static} (IPropertyKey) MemoryArrayMappedAddressHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Handle, or instance number, associated with the memory array mapped Address structure to which this device address range is mapped
/// multiple address ranges can be mapped to a single Memory array mapped address.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDeviceMappedAddress"/></description></item>
/// <item><description>Property: <see cref="DmiType020Property.MemoryArrayMappedAddressHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MemoryArrayMappedAddressHandle => new PropertyKey(DmiStructureClass.MemoryDeviceMappedAddress, DmiType020Property.MemoryArrayMappedAddressHandle);
#endregion
#region [public] {static} (IPropertyKey) PartitionRowPosition: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Position of the referenced Memory Device in a row of the address partition.
/// The value 0 is reserved. If the position is unknown, the field contains FFh.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDeviceMappedAddress"/></description></item>
/// <item><description>Property: <see cref="DmiType020Property.PartitionRowPosition"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey PartitionRowPosition => new PropertyKey(DmiStructureClass.MemoryDeviceMappedAddress, DmiType020Property.PartitionRowPosition);
#endregion
#region [public] {static} (IPropertyKey) InterleavePosition: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Position of the referenced Memory Device in an interleave.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDeviceMappedAddress"/></description></item>
/// <item><description>Property: <see cref="DmiType020Property.InterleavePosition"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="MemoryDeviceMappedAddressInterleavedPosition"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey InterleavePosition => new PropertyKey(DmiStructureClass.MemoryDeviceMappedAddress, DmiType020Property.InterleavePosition);
#endregion
#region [public] {static} (IPropertyKey) InterleavedDataDepth: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Maximum number of consecutive rows from the referenced Memory Device that are accessed in a single interleaved transfer.
/// If the device is not part of an interleave, the field contains 0; if the interleave configuration is unknown, the value is FFh.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDeviceMappedAddress"/></description></item>
/// <item><description>Property: <see cref="DmiType020Property.InterleavedDataDepth"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey InterleavedDataDepth => new PropertyKey(DmiStructureClass.MemoryDeviceMappedAddress, DmiType020Property.InterleavedDataDepth);
#endregion
#endregion
#region version 2.1+, 2.7+
#region [public] {static} (IPropertyKey) StartingAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Physical starting address.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDeviceMappedAddress"/></description></item>
/// <item><description>Property: <see cref="DmiType020Property.StartingAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+, 2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey StartingAddress => new PropertyKey(DmiStructureClass.MemoryDeviceMappedAddress, DmiType020Property.StartingAddress, PropertyUnit.Bytes);
#endregion
#region [public] {static} (IPropertyKey) EndingAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Physical ending address.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryDeviceMappedAddress"/></description></item>
/// <item><description>Property: <see cref="DmiType020Property.EndingAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+, 2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey EndingAddress => new PropertyKey(DmiStructureClass.MemoryDeviceMappedAddress, DmiType020Property.EndingAddress, PropertyUnit.Bytes);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) BuiltInPointingDevice: Contains the key definitions available for a type 021 [Built-in Pointing Device] structure
/// <summary>
/// Contains the key definitions available for a type 021 [<see cref="DmiStructureClass.BuiltInPointingDevice"/>] structure.
/// </summary>
public static class BuiltInPointingDevice
{
#region version 2.1+
#region [public] {static} (IPropertyKey) Type: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Type of pointing device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BuiltInPointingDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType021Property.Type"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Type => new PropertyKey(DmiStructureClass.BuiltInPointingDevice, DmiType021Property.Type);
#endregion
#region [public] {static} (IPropertyKey) Interface: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Interface type for the pointing device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BuiltInPointingDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType021Property.Interface"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Interface => new PropertyKey(DmiStructureClass.BuiltInPointingDevice, DmiType021Property.Interface);
#endregion
#region [public] {static} (IPropertyKey) NumberOfButtons: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of buttons on the pointing device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BuiltInPointingDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType021Property.NumberOfButtons"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey NumberOfButtons => new PropertyKey(DmiStructureClass.BuiltInPointingDevice, DmiType021Property.NumberOfButtons);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) PortableBattery: Contains the key definitions available for a type 022 [Portable Battery] structure
/// <summary>
/// Contains the key definitions available for a type 022 [<see cref="DmiStructureClass.PortableBattery"/>] structure.
/// </summary>
public static class PortableBattery
{
#region version 2.1+
#region [public] {static} (IPropertyKey) Location: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of the string that identifies the location of the battery.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="DmiType022Property.Location"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Location => new PropertyKey(DmiStructureClass.PortableBattery, DmiType022Property.Location);
#endregion
#region [public] {static} (IPropertyKey) Manufacturer: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of the string that names the company that manufactured the battery.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="DmiType022Property.Manufacturer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey Manufacturer => new PropertyKey(DmiStructureClass.PortableBattery, DmiType022Property.Manufacturer);
#endregion
#region [public] {static} (IPropertyKey) DeviceName: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Battery name.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="DmiType022Property.DeviceName"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey DeviceName => new PropertyKey(DmiStructureClass.PortableBattery, DmiType022Property.DeviceName);
#endregion
#region [public] {static} (IPropertyKey) DeviceChemistry: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the battery chemistry.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="DmiType022Property.DeviceChemistry"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey DeviceChemistry => new PropertyKey(DmiStructureClass.PortableBattery, DmiType022Property.DeviceChemistry);
#endregion
#region [public] {static} (IPropertyKey) DesignCapacity: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Design capacity of the battery in mWatt-hours.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="DmiType022Property.DesignCapacity"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mWh"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey DesignCapacity => new PropertyKey(DmiStructureClass.PortableBattery, DmiType022Property.DesignCapacity, PropertyUnit.mWh);
#endregion
#region [public] {static} (IPropertyKey) DesignVoltage: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Design voltage of the battery in mVolts.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="DmiType022Property.DesignVoltage"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mV"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey DesignVoltage => new PropertyKey(DmiStructureClass.PortableBattery, DmiType022Property.DesignVoltage, PropertyUnit.mV);
#endregion
#region [public] {static} (IPropertyKey) SBDSVersionNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>The Smart Battery Data Specification version number supported by this battery.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="DmiType022Property.SbdsVersionNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey SBDSVersionNumber => new PropertyKey(DmiStructureClass.PortableBattery, DmiType022Property.SbdsVersionNumber);
#endregion
#region [public] {static} (IPropertyKey) MaximunErrorInBatteryData: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Maximum error (as a percentage in the range 0 to 100) in the Watt-hour data reported by the battery, indicating an upper bound on how much
/// additional energy the battery might have above the energy it reports having.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="DmiType022Property.MaximunErrorInBatteryData"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey MaximunErrorInBatteryData => new PropertyKey(DmiStructureClass.PortableBattery, DmiType022Property.MaximunErrorInBatteryData);
#endregion
#endregion
#region version 2.2+
#region [public] {static} (IPropertyKey) DesignCapacityMultiplier: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Multiplication factor of the Design Capacity value, which assures that the mWatt hours value
/// does not overflow for <b>SBDS</b> implementations. The multiplier default is 1.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>l
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="DmiType022Property.DesignCapacityMultiplier"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.2+</para>
/// </para>
/// </summary>
public static IPropertyKey DesignCapacityMultiplier => new PropertyKey(DmiStructureClass.PortableBattery, DmiType022Property.DesignCapacityMultiplier);
#endregion
#region [public] {static} (IPropertyKey) OemSpecific: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains OEM or BIOS vendor-specific information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="DmiType022Property.OemSpecific"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.2+</para>
/// </para>
/// </summary>
public static IPropertyKey OemSpecific => new PropertyKey(DmiStructureClass.PortableBattery, DmiType022Property.OemSpecific);
#endregion
#endregion
#region version 2.1+, 2.2+
#region [public] {static} (IPropertyKey) ManufactureDate: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para> The date on which the battery was manufactured.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="DmiType022Property.ManufactureDate"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+, 2.2+</para>
/// </para>
/// </summary>
public static IPropertyKey ManufactureDate => new PropertyKey(DmiStructureClass.PortableBattery, DmiType022Property.ManufactureDate);
#endregion
#region [public] {static} (IPropertyKey) SerialNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>The serial number for the battery.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.PortableBattery"/></description></item>
/// <item><description>Property: <see cref="DmiType022Property.SerialNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.1+</para>
/// </para>
/// </summary>
public static IPropertyKey SerialNumber => new PropertyKey(DmiStructureClass.PortableBattery, DmiType022Property.SerialNumber);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) SystemReset: Contains the key definitions available for a type 023 [System Reset] structure
/// <summary>
/// Contains the key definitions available for a type 023 [<see cref="DmiStructureClass.SystemReset"/>] structure.
/// </summary>
public static class SystemReset
{
#region [public] {static} (IPropertyKey) ResetCount: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of automatic system resets since the last intentional reset.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemReset"/></description></item>
/// <item><description>Property: <see cref="DmiType023Property.ResetCount"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey ResetCount => new PropertyKey(DmiStructureClass.SystemReset, DmiType023Property.ResetCount);
#endregion
#region [public] {static} (IPropertyKey) ResetLimit: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of consecutive times the system reset is attempted.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemReset"/></description></item>
/// <item><description>Property: <see cref="DmiType023Property.ResetLimit"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey ResetLimit => new PropertyKey(DmiStructureClass.SystemReset, DmiType023Property.ResetLimit);
#endregion
#region [public] {static} (IPropertyKey) TimerInterval: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Number of minutes to use for the watchdog timer If the timer is not reset within this interval, the system reset timeout begins.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemReset"/></description></item>
/// <item><description>Property: <see cref="DmiType023Property.TimerInterval"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey TimerInterval => new PropertyKey(DmiStructureClass.SystemReset, DmiType023Property.TimerInterval);
#endregion
#region [public] {static} (IPropertyKey) Timeout: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Number of minutes before the reboot is initiated. It is used after a system power cycle, system reset (local or remote),
/// and automatic system reset
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemReset"/></description></item>
/// <item><description>Property: <see cref="DmiType023Property.Timeout"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Timeout => new PropertyKey(DmiStructureClass.SystemReset, DmiType023Property.Timeout);
#endregion
#region nested classes
#region [public] {static} (class) Capabilities: Contains the key definition for the 'Capabilities' section.
/// <summary>
/// Contains the key definition for the <b>Capabilities</b> section.
/// </summary>
public static class Capabilities
{
#region [public] {static} (IPropertyKey) BootOption: Gets a value representing the key to retrieve the property value.
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Returns the action to be taken after a watchdog restart.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemReset"/></description></item>
/// <item><description>Property: <see cref="DmiType023Property.BootOption"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey BootOption => new PropertyKey(DmiStructureClass.SystemReset, DmiType023Property.BootOption);
#endregion
#region [public] {static} (IPropertyKey) BootOptionOnLimit: Gets a value representing the key to retrieve the property value.
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Returns to the action that will be taken when the restart limit is reached.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemReset"/></description></item>
/// <item><description>Property: <see cref="DmiType023Property.BootOptionOnLimit"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey BootOptionOnLimit => new PropertyKey(DmiStructureClass.SystemReset, DmiType023Property.BootOptionOnLimit);
#endregion
#region [public] {static} (IPropertyKey) Status: Gets a value representing the key to retrieve the property value.
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies whether (enabled) or not (disabled) the system reset by the user.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemReset"/></description></item>
/// <item><description>Property: <see cref="DmiType023Property.Status"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Status => new PropertyKey(DmiStructureClass.SystemReset, DmiType023Property.Status);
#endregion
#region [public] {static} (IPropertyKey) WatchdogTimer: Gets a value representing the key to retrieve the property value.
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates whether the system contains a watchdog timer.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemReset"/></description></item>
/// <item><description>Property: <see cref="DmiType023Property.WatchdogTimer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey WatchdogTimer => new PropertyKey(DmiStructureClass.SystemReset, DmiType023Property.WatchdogTimer);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) HardwareSecurity: Contains the key definitions available for a type 024 [Hardware Security] structure
/// <summary>
/// Contains the key definitions available for a type 024 [<see cref="DmiStructureClass.HardwareSecurity"/>] structure.
/// </summary>
public static class HardwareSecurity
{
#region nested classes
#region [public] {static} (class) HardwareSecuritySettings: Contains the key definition for the 'HardwareSecuritySettings' section
/// <summary>
/// Contains the key definition for the <b>HardwareSecuritySettings</b> section.
/// </summary>
public static class HardwareSecuritySettings
{
#region [public] {static} (IPropertyKey) AdministratorPasswordStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Returns current administrator password status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.HardwareSecurity"/></description></item>
/// <item><description>Property: <see cref="DmiType024Property.AdministratorPasswordStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey AdministratorPasswordStatus => new PropertyKey(DmiStructureClass.HardwareSecurity, DmiType024Property.AdministratorPasswordStatus);
#endregion
#region [public] {static} (IPropertyKey) FrontPanelResetStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Returns current front panel reset status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.HardwareSecurity"/></description></item>
/// <item><description>Property: <see cref="DmiType024Property.FrontPanelResetStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey FrontPanelResetStatus => new PropertyKey(DmiStructureClass.HardwareSecurity, DmiType024Property.FrontPanelResetStatus);
#endregion
#region [public] {static} (IPropertyKey) KeyboardPasswordStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Returns current keyboard password status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.HardwareSecurity"/></description></item>
/// <item><description>Property: <see cref="DmiType024Property.KeyboardPasswordStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey KeyboardPasswordStatus => new PropertyKey(DmiStructureClass.HardwareSecurity, DmiType024Property.KeyboardPasswordStatus);
#endregion
#region [public] {static} (IPropertyKey) PowerOnPasswordStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Returns current power on password status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.HardwareSecurity"/></description></item>
/// <item><description>Property: <see cref="DmiType024Property.PowerOnPasswordStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey PowerOnPasswordStatus => new PropertyKey(DmiStructureClass.HardwareSecurity, DmiType024Property.PowerOnPasswordStatus);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) SystemPowerControls: Contains the key definitions available for a type 025 [System Power Controls] structure
/// <summary>
/// Contains the key definitions available for a type 025 [<see cref="DmiStructureClass.SystemPowerControls"/>] structure.
/// </summary>
public static class SystemPowerControls
{
#region [public] {static} (IPropertyKey) Month: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>BCD value of the month on which the next scheduled power-on is to occur, in the range 01h to 12h.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerControls"/></description></item>
/// <item><description>Property: <see cref="DmiType025Property.Month"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey Month => new PropertyKey(DmiStructureClass.SystemPowerControls, DmiType025Property.Month);
#endregion
#region [public] {static} (IPropertyKey) Day: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>BCD value of the day-of-month on which the next scheduled power-on is to occur, in the range 01h to 31h.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerControls"/></description></item>
/// <item><description>Property: <see cref="DmiType025Property.Day"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey Day => new PropertyKey(DmiStructureClass.SystemPowerControls, DmiType025Property.Day);
#endregion
#region [public] {static} (IPropertyKey) Hour: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>BCD value of the hour on which the next scheduled poweron is to occur, in the range 00h to 23h.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerControls"/></description></item>
/// <item><description>Property: <see cref="DmiType025Property.Hour"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey Hour => new PropertyKey(DmiStructureClass.SystemPowerControls, DmiType025Property.Hour);
#endregion
#region [public] {static} (IPropertyKey) Minute: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>BCD value of the minute on which the next scheduled power-on is to occur, in the range 00h to 59h.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerControls"/></description></item>
/// <item><description>Property: <see cref="DmiType025Property.Minute"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey Minute => new PropertyKey(DmiStructureClass.SystemPowerControls, DmiType025Property.Minute);
#endregion
#region [public] {static} (IPropertyKey) Second: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>BCD value of the second on which the next scheduled power-on is to occur, in the range 00h to 59h.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerControls"/></description></item>
/// <item><description>Property: <see cref="DmiType025Property.Second"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey Second => new PropertyKey(DmiStructureClass.SystemPowerControls, DmiType025Property.Second);
#endregion
}
#endregion
#region [public] {static} (class) VoltageProbe: Contains the key definitions available for a type 026 [Voltage Probe] structure
/// <summary>
/// Contains the key definitions available for a type 026 [<see cref="DmiStructureClass.VoltageProbe"/>] structure.
/// </summary>
public static class VoltageProbe
{
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains additional descriptive information about the probe or its location.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType026Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(DmiStructureClass.VoltageProbe, DmiType026Property.Description);
#endregion
#region [public] {static} (IPropertyKey) MaximumValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Maximum voltage level readable by this probe, in millivolts.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType026Property.MaximumValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mV"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey MaximumValue => new PropertyKey(DmiStructureClass.VoltageProbe, DmiType026Property.MaximumValue, PropertyUnit.mV);
#endregion
#region [public] {static} (IPropertyKey) MinimumValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Minimum voltage level readable by this probe, in millivolts.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType026Property.MinimumValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mV"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey MinimumValue => new PropertyKey(DmiStructureClass.VoltageProbe, DmiType026Property.MinimumValue, PropertyUnit.mV);
#endregion
#region [public] {static} (IPropertyKey) Resolution: Gets a value representing the key to retrieve the property value.
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Resolution for the probe’s reading, in tenths of millivolts</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType026Property.Resolution"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.d_mV"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Resolution => new PropertyKey(DmiStructureClass.VoltageProbe, DmiType026Property.Resolution, PropertyUnit.d_mV);
#endregion
#region [public] {static} (IPropertyKey) Tolerance: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Tolerance for reading from this probe, in plus/minus millivolts.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType026Property.Tolerance"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mV"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Tolerance => new PropertyKey(DmiStructureClass.VoltageProbe, DmiType026Property.Tolerance, PropertyUnit.mV);
#endregion
#region [public] {static} (IPropertyKey) Accuracy: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Accuracy for reading from this probe, in plus/minus 1/100th of a percent.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType026Property.Accuracy"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Percent_1_100th"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Accuracy => new PropertyKey(DmiStructureClass.VoltageProbe, DmiType026Property.Accuracy, PropertyUnit.Percent_1_100th);
#endregion
#region [public] {static} (IPropertyKey) OemDefined: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>OEM or BIOS vendor-specific information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType026Property.OemDefined"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// </summary>
public static IPropertyKey OemDefined => new PropertyKey(DmiStructureClass.VoltageProbe, DmiType026Property.OemDefined);
#endregion
#region [public] {static} (IPropertyKey) NominalValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Nominal value for the probe’s reading in millivolts.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType026Property.NominalValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Percent_1_100th"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey NominalValue => new PropertyKey(DmiStructureClass.VoltageProbe, DmiType026Property.NominalValue, PropertyUnit.mV);
#endregion
#region nested classes
#region [public] {static} (class) LocationAndStatus: Contains the key definition for the 'Location And Status' section
/// <summary>
/// Contains the key definition for the <b>Location And Status</b> section.
/// </summary>
public static class LocationAndStatus
{
#region [public] {static} (IPropertyKey) Location: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Probe’s physical location of the voltage monitored by this voltage probe.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType026Property.Location"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Location => new PropertyKey(DmiStructureClass.VoltageProbe, DmiType026Property.Location);
#endregion
#region [public] {static} (IPropertyKey) Status: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Probe’s physical status of the voltage monitored by this voltage probe.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.VoltageProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType026Property.Status"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Status => new PropertyKey(DmiStructureClass.VoltageProbe, DmiType026Property.Status);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) CoolingDevice: Contains the key definitions available for a type 027 [Cooling Device] structure
/// <summary>
/// Contains the key definitions available for a type 027 [<see cref="DmiStructureClass.CoolingDevice"/>] structure.
/// </summary>
public static class CoolingDevice
{
#region version 2.2+
#region [public] {static} (IPropertyKey) TemperatureProbeHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, of the temperature probe monitoring this cooling device</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.CoolingDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType027Property.TemperatureProbeHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.2+</para>
/// </para>
/// </summary>
public static IPropertyKey TemperatureProbeHandle => new PropertyKey(DmiStructureClass.CoolingDevice, DmiType027Property.TemperatureProbeHandle);
#endregion
#region [public] {static} (IPropertyKey) CoolingUnitGroup: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Cooling unit group to which this cooling device is associated. Having multiple cooling devices in the same cooling unit implies a redundant configuration.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.CoolingDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType027Property.CoolingUnitGroup"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.2+</para>
/// </para>
/// </summary>
public static IPropertyKey CoolingUnitGroup => new PropertyKey(DmiStructureClass.CoolingDevice, DmiType027Property.CoolingUnitGroup);
#endregion
#region [public] {static} (IPropertyKey) OemDefined: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>OEM or BIOS vendor-specific information,</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.CoolingDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType027Property.CoolingUnitGroup"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.2+</para>
/// </para>
/// </summary>
public static IPropertyKey OemDefined => new PropertyKey(DmiStructureClass.CoolingDevice, DmiType027Property.OemDefined);
#endregion
#region [public] {static} (IPropertyKey) NominalSpeed: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Nominal value for the cooling device’s rotational speed, in revolutions-per-minute (rpm)</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.CoolingDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType027Property.NominalSpeed"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.RPM"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.2+</para>
/// </para>
/// </summary>
public static IPropertyKey NominalSpeed => new PropertyKey(DmiStructureClass.CoolingDevice, DmiType027Property.NominalSpeed, PropertyUnit.RPM);
#endregion
#endregion
#region version 2.7+
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains additional descriptive information about the cooling device or its location.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.CoolingDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType027Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.7+</para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(DmiStructureClass.CoolingDevice, DmiType027Property.Description);
#endregion
#endregion
#region nested classes
#region [public] {static} (class) DeviceTypeAndStatus: Contains the key definition for the 'Device Type And Status' section
/// <summary>
/// Contains the key definition for the <b>Device Type And Status</b> section.
/// </summary>
public static class DeviceTypeAndStatus
{
#region [public] {static} (IPropertyKey) DeviceType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Cooling device type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.CoolingDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType027Property.DeviceType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.2+</para>
/// </para>
/// </summary>
public static IPropertyKey DeviceType => new PropertyKey(DmiStructureClass.CoolingDevice, DmiType027Property.DeviceType);
#endregion
#region [public] {static} (IPropertyKey) Status: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Cooling device status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.CoolingDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType027Property.Status"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>2.2+</para>
/// </para>
/// </summary>
public static IPropertyKey Status => new PropertyKey(DmiStructureClass.CoolingDevice, DmiType027Property.Status);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) TemperatureProbe: Contains the key definitions available for a type 028 [Temperature Probe] structure
/// <summary>
/// Contains the key definitions available for a type 028 [<see cref="DmiStructureClass.TemperatureProbe"/>] structure.
/// </summary>
public static class TemperatureProbe
{
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains additional descriptive information about the probe or its location.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType028Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(DmiStructureClass.TemperatureProbe, DmiType028Property.Description);
#endregion
#region [public] {static} (IPropertyKey) MaximumValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Maximum temperature readable by this probe, in 1/10th ºC</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType028Property.MaximumValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.DegreeCentigrade"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey MaximumValue => new PropertyKey(DmiStructureClass.TemperatureProbe, DmiType028Property.MaximumValue, PropertyUnit.DegreeCentigrade);
#endregion
#region [public] {static} (IPropertyKey) MinimumValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Minimun temperature readable by this probe, in 1/10th ºC</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType028Property.MinimumValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.DegreeCentigrade"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey MinimumValue => new PropertyKey(DmiStructureClass.TemperatureProbe, DmiType028Property.MinimumValue, PropertyUnit.DegreeCentigrade);
#endregion
#region [public] {static} (IPropertyKey) Resolution: Gets a value representing the key to retrieve the property value.
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Resolution for the probe’s reading, in 1/1000th ºC.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType028Property.Resolution"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.DegreeCentigrade"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Resolution => new PropertyKey(DmiStructureClass.TemperatureProbe, DmiType028Property.Resolution, PropertyUnit.DegreeCentigrade);
#endregion
#region [public] {static} (IPropertyKey) Tolerance: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Tolerance for reading from this probe, in plus/minus 1/10th ºC.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType028Property.Tolerance"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.DegreeCentigrade"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Tolerance => new PropertyKey(DmiStructureClass.TemperatureProbe, DmiType028Property.Tolerance, PropertyUnit.DegreeCentigrade);
#endregion
#region [public] {static} (IPropertyKey) Accuracy: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Accuracy for reading from this probe, in plus/minus 1/100th of a percent.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType028Property.Accuracy"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Percent_1_100th"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Accuracy => new PropertyKey(DmiStructureClass.TemperatureProbe, DmiType028Property.Accuracy, PropertyUnit.Percent_1_100th);
#endregion
#region [public] {static} (IPropertyKey) OemDefined: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>OEM or BIOS vendor-specific information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType028Property.OemDefined"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// </summary>
public static IPropertyKey OemDefined => new PropertyKey(DmiStructureClass.TemperatureProbe, DmiType028Property.OemDefined);
#endregion
#region [public] {static} (IPropertyKey) NominalValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Nominal value for the probe’s reading in 1/10th degrees ºC.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType028Property.NominalValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.DegreeCentigrade"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey NominalValue => new PropertyKey(DmiStructureClass.TemperatureProbe, DmiType028Property.NominalValue, PropertyUnit.DegreeCentigrade);
#endregion
#region nested classes
#region [public] {static} (class) LocationAndStatus: Contains the key definition for the 'Location And Status' section
/// <summary>
/// Contains the key definition for the <b>Location And Status</b> section.
/// </summary>
public static class LocationAndStatus
{
#region [public] {static} (IPropertyKey) Location: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Probe’s physical location of the temperature monitored by this temperature probe.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType028Property.Location"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Location => new PropertyKey(DmiStructureClass.TemperatureProbe, DmiType028Property.Location);
#endregion
#region [public] {static} (IPropertyKey) Status: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Probe’s physical status of the temperature monitored by this temperature probe.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TemperatureProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType028Property.Status"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Status => new PropertyKey(DmiStructureClass.TemperatureProbe, DmiType028Property.Status);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) ElectricalCurrentProbe: Contains the key definitions available for a type 029 [Electrical Current Probe] structure
/// <summary>
/// Contains the key definitions available for a type 029 [<see cref="DmiStructureClass.ElectricalCurrentProbe"/>] structure.
/// </summary>
public static class ElectricalCurrentProbe
{
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains additional descriptive information about the probe or its location.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType029Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(DmiStructureClass.ElectricalCurrentProbe, DmiType029Property.Description);
#endregion
#region [public] {static} (IPropertyKey) MaximumValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Maximum temperature readable by this probe, in milliamps.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType029Property.MaximumValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mA"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey MaximumValue => new PropertyKey(DmiStructureClass.ElectricalCurrentProbe, DmiType029Property.MaximumValue, PropertyUnit.mA);
#endregion
#region [public] {static} (IPropertyKey) MinimumValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Minimun temperature readable by this probe, in milliamps.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType029Property.MinimumValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mA"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey MinimumValue => new PropertyKey(DmiStructureClass.ElectricalCurrentProbe, DmiType029Property.MinimumValue, PropertyUnit.mA);
#endregion
#region [public] {static} (IPropertyKey) Resolution: Gets a value representing the key to retrieve the property value.
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Resolution for the probe’s reading, in tenths of milliamps.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType029Property.Resolution"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mA"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Resolution => new PropertyKey(DmiStructureClass.ElectricalCurrentProbe, DmiType029Property.Resolution, PropertyUnit.mA);
#endregion
#region [public] {static} (IPropertyKey) Tolerance: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Tolerance for reading from this probe, in plus/minus milliamps.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType029Property.Tolerance"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mA"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Tolerance => new PropertyKey(DmiStructureClass.TemperatureProbe, DmiType029Property.Tolerance, PropertyUnit.mA);
#endregion
#region [public] {static} (IPropertyKey) Accuracy: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Accuracy for reading from this probe, in plus/minus 1/100th of a percent.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType029Property.Accuracy"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Percent_1_100th"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Accuracy => new PropertyKey(DmiStructureClass.ElectricalCurrentProbe, DmiType029Property.Accuracy, PropertyUnit.Percent_1_100th);
#endregion
#region [public] {static} (IPropertyKey) OemDefined: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>OEM or BIOS vendor-specific information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType029Property.OemDefined"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// </summary>
public static IPropertyKey OemDefined => new PropertyKey(DmiStructureClass.ElectricalCurrentProbe, DmiType029Property.OemDefined);
#endregion
#region [public] {static} (IPropertyKey) NominalValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Nominal value for the probe’s reading in milliamps.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType029Property.NominalValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.mA"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey NominalValue => new PropertyKey(DmiStructureClass.ElectricalCurrentProbe, DmiType029Property.NominalValue, PropertyUnit.mA);
#endregion
#region nested classes
#region [public] {static} (class) LocationAndStatus: Contains the key definition for the 'Location And Status' section
/// <summary>
/// Contains the key definition for the <b>Location And Status</b> section.
/// </summary>
public static class LocationAndStatus
{
#region [public] {static} (IPropertyKey) Location: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Probe’s physical location of the temperature monitored by this temperature probe.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType029Property.Location"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Location => new PropertyKey(DmiStructureClass.ElectricalCurrentProbe, DmiType029Property.Location);
#endregion
#region [public] {static} (IPropertyKey) Status: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Probe’s physical status of the temperature monitored by this temperature probe.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ElectricalCurrentProbe"/></description></item>
/// <item><description>Property: <see cref="DmiType029Property.Status"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Status => new PropertyKey(DmiStructureClass.ElectricalCurrentProbe, DmiType029Property.Status);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) OutOfBandRemote: Contains the key definitions available for a type 030 [Out-of-Band Remote Access] structure
/// <summary>
/// Contains the key definitions available for a type 030 [<see cref="DmiStructureClass.OutOfBandRemote"/>] structure.
/// </summary>
public static class OutOfBandRemote
{
#region [public] {static} (IPropertyKey) ManufacturerName: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains the manufacturer of the out-of-band access facility.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.OutOfBandRemote"/></description></item>
/// <item><description>Property: <see cref="DmiType030Property.ManufacturerName"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Manufacturer => new PropertyKey(DmiStructureClass.OutOfBandRemote, DmiType030Property.ManufacturerName);
#endregion
#region nested classes
#region [public] {static} (class) Connections: Contains the key definition for the 'Connections And Status' section
/// <summary>
/// Contains the key definition for the <b>Connections And Status</b> section.
/// </summary>
public static class Connections
{
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates whether is allowed to initiate outbound connections to contact an alert management facility when critical conditions occur.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.OutOfBandRemote"/></description></item>
/// <item><description>Property: <see cref="DmiType030Property.OutBoundConnection"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey OutBoundConnection => new PropertyKey(DmiStructureClass.OutOfBandRemote, DmiType030Property.OutBoundConnection);
#endregion
#region [public] {static} (IPropertyKey) InBoundConnection: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates whether is allowed to initiate outbound connections to receive incoming connections for the purpose of remote operations or problem management.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.OutOfBandRemote"/></description></item>
/// <item><description>Property: <see cref="DmiType030Property.InBoundConnection"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey InBoundConnection => new PropertyKey(DmiStructureClass.OutOfBandRemote, DmiType030Property.InBoundConnection);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) BootIntegrityServicesEntryPoint: Contains the key definitions available for a type 031 [Boot Integrity Services (BIS) Entry Point] structure
/// <summary>
/// Contains the key definitions available for a type 031 [<see cref="DmiStructureClass.BootIntegrityServicesEntryPoint"/>] structure.
/// </summary>
public static class BootIntegrityServicesEntryPoint
{
#region [public] {static} (IPropertyKey) Checksum: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Checksum.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BootIntegrityServicesEntryPoint"/></description></item>
/// <item><description>Property: <see cref="DmiType031Property.Checksum"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey Checksum => new PropertyKey(DmiStructureClass.BootIntegrityServicesEntryPoint, DmiType031Property.Checksum);
#endregion
#region [public] {static} (IPropertyKey) BisEntryPointAddress16: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Entry point address bis 16bits.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BootIntegrityServicesEntryPoint"/></description></item>
/// <item><description>Property: <see cref="DmiType031Property.BisEntryPointAddress16"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey BisEntryPointAddress16 => new PropertyKey(DmiStructureClass.BootIntegrityServicesEntryPoint, DmiType031Property.BisEntryPointAddress16);
#endregion
#region [public] {static} (IPropertyKey) BisEntryPointAddress32: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Entry point address bis 32bits.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BootIntegrityServicesEntryPoint"/></description></item>
/// <item><description>Property: <see cref="DmiType031Property.BisEntryPointAddress32"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey BisEntryPointAddress32 => new PropertyKey(DmiStructureClass.BootIntegrityServicesEntryPoint, DmiType031Property.BisEntryPointAddress32);
#endregion
}
#endregion
#region [public] {static} (class) SystemBoot: Contains the key definitions available for a type 032 [System Boot Information] structure
/// <summary>
/// Contains the key definitions available for a type 032 [<see cref="DmiStructureClass.SystemBoot"/> Information] structure.
/// </summary>
public static class SystemBoot
{
#region [public] {static} (IPropertyKey) Reserved: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Reserved for future assignment by this specification; all bytes are set to 00h.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemBoot"/></description></item>
/// <item><description>Property: <see cref="DmiType032Property.Reserved"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Reserved => new PropertyKey(DmiStructureClass.SystemBoot, DmiType032Property.Reserved);
#endregion
#region [public] {static} (IPropertyKey) BootStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Status and additional data fields that identify the boot status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemBoot"/></description></item>
/// <item><description>Property: <see cref="DmiType032Property.BootStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey BootStatus => new PropertyKey(DmiStructureClass.SystemBoot, DmiType032Property.BootStatus);
#endregion
}
#endregion
#region [public] {static} (class) BitMemoryError64: Contains the key definitions available for a type 033 [64-Bit Memory Error Information] structure
/// <summary>
/// Contains the key definitions available for a type 033 [<see cref="DmiStructureClass.BitMemoryError64"/>] structure.
/// </summary>
public static class BitMemoryError64
{
#region [public] {static} (IPropertyKey) ErrorType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Type of error that is associated with the current status reported for the memory array or device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BitMemoryError64"/></description></item>
/// <item><description>Property: <see cref="DmiType033Property.ErrorType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ErrorType => new PropertyKey(DmiStructureClass.BitMemoryError64, DmiType033Property.ErrorType);
#endregion
#region [public] {static} (IPropertyKey) ErrorGranularity: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Granularity (for example, device versus Partition) to which the error can be resolved.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BitMemoryError64"/></description></item>
/// <item><description>Property: <see cref="DmiType033Property.ErrorGranularity"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ErrorGranularity => new PropertyKey(DmiStructureClass.BitMemoryError64, DmiType033Property.ErrorGranularity);
#endregion
#region [public] {static} (IPropertyKey) ErrorOperation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Memory access operation that caused the error.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BitMemoryError64"/></description></item>
/// <item><description>Property: <see cref="DmiType033Property.ErrorOperation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ErrorOperation => new PropertyKey(DmiStructureClass.BitMemoryError64, DmiType033Property.ErrorOperation);
#endregion
#region [public] {static} (IPropertyKey) VendorSyndrome: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Vendor-specific ECC syndrome or CRC data associated with the erroneous access.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BitMemoryError64"/></description></item>
/// <item><description>Property: <see cref="DmiType033Property.VendorSyndrome"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// </summary>
public static IPropertyKey VendorSyndrome => new PropertyKey(DmiStructureClass.BitMemoryError64, DmiType033Property.VendorSyndrome);
#endregion
#region [public] {static} (IPropertyKey) MemoryArrayErrorAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>32-bit physical address of the error based on the addressing of the bus to which the memory array is connected.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BitMemoryError64"/></description></item>
/// <item><description>Property: <see cref="DmiType033Property.MemoryArrayErrorAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// </summary>
public static IPropertyKey MemoryArrayErrorAddress => new PropertyKey(DmiStructureClass.BitMemoryError64, DmiType033Property.MemoryArrayErrorAddress);
#endregion
#region [public] {static} (IPropertyKey) DeviceErrorAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>32-bit physical address of the error relative to the start of the failing memory device, in bytes</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BitMemoryError64"/></description></item>
/// <item><description>Property: <see cref="DmiType033Property.DeviceErrorAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// </summary>
public static IPropertyKey DeviceErrorAddress => new PropertyKey(DmiStructureClass.BitMemoryError64, DmiType033Property.DeviceErrorAddress);
#endregion
#region [public] {static} (IPropertyKey) ErrorResolution: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Range, in bytes, within which the error can be determined, when an error address is given</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.BitMemoryError64"/></description></item>
/// <item><description>Property: <see cref="DmiType033Property.ErrorResolution"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// </summary>
public static IPropertyKey ErrorResolution => new PropertyKey(DmiStructureClass.BitMemoryError64, DmiType033Property.ErrorResolution);
#endregion
}
#endregion
#region [public] {static} (class) ManagementDevice: Contains the key definitions available for a type 034 [Management Device] structure
/// <summary>
/// Contains the key definitions available for a type 034 [<see cref="DmiStructureClass.ManagementDevice"/>] structure.
/// </summary>
public static class ManagementDevice
{
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains additional descriptive information about the device or its location.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType034Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(DmiStructureClass.ManagementDevice, DmiType034Property.Description);
#endregion
#region [public] {static} (IPropertyKey) Type: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Device’s type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType034Property.Type"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Type => new PropertyKey(DmiStructureClass.ManagementDevice, DmiType034Property.Type);
#endregion
#region [public] {static} (IPropertyKey) Address: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Device’s address.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType034Property.Address"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Address => new PropertyKey(DmiStructureClass.ManagementDevice, DmiType034Property.Address);
#endregion
#region [public] {static} (IPropertyKey) AddressType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Type of addressing used to access the device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType034Property.AddressType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey AddressType => new PropertyKey(DmiStructureClass.ManagementDevice, DmiType034Property.AddressType);
#endregion
}
#endregion
#region [public] {static} (class) ManagementDeviceComponent: Contains the key definitions available for a type 035 [Management Device Component] structure
/// <summary>
/// Contains the key definitions available for a type 035 [<see cref="DmiStructureClass.ManagementDeviceComponent"/>] structure.
/// </summary>
public static class ManagementDeviceComponent
{
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains additional descriptive information about the component.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType035Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(DmiStructureClass.ManagementDeviceComponent, DmiType035Property.Description);
#endregion
#region [public] {static} (IPropertyKey) ManagementDeviceHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, of the Management Device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType035Property.ManagementDeviceHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey ManagementDeviceHandle => new PropertyKey(DmiStructureClass.ManagementDeviceComponent, DmiType035Property.ManagementDeviceHandle);
#endregion
#region [public] {static} (IPropertyKey) ComponentHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, of the probe or cooling device that defines this component.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType035Property.ComponentHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey ComponentHandle => new PropertyKey(DmiStructureClass.ManagementDeviceComponent, DmiType035Property.ComponentHandle);
#endregion
#region [public] {static} (IPropertyKey) ThresholdHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with the device thresholds.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType035Property.ThresholdHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey ThresholdHandle => new PropertyKey(DmiStructureClass.ManagementDeviceComponent, DmiType035Property.ThresholdHandle);
#endregion
}
#endregion
#region [public] {static} (class) ManagementDeviceThresholdData: Contains the key definitions available for a type 036 [Management Device Threshold Data] structure
/// <summary>
/// Contains the key definitions available for a type 036 [<see cref="DmiStructureClass.ManagementDeviceThresholdData"/>] structure.
/// </summary>
public static class ManagementDeviceThresholdData
{
#region [public] {static} (IPropertyKey) LowerNonCritical: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Lower non-critical threshold for this component.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementDeviceThresholdData"/></description></item>
/// <item><description>Property: <see cref="DmiType036Property.LowerNonCritical"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey LowerNonCritical => new PropertyKey(DmiStructureClass.ManagementDeviceThresholdData, DmiType036Property.LowerNonCritical);
#endregion
#region [public] {static} (IPropertyKey) UpperNonCritical: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Upper non-critical threshold for this component.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementDeviceThresholdData"/></description></item>
/// <item><description>Property: <see cref="DmiType036Property.UpperNonCritical"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey UpperNonCritical => new PropertyKey(DmiStructureClass.ManagementDeviceThresholdData, DmiType036Property.UpperNonCritical);
#endregion
#region [public] {static} (IPropertyKey) LowerCritical: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Lower critical threshold for this component.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementDeviceThresholdData"/></description></item>
/// <item><description>Property: <see cref="DmiType036Property.LowerCritical"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey LowerCritical => new PropertyKey(DmiStructureClass.ManagementDeviceThresholdData, DmiType036Property.LowerCritical);
#endregion
#region [public] {static} (IPropertyKey) UpperCritical: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Upper critical threshold for this component.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementDeviceThresholdData"/></description></item>
/// <item><description>Property: <see cref="DmiType036Property.LowerCritical"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey UpperCritical => new PropertyKey(DmiStructureClass.ManagementDeviceThresholdData, DmiType036Property.UpperCritical);
#endregion
#region [public] {static} (IPropertyKey) LowerNonRecoverable: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Lower non-recoverable threshold for this component.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementDeviceThresholdData"/></description></item>
/// <item><description>Property: <see cref="DmiType036Property.LowerNonRecoverable"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey LowerNonRecoverable => new PropertyKey(DmiStructureClass.ManagementDeviceThresholdData, DmiType036Property.LowerNonRecoverable);
#endregion
#region [public] {static} (IPropertyKey) UpperNonRecoverable: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Upper non-recoverable threshold for this component.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementDeviceThresholdData"/></description></item>
/// <item><description>Property: <see cref="DmiType036Property.UpperNonRecoverable"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey UpperNonRecoverable => new PropertyKey(DmiStructureClass.ManagementDeviceThresholdData, DmiType036Property.UpperNonRecoverable);
#endregion
}
#endregion
#region [public] {static} (class) MemoryChannel: Contains the key definitions available for a type 037 [Memory Channel] structure
/// <summary>
/// Contains the key definitions available for a type 037 [<see cref="DmiStructureClass.MemoryChannel"/>] structure.
/// </summary>
public static class MemoryChannel
{
#region [public] {static} (IPropertyKey) ChannelType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Type of memory associated with the channel.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryChannel"/></description></item>
/// <item><description>Property: <see cref="DmiType037Property.ChannelType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ChannelType => new PropertyKey(DmiStructureClass.MemoryChannel, DmiType037Property.ChannelType);
#endregion
#region [public] {static} (IPropertyKey) MaximumChannelLoad: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Maximum load supported by the channel; the sum of all device loads cannot exceed this value.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryChannel"/></description></item>
/// <item><description>Property: <see cref="DmiType037Property.MaximumChannelLoad"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey MaximunChannelLoad => new PropertyKey(DmiStructureClass.MemoryChannel, DmiType037Property.MaximumChannelLoad);
#endregion
#region [public] {static} (IPropertyKey) Devices: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Devices collection.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryChannel"/></description></item>
/// <item><description>Property: <see cref="DmiType037Property.Devices"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="DmiMemoryChannelElementCollection"/></para>
/// </para>
/// </summary>
public static IPropertyKey Devices => new PropertyKey(DmiStructureClass.MemoryChannel, DmiType037Property.Devices);
#endregion
#region nested classes
#region [public] {static} (class) MemoryDevices: Contains the key definition for the 'Memory Devices' section
/// <summary>
/// Contains the key definition for the <b>Memory Devices</b> section.
/// </summary>
public static class MemoryDevices
{
#region [public] {static} (IPropertyKey) Handle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Structure handle that identifies the memory device associated with this channel.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryChannel"/></description></item>
/// <item><description>Property: <see cref="DmiType037Property.Handle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey Handle => new PropertyKey(DmiStructureClass.MemoryChannel, DmiType037Property.Handle);
#endregion
#region [public] {static} (IPropertyKey) Load: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Channel load provided by the memory device associated with this channel.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.MemoryChannel"/></description></item>
/// <item><description>Property: <see cref="DmiType037Property.Load"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey Load => new PropertyKey(DmiStructureClass.MemoryChannel, DmiType037Property.Load);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) IpmiDevice: Contains the key definitions available for a type 038 [IPMI Device Information] structure
/// <summary>
/// Contains the key definitions available for a type 038 [<see cref="DmiStructureClass.IpmiDevice"/> Information] structure.
/// </summary>
public static class IpmiDevice
{
#region [public] {static} (IPropertyKey) BaseAdress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Base address (either memory-mapped or I/O) of the BMC. If the least-significant bit of the field is a 1,
/// the address is in I/O space; otherwise, the address is memory-mapped.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType038Property.BaseAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// </summary>
public static IPropertyKey BaseAddress => new PropertyKey(DmiStructureClass.IpmiDevice, DmiType038Property.BaseAddress);
#endregion
#region [public] {static} (IPropertyKey) NVStorageDeviceAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Bus ID of the NV storage device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType038Property.NvStorageDeviceAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="Nullable{T}"/> where <b>T</b> is <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey NVStorageDeviceAddress => new PropertyKey(DmiStructureClass.IpmiDevice, DmiType038Property.NvStorageDeviceAddress);
#endregion
#region [public] {static} (IPropertyKey) I2CSlaveAddress: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Slave address on the I2C bus of this BMC.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType038Property.I2CSlaveAddress"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey I2CSlaveAddress => new PropertyKey(DmiStructureClass.IpmiDevice, DmiType038Property.I2CSlaveAddress);
#endregion
#region [public] {static} (IPropertyKey) InterfaceType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Baseboard Management Controller (BMC) interface type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType038Property.InterfaceType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey InterfaceType => new PropertyKey(DmiStructureClass.IpmiDevice, DmiType038Property.InterfaceType);
#endregion
#region [public] {static} (IPropertyKey) InterruptNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Interrupt number for IPMI System Interface.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType038Property.InterfaceType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey InterruptNumber => new PropertyKey(DmiStructureClass.IpmiDevice, DmiType038Property.InterruptNumber);
#endregion
#region [public] {static} (IPropertyKey) SpecificationRevision: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>IPMI specification revision, in BCD format, to which the BMC was designed.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType038Property.SpecificationRevision"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey SpecificationRevision => new PropertyKey(DmiStructureClass.IpmiDevice, DmiType038Property.SpecificationRevision);
#endregion
#region nested classes
#region [public] {static} (class) BaseAdressModifier: Contains the key definition for the 'Base Adress Modifier' section
/// <summary>
/// Contains the key definition for the <b>Base Adress Modifier</b> section.
/// </summary>
public static class BaseAdressModifier
{
#region [public] {static} (IPropertyKey) RegisterSpacing: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Register spacing.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType038Property.RegisterSpacing"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey RegisterSpacing => new PropertyKey(DmiStructureClass.IpmiDevice, DmiType038Property.RegisterSpacing);
#endregion
#region [public] {static} (IPropertyKey) LsBit: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>LS-bit for addresses.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType038Property.LsBit"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey LsBit => new PropertyKey(DmiStructureClass.IpmiDevice, DmiType038Property.LsBit);
#endregion
}
#endregion
#region [public] {static} (class) Interrupt: Definition of keys for the 'Interrupt' section
/// <summary>
/// Definition of keys for the '<b>Interrupt</b>' section.
/// </summary>
[SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public static class Interrupt
{
#region [public] {static} (IPropertyKey) Polarity: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Interrupt Polarity.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType038Property.Polarity"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Polarity => new PropertyKey(DmiStructureClass.IpmiDevice, DmiType038Property.Polarity);
#endregion
#region [public] {static} (IPropertyKey) SpecifiedInfo: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Interrupt information specified.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType038Property.SpecifiedInfo"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey SpecifiedInfo => new PropertyKey(DmiStructureClass.IpmiDevice, DmiType038Property.SpecifiedInfo);
#endregion
#region [public] {static} (IPropertyKey) TriggerMode: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Interrupt trigger mode.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.IpmiDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType038Property.TriggerMode"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey TriggerMode => new PropertyKey(DmiStructureClass.IpmiDevice, DmiType038Property.TriggerMode);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) SystemPowerSupply: Contains the key definitions available for a type 039 [System Power Supply] structure
/// <summary>
/// Contains the key definitions available for a type 039 [<see cref="DmiStructureClass.SystemPowerSupply"/> Information] structure.
/// </summary>
public static class SystemPowerSupply
{
#region [public] {static} (IPropertyKey) IsRedundant: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates whether it is redundant.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.IsRedundant"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey IsRedundant => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.IsRedundant);
#endregion
#region [public] {static} (IPropertyKey) Location: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Identifies the location of the power supply.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.Location"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Location => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.Location);
#endregion
#region [public] {static} (IPropertyKey) DeviceName: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Names the power supply device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.DeviceName"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey DeviceName => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.DeviceName);
#endregion
#region [public] {static} (IPropertyKey) Manufacturer: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Names the company that manufactured the supply.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.Manufacturer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Manufacturer => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.Manufacturer);
#endregion
#region [public] {static} (IPropertyKey) SerialNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains the serial number for the power supply.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.SerialNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey SerialNumber => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.SerialNumber);
#endregion
#region [public] {static} (IPropertyKey) AssetTagNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains the asset tag number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.AssetTagNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey AssetTagNumber => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.AssetTagNumber);
#endregion
#region [public] {static} (IPropertyKey) ModelPartNumber: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Contains the OEM part order number.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.ModelPartNumber"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ModelPartNumber => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.ModelPartNumber);
#endregion
#region [public] {static} (IPropertyKey) RevisionLevel: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Power supply revision string.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.RevisionLevel"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey RevisionLevel => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.RevisionLevel);
#endregion
#region [public] {static} (IPropertyKey) MaxPowerCapacity: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Maximum sustained power output in Watts.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.MaxPowerCapacity"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.W"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey MaxPowerCapacity => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.MaxPowerCapacity, PropertyUnit.W);
#endregion
#region [public] {static} (IPropertyKey) InputVoltageProbeHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, of a voltage probe monitoring this power supply’s input voltage.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.InputVoltageProbeHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey InputVoltageProbeHandle => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.InputVoltageProbeHandle);
#endregion
#region [public] {static} (IPropertyKey) CoolingDeviceHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, of a cooling device associated with this power supply</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.CoolingDeviceHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey CoolingDeviceHandle => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.CoolingDeviceHandle);
#endregion
#region [public] {static} (IPropertyKey) InputCurrentProbeHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, of the electrical current probe monitoring this power supply’s input current.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.InputCurrentProbeHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey InputCurrentProbeHandle => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.InputCurrentProbeHandle);
#endregion
#region nested classes
#region [public] {static} (class) Characteristics: Contains the key definition for the 'Characteristics' section.
/// <summary>
/// Contains the key definition for the <b>Characteristics</b> section.
/// </summary>
public static class Characteristics
{
#region [public] {static} (IPropertyKey) InputVoltageRange: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Input voltage range switching.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.InputVoltageRange"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey InputVoltageRange => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.InputVoltageRange);
#endregion
#region [public] {static} (IPropertyKey) IsHotReplaceable: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates whethe power supply is hot-replaceable.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.IsHotReplaceable"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey IsHotReplaceable => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.IsHotReplaceable);
#endregion
#region [public] {static} (IPropertyKey) IsPlugged: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates whethe power supply is plugged.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.IsPlugged"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey IsPlugged => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.IsPlugged);
#endregion
#region [public] {static} (IPropertyKey) IsPresent: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates whethe power supply is present.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.IsPresent"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="bool"/></para>
/// </para>
/// </summary>
public static IPropertyKey IsPresent => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.IsPresent);
#endregion
#region [public] {static} (IPropertyKey) Status: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Power supply status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.Status"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Status => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.Status);
#endregion
#region [public] {static} (IPropertyKey) SupplyType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Power supply type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.SystemPowerSupply"/></description></item>
/// <item><description>Property: <see cref="DmiType039Property.SupplyType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey SupplyType => new PropertyKey(DmiStructureClass.SystemPowerSupply, DmiType039Property.SupplyType);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) AdditionalInformation: Contains the key definitions available for a type 040 [Additional Information] structure
/// <summary>
/// Contains the key definitions available for a type 040 [<see cref="DmiStructureClass.AdditionalInformation"/>] structure.
/// </summary>
public static class AdditionalInformation
{
#region [public] {static} (IPropertyKey) Entries: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Collection of additional information entries.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.AdditionalInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType040Property.Entries"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="DmiAdditionalInformationEntryCollection"/></para>
/// </para>
/// </summary>
public static IPropertyKey Entries => new PropertyKey(DmiStructureClass.AdditionalInformation, DmiType040Property.Entries);
#endregion
#region nested classes
#region [public] {static} (class) Entry: Contains the key definition for the 'Entry' section
/// <summary>
/// Contains the key definition for the <b>Entry</b> section.
/// </summary>
public static class Entry
{
#region [public] {static} (IPropertyKey) EntryLength: Obtiene un valor que representa la clave para recuperar la propiedad
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Length of this additional information entry instance; a minimum of 6.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.AdditionalInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType040Property.EntryLength"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey EntryLength => new PropertyKey(DmiStructureClass.AdditionalInformation, DmiType040Property.EntryLength);
#endregion
#region [public] {static} (IPropertyKey) ReferencedHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with the structure for which additional information is provided.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.AdditionalInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType040Property.ReferencedHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// </summary>
public static IPropertyKey ReferencedHandle => new PropertyKey(DmiStructureClass.AdditionalInformation, DmiType040Property.ReferencedHandle);
#endregion
#region [public] {static} (IPropertyKey) ReferencedOffset: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Offset of the field within the structure referenced by the referenced handle for which additional information is provided.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.AdditionalInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType040Property.ReferencedOffset"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey ReferencedOffset => new PropertyKey(DmiStructureClass.AdditionalInformation, DmiType040Property.ReferencedOffset);
#endregion
#region [public] {static} (IPropertyKey) StringValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Optional string to be associated with the field referenced by the referenced offset.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.AdditionalInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType040Property.StringValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey StringValue => new PropertyKey(DmiStructureClass.AdditionalInformation, DmiType040Property.StringValue);
#endregion
#region [public] {static} (IPropertyKey) Value: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>
/// Enumerated value or updated field content that has not yet been approved for publication in this specification and
/// therefore could not be used in the field referenced by referenced offset.
/// </para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.AdditionalInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType040Property.Value"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey Value => new PropertyKey(DmiStructureClass.AdditionalInformation, DmiType040Property.Value);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) OnBoardDevicesExtended: Contains the key definitions available for a type 041 [OnBoard Devices Extended Information] structure
/// <summary>
/// Contains the key definitions available for a type 041 [<see cref="DmiStructureClass.OnBoardDevicesExtended"/> Information] structure.
/// </summary>
public static class OnBoardDevicesExtended
{
#region [public] {static} (IPropertyKey) ReferenceDesignation: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Onboard device reference designation.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.OnBoardDevicesExtended"/></description></item>
/// <item><description>Property: <see cref="DmiType041Property.ReferenceDesignation"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ReferenceDesignation => new PropertyKey(DmiStructureClass.OnBoardDevicesExtended, DmiType041Property.ReferenceDesignation);
#endregion
#region nested classes
#region [public] {static} (class) Element: Contains the key definition for the 'Element' section
/// <summary>
/// Contains the key definition for the <b>Element</b> section.
/// </summary>
public static class Element
{
#region [public] {static} (IPropertyKey) DeviceType: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Device type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.OnBoardDevicesExtended"/></description></item>
/// <item><description>Property: <see cref="DmiType041Property.DeviceType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey DeviceType => new PropertyKey(DmiStructureClass.OnBoardDevicesExtended, DmiType041Property.DeviceType);
#endregion
#region [public] {static} (IPropertyKey) DeviceStatus: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Device status.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.OnBoardDevicesExtended"/></description></item>
/// <item><description>Property: <see cref="DmiType041Property.DeviceStatus"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey DeviceStatus => new PropertyKey(DmiStructureClass.OnBoardDevicesExtended, DmiType041Property.DeviceStatus);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) ManagementControllerHostInterface: Contains the key definitions available for a type 042 [Management Controller Host Interface] structure
/// <summary>
/// Contains the key definitions available for a type 042 [<see cref="DmiStructureClass.ManagementControllerHostInterface"/>] structure.
/// </summary>
public static class ManagementControllerHostInterface
{
#region [public] {static} (IPropertyKey) InterfaceType: Gets a value representing the key to retrieve the property value value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Management Controller Interface Type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementControllerHostInterface"/></description></item>
/// <item><description>Property: <see cref="DmiType042Property.InterfaceType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey InterfaceType => new PropertyKey(DmiStructureClass.ManagementControllerHostInterface, DmiType042Property.InterfaceType);
#endregion
#region [public] {static} (IPropertyKey) InterfaceTypeSpecificData: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Management Controller Host Interface Data as specified by the Interface Type.</para>
/// <para>The format uses the '<b>Enterprise Number</b>' that is assigned and maintained by <b>IANA</b> (www.iana.org) as the means of identifying a particular vendor, company, or organization.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementControllerHostInterface"/></description></item>
/// <item><description>Property: <see cref="DmiType042Property.InterfaceTypeSpecificData"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey InterfaceTypeSpecificData => new PropertyKey(DmiStructureClass.ManagementControllerHostInterface, DmiType042Property.InterfaceTypeSpecificData);
#endregion
#region [public] {static} (IPropertyKey) Protocols: Gets a value representing the key to retrieve the property value value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>A collection of possible values for the Protocol.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementControllerHostInterface"/></description></item>
/// <item><description>Property: <see cref="DmiType042Property.Protocols"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="DmiManagementControllerHostInterfaceProtocolRecordsCollection"/></para>
/// </para>
/// </summary>
public static IPropertyKey Protocols => new PropertyKey(DmiStructureClass.ManagementControllerHostInterface, DmiType042Property.Protocols);
#endregion
#region nested classes
#region [public] {static} (class) Protocol: Contains the key definition for the 'Protocols' section
/// <summary>
/// Contains the key definition for the <b>Elements</b> section.
/// </summary>
public static class Protocol
{
#region [public] {static} (IPropertyKey) ProtocolType: Gets a value representing the key to retrieve the property value value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Protocol type.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementControllerHostInterface"/></description></item>
/// <item><description>Property: <see cref="DmiType042Property.ProtocolType"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey ProtocolType => new PropertyKey(DmiStructureClass.ManagementControllerHostInterface, DmiType042Property.ProtocolType);
#endregion
#region [public] {static} (IPropertyKey) ProtocolTypeSpecificData: Gets a value representing the key to retrieve the property value value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Protocol type specific data.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ManagementControllerHostInterface"/></description></item>
/// <item><description>Property: <see cref="DmiType042Property.ProtocolTypeSpecificData"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey ProtocolTypeSpecificData => new PropertyKey(DmiStructureClass.ManagementControllerHostInterface, DmiType042Property.ProtocolTypeSpecificData);
#endregion
}
#endregion
#endregion
}
#endregion
#region [public] {static} (class) TpmDevice: Contains the key definitions available for a type 043 [Tpm Device] structure
/// <summary>
/// Contains the key definitions available for a type 043 [<see cref="DmiStructureClass.TpmDevice"/>] structure.
/// </summary>
public static class TpmDevice
{
#region [public] {static} (IPropertyKey) VendorId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Specified as four ASCII characters.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TpmDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType043Property.VendorId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey VendorId => new PropertyKey(DmiStructureClass.TpmDevice, DmiType043Property.VendorId);
#endregion
#region [public] {static} (IPropertyKey) VendorIdDescription: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Vendor Id description.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TpmDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType043Property.VendorIdDescription"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey VendorIdDescription => new PropertyKey(DmiStructureClass.TpmDevice, DmiType043Property.VendorIdDescription);
#endregion
#region [public] {static} (IPropertyKey) MajorSpecVersion: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Major TPM version supported by the TPM device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TpmDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType043Property.MajorSpecVersion"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey MajorSpecVersion => new PropertyKey(DmiStructureClass.TpmDevice, DmiType043Property.MajorSpecVersion);
#endregion
#region [public] {static} (IPropertyKey) MinorSpecVersion: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Minor TPM version supported by the TPM device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TpmDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType043Property.MinorSpecVersion"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// </summary>
public static IPropertyKey MinorSpecVersion => new PropertyKey(DmiStructureClass.TpmDevice, DmiType043Property.MinorSpecVersion);
#endregion
#region [public] {static} (IPropertyKey) FirmwareVersion: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>TPM firmware version.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TpmDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType043Property.FirmwareVersion"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="Tpm.TpmFirmwareVersion"/></para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareVersion => new PropertyKey(DmiStructureClass.TpmDevice, DmiType043Property.FirmwareVersion);
#endregion
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of descriptive information of the TPM device.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TpmDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType043Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(DmiStructureClass.TpmDevice, DmiType043Property.Description);
#endregion
#region [public] {static} (IPropertyKey) Characteristics: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>TPM device characteristics information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TpmDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType043Property.Characteristics"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// </summary>
public static IPropertyKey Characteristics => new PropertyKey(DmiStructureClass.TpmDevice, DmiType043Property.Characteristics);
#endregion
#region [public] {static} (IPropertyKey) OemDefined: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>OEM- or BIOS vendor-specific information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.TpmDevice"/></description></item>
/// <item><description>Property: <see cref="DmiType043Property.OemDefined"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="uint"/></para>
/// </para>
/// </summary>
public static IPropertyKey OemDefined => new PropertyKey(DmiStructureClass.TpmDevice, DmiType043Property.OemDefined);
#endregion
}
#endregion
#region [public] {static} (class) ProcessorAdditionalInformation: Contains the key definitions available for a type 044 [Processor Additional Information] structure
/// <summary>
/// Contains the key definitions available for a type 044 [<see cref="DmiStructureClass.ProcessorAdditionalInformation"/>] structure.
/// </summary>
public static class ProcessorAdditionalInformation
{
#region [public] {static} (IPropertyKey) ReferencedHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with the processor structure (Type 004).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ProcessorAdditionalInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType044Property.ReferencedHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.3+</para>
/// </para>
/// </summary>
public static IPropertyKey ReferencedHandle => new PropertyKey(DmiStructureClass.ProcessorAdditionalInformation, DmiType044Property.ReferencedHandle);
#endregion
#region [public] {static} (IPropertyKey) ProcessorSpecificBlock: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Processor-specific block.</para>
/// <para>The format of processor-specific data varies between different processor architecture.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.ProcessorAdditionalInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType044Property.ProcessorSpecificBlock"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="Smbios.ProcessorSpecificInformationBlock"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.3+</para>
/// </para>
/// </summary>
public static IPropertyKey ProcessorSpecificBlock => new PropertyKey(DmiStructureClass.ProcessorAdditionalInformation, DmiType044Property.ProcessorSpecificBlock);
#endregion
}
#endregion
#region [public] {static} (class) FirmwareInventoryInformation: Contains the key definitions available for a type 045 [Firmware Inventory Information] structure
/// <summary>
/// Contains the key definitions available for a type 045 [<see cref="DmiStructureClass.FirmwareInventoryInformation"/>] structure.
/// </summary>
public static class FirmwareInventoryInformation
{
#region version 3.5
#region [public] {static} (IPropertyKey) FirmwareComponentName: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of the Firmware Component Name.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType045Property.FirmwareComponentName"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareComponentName => new PropertyKey(DmiStructureClass.FirmwareInventoryInformation, DmiType045Property.FirmwareComponentName);
#endregion
#region [public] {static} (IPropertyKey) FirmwareVersion: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of the Firmware Version of this firmware. The format of this value is defined by the Version Format.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType045Property.FirmwareVersion"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareVersion => new PropertyKey(DmiStructureClass.FirmwareInventoryInformation, DmiType045Property.FirmwareVersion);
#endregion
#region [public] {static} (IPropertyKey) FirmwareVersionFormat: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Describes the format of the Firmware Version and the Lowest Supported Firmware Version.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType045Property.FirmwareVersionFormat"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareVersionFormat => new PropertyKey(DmiStructureClass.FirmwareInventoryInformation, DmiType045Property.FirmwareVersionFormat);
#endregion
#region [public] {static} (IPropertyKey) FirmwareId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of the Firmware ID of this firmware. The format of this value is defined by the Firmware ID Format.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType045Property.FirmwareId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareId => new PropertyKey(DmiStructureClass.FirmwareInventoryInformation, DmiType045Property.FirmwareId);
#endregion
#region [public] {static} (IPropertyKey) FirmwareIdFormat: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Describes the format of the Firmware ID.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType045Property.FirmwareIdFormat"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareIdFormat => new PropertyKey(DmiStructureClass.FirmwareInventoryInformation, DmiType045Property.FirmwareIdFormat);
#endregion
#region [public] {static} (IPropertyKey) FirmwareReleaseDate: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of the firmware release date. The date string, if supplied, follows the Date-Time values format.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType045Property.FirmwareReleaseDate"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareReleaseDate => new PropertyKey(DmiStructureClass.FirmwareInventoryInformation, DmiType045Property.FirmwareReleaseDate);
#endregion
#region [public] {static} (IPropertyKey) FirmwareManufacturer: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of the firmware release date. The date string, if supplied, follows the Date-Time values format.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType045Property.FirmwareManufacturer"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareManufacturer => new PropertyKey(DmiStructureClass.FirmwareInventoryInformation, DmiType045Property.FirmwareManufacturer);
#endregion
#region [public] {static} (IPropertyKey) LowestSupportedFirmwareVersion: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>String number of the lowest version to which this firmware can be rolled back to. The format of this value is defined by the Version Format.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType045Property.LowestSupportedFirmwareVersion"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey LowestSupportedFirmwareVersion => new PropertyKey(DmiStructureClass.FirmwareInventoryInformation, DmiType045Property.LowestSupportedFirmwareVersion);
#endregion
#region [public] {static} (IPropertyKey) FirmwareImageSize: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Size of the firmware image that is currently programmed in the device, in bytes. If the Firmware Image Size is unknown, the field is set to FFFFFFFFFFFFFFFFh</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType045Property.FirmwareImageSize"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.Bytes"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ulong"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareImageSize => new PropertyKey(DmiStructureClass.FirmwareInventoryInformation, DmiType045Property.FirmwareImageSize, PropertyUnit.Bytes);
#endregion
#region [public] {static} (IPropertyKey) FirmwareCharacteristics: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Firmware characteristics information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType045Property.FirmwareCharacteristics"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareCharacteristics => new PropertyKey(DmiStructureClass.FirmwareInventoryInformation, DmiType045Property.FirmwareCharacteristics);
#endregion
#region [public] {static} (IPropertyKey) FirmwareState: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Firmware state information.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType045Property.FirmwareState"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey FirmwareState => new PropertyKey(DmiStructureClass.FirmwareInventoryInformation, DmiType045Property.FirmwareState);
#endregion
#region [public] {static} (IPropertyKey) NumberOfAssociatedComponents: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Defines how many Associated Component Handles are associated with this firmware.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType045Property.NumberOfAssociatedComponents"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="byte"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey NumberOfAssociatedComponents => new PropertyKey(DmiStructureClass.FirmwareInventoryInformation, DmiType045Property.NumberOfAssociatedComponents);
#endregion
#region [public] {static} (IPropertyKey) AssociatedComponentHandles: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Lists the <b>SMBIOS</b> structure handles that are associated with this firmware.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.FirmwareInventoryInformation"/></description></item>
/// <item><description>Property: <see cref="DmiType045Property.AssociatedComponentHandles"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ReadOnlyCollection{T}"/> where <b>T</b> is <see cref="uint"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey AssociatedComponentHandles => new PropertyKey(DmiStructureClass.FirmwareInventoryInformation, DmiType045Property.AssociatedComponentHandles);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) StringProperty: Contains the key definitions available for a type 046 [String Property] structure
/// <summary>
/// Contains the key definitions available for a type 046 [<see cref="DmiStructureClass.StringProperty"/>] structure.
/// </summary>
public static class StringProperty
{
#region version 3.5
#region [public] {static} (IPropertyKey) PropertyId: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with the processor structure (Type 004).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.StringProperty"/></description></item>
/// <item><description>Property: <see cref="DmiType046Property.PropertyId"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey PropertyId => new PropertyKey(DmiStructureClass.StringProperty, DmiType046Property.PropertyId);
#endregion
#region [public] {static} (IPropertyKey) PropertyValue: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with the processor structure (Type 004).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.StringProperty"/></description></item>
/// <item><description>Property: <see cref="DmiType046Property.PropertyValue"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey PropertyValue => new PropertyKey(DmiStructureClass.StringProperty, DmiType046Property.PropertyValue);
#endregion
#region [public] {static} (IPropertyKey) ParentHandle: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Handle, or instance number, associated with the processor structure (Type 004).</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.StringProperty"/></description></item>
/// <item><description>Property: <see cref="DmiType046Property.ParentHandle"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="ushort"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>3.5</para>
/// </para>
/// </summary>
public static IPropertyKey ParentHandle => new PropertyKey(DmiStructureClass.StringProperty, DmiType046Property.ParentHandle);
#endregion
#endregion
}
#endregion
#region [public] {static} (class) Inactive: Contains the key definitions available for a type 126 [Inactive] structure
/// <summary>
/// Contains the key definitions available for a type 126 [<see cref="DmiStructureClass.Inactive"/>] structure.
/// </summary>
public static class Inactive
{
#region [public] {static} (IPropertyKey) Description: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates end of structures. Always returns the '<b>Inactive</b>' string.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.Inactive"/></description></item>
/// <item><description>Property: <see cref="DmiType126Property.Description"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>Any version</para>
/// </para>
/// </summary>
public static IPropertyKey Description => new PropertyKey(DmiStructureClass.Inactive, DmiType126Property.Description);
#endregion
}
#endregion
#region [public] {static} (class) EndOfTable: Contains the key definitions available for a type 127 [End-Of-Table] structure
/// <summary>
/// Contains the key definitions available for a type 127 [<see cref="DmiStructureClass.EndOfTable"/>] structure.
/// </summary>
public static class EndOfTable
{
#region [public] {static} (IPropertyKey) Status: Gets a value representing the key to retrieve the property value
/// <summary>
/// <para>Gets a value representing the key to retrieve the property value.</para>
/// <para>Indicates end of structures. Always returns the '<b>End Of Table Structures</b>' string.</para>
/// <para>
/// <para><b>Key Composition</b></para>
/// <list type="bullet">
/// <item><description>Structure: <see cref="DmiStructureClass.EndOfTable"/></description></item>
/// <item><description>Property: <see cref="DmiType127Property.Status"/></description></item>
/// <item><description>Unit: <see cref="PropertyUnit.None"/></description></item>
/// </list>
/// </para>
/// <para>
/// <para><b>Return Value</b></para>
/// <para>Type: <see cref="string"/></para>
/// </para>
/// <para>
/// <para><b>Remarks</b></para>
/// <para>Any version</para>
/// </para>
/// </summary>
public static IPropertyKey Status => new PropertyKey(DmiStructureClass.EndOfTable, DmiType127Property.Status);
#endregion
}
#endregion
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType019 [Memory Array Mapped Address].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 019: Memory Array Mapped Address.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.1+ Type BYTE 19 Memory Array Mapped Address indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.1+ Length BYTE 0Fh Length of the structure. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 2.1+ Handle WORD Varies The handle, or instance number, associated|
// | with the structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 2.1+ Starting DWORD Varies The physical address, in kilobytes, of a |
// | Address range of memory mapped to the specified |
// | Physical Memory Array. |
// | When the field value is FFFF FFFFh, the |
// | actual address is stored in the Extended |
// | Starting Address field. |
// | When this field contains a valid address, |
// | Ending Address must also contain a valid |
// | address. |
// | When this field contains FFFF FFFFh, |
// | Ending Address must also contain |
// | FFFF FFFFh. |
// | Note: See StartingAddress |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h 2.1+ Ending DWORD Varies The physical ending address of the last |
// | Address kilobyte of a range of addresses mapped |
// | to the specified Physical Memory Array. |
// | When the field value is FFFF FFFFh and |
// | the Starting Address field also contains |
// | FFFF FFFFh, the actual address is stored |
// | in the Extended Ending Address field. |
// | When this field contains a valid address, |
// | Starting Address must also contain a |
// | valid address. |
// | Note: See EndingAddress |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ch 2.1+ Memory Array WORD Varies The handle, or instance number, associated|
// | Handle with the Physical Memory Array to which |
// | this address range is mapped. |
// | Multiple address ranges can be mapped to |
// | a single Physical Memory Array. |
// | Note: See ArrayHandle |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Eh 2.1+ Partition BYTE Varies Identifies the number of Memory Devices |
// | Width that form a single row of memory for the |
// | address partition defined by this |
// | structure. |
// | Note: See DeviceNumber |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Fh 2.7+ Extended QWORD Varies The physical address, in bytes, of a range|
// | Starting of memory mapped to the specified Physical|
// | Address Memory Array. |
// | This field is valid when Starting Address |
// | contains the value FFFF FFFFh. |
// | If Starting Address contains a value other|
// | than FFFF FFFFh, this field contains |
// | zeros. |
// | When this field contains a valid address, |
// | Extended Ending Address must also contain |
// | a valid address. |
// | Note: See ExtendedStartingAddress |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 17h 2.7+ Extended QWORD Varies The physical address, in bytes, of a range|
// | Ending of addresses mapped to the specified |
// | Address Physical Memory Array. |
// | This field is valid when Starting Address |
// | contains the value FFFF FFFFh. |
// | If Starting Address contains a value other|
// | than FFFF FFFFh, this field contains |
// | zeros. |
// | When this field contains a valid address, |
// | Extended Ending Address must also contain |
// | a valid address. |
// | Note: See ExtendedEndingAddress |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Memory Array Mapped Address (Type 19) structure.
/// </summary>
internal sealed class SmbiosType019 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType019"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType019(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
#region Version 2.1+ fields
/// <summary>
/// Gets a value representing the <b>Starting Address</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint StartingAddress => (uint)Reader.GetDoubleWord(0x04);
/// <summary>
/// Gets a value representing the <b>Ending Address</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint EndingAddress => (uint)Reader.GetDoubleWord(0x08);
/// <summary>
/// Gets a value representing the <b>Memory Array Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort MemoryArrayHandle => (ushort)Reader.GetWord(0x0c);
/// <summary>
/// Gets a value representing the <b>Partition Width</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte PartitionWidth => Reader.GetByte(0x0e);
#endregion
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
#region 2.1+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v21)
{
properties.Add(SmbiosProperty.MemoryArrayMappedAddress.StartingAddress, StartingAddress);
properties.Add(SmbiosProperty.MemoryArrayMappedAddress.EndingAddress, EndingAddress);
properties.Add(SmbiosProperty.MemoryArrayMappedAddress.MemoryArrayHandle, MemoryArrayHandle);
properties.Add(SmbiosProperty.MemoryArrayMappedAddress.PartitionWidth, PartitionWidth);
}
#endregion
#region 2.7+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v27)
{
var extendedStartingAddress = Reader.GetQuadrupleWord(0x0f);
properties.Add(SmbiosProperty.MemoryArrayMappedAddress.ExtendedStartingAddress, extendedStartingAddress);
var extendedEndingAddress = Reader.GetQuadrupleWord(0x17);
properties.Add(SmbiosProperty.MemoryArrayMappedAddress.ExtendedEndingAddress, extendedEndingAddress);
}
#endregion
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemPowerControls/Day.md
# DmiProperty.SystemPowerControls.Day property
Gets a value representing the key to retrieve the property value.
BCD value of the day-of-month on which the next scheduled power-on is to occur, in the range 01h to 31h.
Key Composition
* Structure: SystemPowerControls
* Property: Day
* Unit: None
Return Value
Type: Byte
```csharp
public static IPropertyKey Day { get; }
```
## See Also
* class [SystemPowerControls](../DmiProperty.SystemPowerControls.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Cache/InstalledCacheSize.md
# DmiProperty.Cache.InstalledCacheSize property
Gets a value representing the key to retrieve the property value.
Installed size.
Key Composition
* Structure: Cache
* Property: InstalledCacheSize
* Unit: KB
Return Value
Type: Int32
Remarks
2.0+
```csharp
public static IPropertyKey InstalledCacheSize { get; }
```
## See Also
* class [Cache](../DmiProperty.Cache.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PortableBattery/DesignCapacity.md
# DmiProperty.PortableBattery.DesignCapacity property
Gets a value representing the key to retrieve the property value.
Design capacity of the battery in mWatt-hours.
Key Composition
* Structure: PortableBattery
* Property: DesignCapacity
* Unit: mWh
Return Value
Type: UInt16
Remarks
2.1+
```csharp
public static IPropertyKey DesignCapacity { get; }
```
## See Also
* class [PortableBattery](../DmiProperty.PortableBattery.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType009 [Slot Information].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Slot Information (Type 9) structure.<br/>
/// For more information, please see <see cref="SmbiosType009"/>.
/// </summary>
internal sealed class DmiType009 : DmiBaseType<SmbiosType009>
{
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType009"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType009(SmbiosType009 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
#region 2.0+
if (SmbiosStructure.StructureInfo.Length >= 0x0c)
{
object slotDesignation = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.SlotDesignation);
if (slotDesignation != null)
{
properties.Add(DmiProperty.SystemSlots.SlotDesignation, slotDesignation);
}
object slotType = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.SlotType);
if (slotType != null)
{
properties.Add(DmiProperty.SystemSlots.SlotType, slotType);
}
object slotDataBusWidth = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.SlotDataBusWidth);
if (slotDataBusWidth != null)
{
properties.Add(DmiProperty.SystemSlots.SlotDataBusWidth, slotDataBusWidth);
}
object currentUsage = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.CurrentUsage);
if (currentUsage != null)
{
properties.Add(DmiProperty.SystemSlots.CurrentUsage, currentUsage);
}
object slotLength = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.SlotLength);
if (slotLength != null)
{
properties.Add(DmiProperty.SystemSlots.SlotLength, slotLength);
}
object slotId = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.SlotId);
if (slotId != null)
{
properties.Add(DmiProperty.SystemSlots.SlotId, slotId);
}
}
#endregion
#region 2.1+
object characteristics = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.Characteristics);
if (characteristics != null)
{
properties.Add(DmiProperty.SystemSlots.Characteristics, characteristics);
}
#endregion
#region 2.6+
if (SmbiosStructure.StructureInfo.Length >= 0x11)
{
object segmentBusFunction = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.SegmentBusFunction);
if (segmentBusFunction != null)
{
properties.Add(DmiProperty.SystemSlots.SegmentBusFunction, segmentBusFunction);
}
object busDeviceFunction = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.BusDeviceFunction);
if (busDeviceFunction != null)
{
properties.Add(DmiProperty.SystemSlots.BusDeviceFunction, busDeviceFunction);
}
}
#endregion
#region 3.2
if (SmbiosStructure.StructureInfo.StructureVersion >= SmbiosStructureVersion.v32)
{
object peerDevices = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.PeerDevices);
if (peerDevices != null)
{
properties.Add(DmiProperty.SystemSlots.PeerDevices, new DmiPeerDevicesCollection((PeerDevicesCollection)peerDevices));
}
}
#endregion
#region 3.4
if (SmbiosStructure.StructureInfo.StructureVersion >= SmbiosStructureVersion.v34)
{
object slotInformation = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.SlotInformation);
if (slotInformation != null)
{
properties.Add(DmiProperty.SystemSlots.SlotInformation, slotInformation);
}
object slotPhysicalWidth = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.SlotPhysicalWidth);
if (slotPhysicalWidth != null)
{
properties.Add(DmiProperty.SystemSlots.SlotPhysicalWidth, slotPhysicalWidth);
}
object slotPitch = SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemSlots.SlotPitch);
if (slotPitch != null)
{
properties.Add(DmiProperty.SystemSlots.SlotPitch, (ushort)((ushort)slotPitch / 100));
}
}
#endregion
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.ElectricalCurrentProbe/Tolerance.md
# DmiProperty.ElectricalCurrentProbe.Tolerance property
Gets a value representing the key to retrieve the property value.
Tolerance for reading from this probe, in plus/minus milliamps.
Key Composition
* Structure: ElectricalCurrentProbe
* Property: Tolerance
* Unit: mA
Return Value
Type: UInt16
```csharp
public static IPropertyKey Tolerance { get; }
```
## See Also
* class [ElectricalCurrentProbe](../DmiProperty.ElectricalCurrentProbe.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType020 [Memory Device Mapped Address].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 020: Memory Device Mapped Address.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.1+ Type BYTE 20 Memory Device Mapped Address indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.1+ Length BYTE 13h Length of the structure. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 2.1+ Handle WORD Varies The handle, or instance number, associated|
// | with the structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 2.1+ Starting DWORD Varies The physical address, in kilobytes, of a |
// | Address range of memory mapped to the specified |
// | Physical Memory Array. |
// | When the field value is FFFF FFFFh, the |
// | actual address is stored in the Extended |
// | Starting Address field. |
// | When this field contains a valid address, |
// | Ending Address must also contain a valid |
// | address. |
// | When this field contains FFFF FFFFh, |
// | Ending Address must also contain |
// | FFFF FFFFh. |
// | Note: See StartingAddress |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h 2.1+ Ending DWORD Varies The physical ending address of the last |
// | Address kilobyte of a range of addresses mapped |
// | to the specified Physical Memory Array. |
// | When the field value is FFFF FFFFh and |
// | the Starting Address field also contains |
// | FFFF FFFFh, the actual address is stored |
// | in the Extended Ending Address field. |
// | When this field contains a valid address, |
// | Starting Address must also contain a |
// | valid address. |
// | Note: See EndingAddress |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ch 2.1+ Memory Device WORD Varies The handle, or instance number, associated|
// | Handle with the Memory device structure to which |
// | this address range is mapped. |
// | Multiple address ranges can be mapped to |
// | a single Memory Device. |
// | Note: See DeviceHandle |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Eh 2.1+ Memory Array WORD Varies The handle, or instance number, associated|
// | Mapped with the Memory Array Mapped Address |
// | Address Handle structure to which this device address |
// | range is mapped. |
// | Multiple address ranges can be mapped to a|
// | single Memory Array Mapped Address. |
// | Note: See MappedAddressHandle |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 10h 2.1+ Partition Row BYTE Varies Identifies the position of the referenced |
// | Position Memory Device in a row of the address. |
// | partition. |
// | For example, if two 8-bit devices form a |
// | 16-bit row, this field’s value is either |
// | 1 or 2. |
// | The value 0 is reserved. If the position |
// | is unknown, the field contains FFh. |
// | Note: See PartitionRowPosition |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 11h 2.1+ Interleave BYTE Varies The position of the referenced Memory |
// | Position Device in an interleave. |
// | The value 0 indicates noninterleaved, 1 |
// | indicates first interleave position, 2 |
// | the second interleave position, and so on.|
// | If the position is unknown, the field |
// | contains FFh. |
// | EXAMPLES: In a 2:1 interleave, the value 1|
// | indicates the device in the |
// | ”even” position. In a 4:1 |
// | interleave, the value 1 |
// | indicates the first of four |
// | possible positions. |
// | Note: See InterleavePosition |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 12h 2.1+ Interleave BYTE Varies The maximum number of consecutive rows |
// | Data Depth from the referenced Memory Device that are|
// | accessed in a single interleaved transfer.|
// | If the device is not part of an |
// | interleave, the field contains 0; if the |
// | interleave configuration is unknown, the |
// | value is FFh. |
// | EXAMPLES: If a device transfers two rows |
// | each time it is read, its |
// | Interleaved Data Depth is set to|
// | 2. If that device is 2:1 |
// | interleaved and in Interleave |
// | Position 1, the rows mapped to |
// | that device are 1, 2, 5, 6, 9, |
// | 10, etc. |
// | Note: See InterleaveDataDepth |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 13h 2.7+ Extended QWORD Varies The physical address, in bytes, of a range|
// | Starting of memory mapped to the referenced Memory |
// | Address Device. |
// | This field is valid when Starting Address |
// | contains the value FFFF FFFFh. |
// | If Starting Address contains a value other|
// | than FFFF FFFFh, this field contains zeros|
// | When this field contains a valid address, |
// | Extended Ending Address must also contain |
// | a valid address. |
// | Note: See ExtendedStartingAddress |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 1Bh 2.7+ Extended QWORD Varies The physical ending address, in bytes, of |
// | Ending the last of a range of addresses mapped to|
// | Address the referenced Memory Device. |
// | This field is valid when both Starting |
// | Address and Ending Address contain the |
// | value FFFF FFFFh. |
// | If Ending Address contains a value other |
// | than FFFF FFFFh, this field contains zeros|
// | When this field contains a valid address, |
// | Extended Starting Address must also |
// | contain a valid address. |
// | Note: See ExtendedEndingAddress |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Memory Device Mapped Address (Type 20) structure.
/// </summary>
internal sealed class SmbiosType020 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType020"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType020(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
#region Version 2.1+ fields
/// <summary>
/// Gets a value representing the <b>Starting Address</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint StartingAddress => (uint)Reader.GetDoubleWord(0x04);
/// <summary>
/// Gets a value representing the <b>Ending Address</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint EndingAddress => (uint)Reader.GetDoubleWord(0x08);
/// <summary>
/// Gets a value representing the <b>Memory Device Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort MemoryDeviceHandle => (ushort)Reader.GetWord(0x0C);
/// <summary>
/// Gets a value representing the <b>Mapped Address Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort MappedAddressHandle => (ushort)Reader.GetWord(0x0e);
/// <summary>
/// Gets a value representing the <b>Partition Row Position</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte PartitionRowPosition => Reader.GetByte(0x10);
/// <summary>
/// Gets a value representing the <b>Interleave Position</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private MemoryDeviceMappedAddressInterleavedPosition InterleavePosition => (MemoryDeviceMappedAddressInterleavedPosition)Reader.GetByte(0x11);
/// <summary>
/// Gets a value representing the <b>Interleaved Data Depth</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte InterleavedDataDepth => Reader.GetByte(0x12);
#endregion
#region Version 2.7+ fields
/// <summary>
/// Gets a value representing the <b>Extended Starting Address</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ulong ExtendedStartingAddress => (ulong)Reader.GetQuadrupleWord(0x13);
/// <summary>
/// Gets a value representing the <b>Extended Ending Address</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ulong ExtendedEndingAddress => (ulong)Reader.GetQuadrupleWord(0x1b);
#endregion
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
#region 2.1+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v21)
{
properties.Add(SmbiosProperty.MemoryDeviceMappedAddress.StartingAddress, StartingAddress);
properties.Add(SmbiosProperty.MemoryDeviceMappedAddress.EndingAddress, EndingAddress);
properties.Add(SmbiosProperty.MemoryDeviceMappedAddress.MemoryDeviceHandle, MemoryDeviceHandle);
properties.Add(SmbiosProperty.MemoryDeviceMappedAddress.MemoryArrayMappedAddressHandle, MappedAddressHandle);
properties.Add(SmbiosProperty.MemoryDeviceMappedAddress.PartitionRowPosition, PartitionRowPosition);
properties.Add(SmbiosProperty.MemoryDeviceMappedAddress.InterleavePosition, InterleavePosition);
properties.Add(SmbiosProperty.MemoryDeviceMappedAddress.InterleavedDataDepth, InterleavedDataDepth);
}
#endregion
#region 2.7+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v27)
{
properties.Add(SmbiosProperty.MemoryDeviceMappedAddress.ExtendedStartingAddress, ExtendedStartingAddress);
properties.Add(SmbiosProperty.MemoryDeviceMappedAddress.ExtendedEndingAddress, ExtendedEndingAddress);
}
#endregion
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemPowerControls/Hour.md
# DmiProperty.SystemPowerControls.Hour property
Gets a value representing the key to retrieve the property value.
BCD value of the hour on which the next scheduled poweron is to occur, in the range 00h to 23h.
Key Composition
* Structure: SystemPowerControls
* Property: Hour
* Unit: None
Return Value
Type: Byte
```csharp
public static IPropertyKey Hour { get; }
```
## See Also
* class [SystemPowerControls](../DmiProperty.SystemPowerControls.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Bios/BiosStartSegment.md
# DmiProperty.Bios.BiosStartSegment property
Gets a value representing the key to retrieve the property value.
Segment location of BIOS starting address. This value is a free-form string that may contain core and OEM version information. The size of the runtime BIOS image can be computed by subtracting the Starting Address Segment from 10000h and multiplying the result by 16.
Key Composition
* Structure: Bios
* Property: BiosStartSegment
* Unit: None
Return Value
Type: String
Remarks
2.0+
```csharp
public static IPropertyKey BiosStartSegment { get; }
```
## See Also
* class [Bios](../DmiProperty.Bios.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PortableBattery.md
# DmiProperty.PortableBattery class
Contains the key definitions available for a type 022 [PortableBattery] structure.
```csharp
public static class PortableBattery
```
## Public Members
| name | description |
| --- | --- |
| static [DesignCapacity](DmiProperty.PortableBattery/DesignCapacity.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [DesignCapacityMultiplier](DmiProperty.PortableBattery/DesignCapacityMultiplier.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [DesignVoltage](DmiProperty.PortableBattery/DesignVoltage.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [DeviceChemistry](DmiProperty.PortableBattery/DeviceChemistry.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [DeviceName](DmiProperty.PortableBattery/DeviceName.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Location](DmiProperty.PortableBattery/Location.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ManufactureDate](DmiProperty.PortableBattery/ManufactureDate.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Manufacturer](DmiProperty.PortableBattery/Manufacturer.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MaximunErrorInBatteryData](DmiProperty.PortableBattery/MaximunErrorInBatteryData.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [OemSpecific](DmiProperty.PortableBattery/OemSpecific.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SBDSVersionNumber](DmiProperty.PortableBattery/SBDSVersionNumber.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SerialNumber](DmiProperty.PortableBattery/SerialNumber.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType126 [Inactive].cs
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 126: Inactive.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 126 Inactive structure indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE Varies Length of the structure, a minimum of 0Bh |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies The handle, or instance number, associated with the |
// | structure. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Inactive (Type 126) structure.
/// </summary>
internal class SmbiosType126 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType126"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType126(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
properties.Add(SmbiosProperty.Inactive.Description, "Inactive");
}
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Specific/ChassisContainedElementCollection.cs
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
namespace iTin.Hardware.Specification.Smbios;
/// <summary>
/// Represents a collection of objects <see cref="ChassisContainedElement"/>.
/// </summary>
public sealed class ChassisContainedElementCollection : ReadOnlyCollection<ChassisContainedElement>
{
#region constructor/s
/// <summary>
/// Initialize a new instance of the class <see cref="ChassisContainedElementCollection"/>.
/// </summary>
/// <param name="elements">Item list.</param>
internal ChassisContainedElementCollection(IEnumerable<ChassisContainedElement> elements) : base(elements.ToList())
{
}
#endregion
#region public override methods
/// <summary>
/// Returns a class <see cref="string"/> that represents the current object.
/// </summary>
/// <returns>
/// Object <see cref="string"/> that represents the current <see cref="ChassisContainedElementCollection"/> class.
/// </returns>
/// <remarks>
/// This method returns a string that includes the number of available elements.
/// </remarks>
public override string ToString() => $"Elements = {Items.Count}";
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/SmbiosStructureFactory.cs
using System.Collections.Generic;
namespace iTin.Hardware.Specification.Smbios;
/// <summary>
/// The static class <see cref="SmbiosStructureFactory"/> creates the <see cref="SMBIOS"/> structures.
/// </summary>
internal static class SmbiosStructureFactory
{
/// <summary>
/// Create list of available structures.
/// </summary>
/// <param name="structureInfo">Structure information.</param>
/// <returns>
/// An enumerator, which supports a simple iteration in the collection of structures.
/// </returns>
public static IEnumerable<SmbiosBaseType> Create(SmbiosStructureInfo structureInfo)
{
var rawTables = structureInfo.Context.GetAllRawTablesFrom(structureInfo.StructureType);
if (rawTables == null)
{
return null;
}
var parseProperties = new List<SmbiosBaseType>();
foreach (var rawTable in rawTables)
{
var smbiosStructureHeaderInfo = new SmbiosStructureHeaderInfo(rawTable);
switch (structureInfo.StructureType)
{
case SmbiosStructure.Bios:
parseProperties.Add(new SmbiosType000(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.System:
parseProperties.Add(new SmbiosType001(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.BaseBoard:
parseProperties.Add(new SmbiosType002(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.SystemEnclosure:
parseProperties.Add(new SmbiosType003(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.Processor:
parseProperties.Add(new SmbiosType004(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.MemoryController:
parseProperties.Add(new SmbiosType005(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.MemoryModule:
parseProperties.Add(new SmbiosType006(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.Cache:
parseProperties.Add(new SmbiosType007(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.PortConnector:
parseProperties.Add(new SmbiosType008(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.SystemSlots:
parseProperties.Add(new SmbiosType009(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.OnBoardDevices:
parseProperties.Add(new SmbiosType010(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.OemStrings:
parseProperties.Add(new SmbiosType011(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.SystemConfigurationOptions:
parseProperties.Add(new SmbiosType012(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.BiosLanguage:
parseProperties.Add(new SmbiosType013(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.GroupAssociations:
parseProperties.Add(new SmbiosType014(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.SystemEventLog:
parseProperties.Add(new SmbiosType015(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.PhysicalMemoryArray:
parseProperties.Add(new SmbiosType016(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.MemoryDevice:
parseProperties.Add(new SmbiosType017(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.BitMemoryError32:
parseProperties.Add(new SmbiosType018(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.MemoryArrayMappedAddress:
parseProperties.Add(new SmbiosType019(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.MemoryDeviceMappedAddress:
parseProperties.Add(new SmbiosType020(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.BuiltInPointingDevice:
parseProperties.Add(new SmbiosType021(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.PortableBattery:
parseProperties.Add(new SmbiosType022(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.SystemReset:
parseProperties.Add(new SmbiosType023(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.HardwareSecurity:
parseProperties.Add(new SmbiosType024(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.SystemPowerControls:
parseProperties.Add(new SmbiosType025(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.VoltageProbe:
parseProperties.Add(new SmbiosType026(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.CoolingDevice:
parseProperties.Add(new SmbiosType027(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.TemperatureProbe:
parseProperties.Add(new SmbiosType028(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.ElectricalCurrentProbe:
parseProperties.Add(new SmbiosType029(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.OutOfBandRemote:
parseProperties.Add(new SmbiosType030(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.BootIntegrityServicesEntryPoint:
parseProperties.Add(new SmbiosType031(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.SystemBoot:
parseProperties.Add(new SmbiosType032(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.BitMemoryError64:
parseProperties.Add(new SmbiosType033(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.ManagementDevice:
parseProperties.Add(new SmbiosType034(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.ManagementDeviceComponent:
parseProperties.Add(new SmbiosType035(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.ManagementDeviceThresholdData:
parseProperties.Add(new SmbiosType036(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.MemoryChannel:
parseProperties.Add(new SmbiosType037(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.IpmiDevice:
parseProperties.Add(new SmbiosType038(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.SystemPowerSupply:
parseProperties.Add(new SmbiosType039(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.AdditionalInformation:
parseProperties.Add(new SmbiosType040(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.OnBoardDevicesExtended:
parseProperties.Add(new SmbiosType041(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.ManagementControllerHostInterface:
parseProperties.Add(new SmbiosType042(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.TpmDevice:
parseProperties.Add(new SmbiosType043(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.ProcessorAdditionalInformation:
parseProperties.Add(new SmbiosType044(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.Inactive:
parseProperties.Add(new SmbiosType126(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
case SmbiosStructure.EndOfTable:
parseProperties.Add(new SmbiosType127(smbiosStructureHeaderInfo, structureInfo.SmbiosVersion));
break;
}
}
return parseProperties;
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiClassCollection.md
# DmiClassCollection class
Representa una colección de objetos [`DmiClass`](./DmiClass.md).
```csharp
public sealed class DmiClassCollection : ReadOnlyCollection<DmiClass>
```
## See Also
* class [DmiClass](./DmiClass.md)
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType001 [System Information].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the System Information (Type 1) structure.<br/>
/// For more information, please see <see cref="SmbiosType001"/>.
/// </summary>
internal sealed class DmiType001 : DmiBaseType<SmbiosType001>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType001"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType001(SmbiosType001 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
#region 2.0+
if (ImplementedVersion >= DmiStructureVersion.v20)
{
object manufacturer = SmbiosStructure.GetPropertyValue(SmbiosProperty.System.Manufacturer);
if (manufacturer != null)
{
properties.Add(DmiProperty.System.Manufacturer, manufacturer);
}
object productName = SmbiosStructure.GetPropertyValue(SmbiosProperty.System.ProductName);
if (productName != null)
{
properties.Add(DmiProperty.System.ProductName, productName);
}
object version = SmbiosStructure.GetPropertyValue(SmbiosProperty.System.Version);
if (version != null)
{
properties.Add(DmiProperty.System.Version, version);
}
object serialNumber = SmbiosStructure.GetPropertyValue(SmbiosProperty.System.SerialNumber);
if (serialNumber != null)
{
properties.Add(DmiProperty.System.SerialNumber, serialNumber);
}
}
#endregion
#region 2.1+
if (ImplementedVersion >= DmiStructureVersion.v21)
{
object wakeUpType = SmbiosStructure.GetPropertyValue(SmbiosProperty.System.WakeUpType);
if (wakeUpType != null)
{
properties.Add(DmiProperty.System.WakeUpType, wakeUpType);
}
object uuid = SmbiosStructure.GetPropertyValue(SmbiosProperty.System.UUID);
if (uuid != null)
{
properties.Add(DmiProperty.System.UUID, uuid);
}
}
#endregion
#region 2.4+
if (ImplementedVersion >= DmiStructureVersion.v24)
{
object skuNumber = SmbiosStructure.GetPropertyValue(SmbiosProperty.System.SkuNumber);
if (skuNumber != null)
{
properties.Add(DmiProperty.System.SkuNumber, skuNumber);
}
object family = SmbiosStructure.GetPropertyValue(SmbiosProperty.System.Family);
if (family != null)
{
properties.Add(DmiProperty.System.Family, family);
}
}
#endregion
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor/CoreCount.md
# DmiProperty.Processor.CoreCount property
Gets a value representing the key to retrieve the property value.
Number of cores per processor socket. If the value is unknown, the field is set to 0. Core Count is the number of cores detected by the BIOS for this processor socket. It does not necessarily indicate the full capability of the processor.
Key Composition
* Structure: Processor
* Property: CoreCount
* Unit: None
Return Value
Type: Byte
Remarks
2.5+
```csharp
public static IPropertyKey CoreCount { get; }
```
## See Also
* class [Processor](../DmiProperty.Processor.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Core/iTin.Core.Hardware/iTin.Core.Hardware.Linux.Specification.Smbios/SmbiosOperations.cs
using System;
using iTin.Core.Hardware.Abstractions.Specification.Smbios;
namespace iTin.Core.Hardware.Linux.Specification.Smbios;
/// <summary>
/// Specialization of the <see cref="ISmbiosOperations"/> interface that contains the <b>SMBIOS</b> operations for <b>Linux</b> system.
/// </summary>
public class SmbiosOperations : ISmbiosOperations
{
/// <summary>
/// Gets a value containing the raw <b>SMBIOS</b> data.
/// </summary>
/// <param name="options">Connection options for remote use</param>
/// <returns>
/// The raw <b>SMBIOS</b> data.
/// </returns>
public byte[] GetSmbiosDataArray(ISmbiosConnectOptions options = null) => Array.Empty<byte>();
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PortableBattery/MaximunErrorInBatteryData.md
# DmiProperty.PortableBattery.MaximunErrorInBatteryData property
Gets a value representing the key to retrieve the property value.
Maximum error (as a percentage in the range 0 to 100) in the Watt-hour data reported by the battery, indicating an upper bound on how much additional energy the battery might have above the energy it reports having.
Key Composition
* Structure: PortableBattery
* Property: MaximunErrorInBatteryData
* Unit: None
Return Value
Type: Byte
Remarks
2.1+
```csharp
public static IPropertyKey MaximunErrorInBatteryData { get; }
```
## See Also
* class [PortableBattery](../DmiProperty.PortableBattery.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PhysicalMemoryArray/Use.md
# DmiProperty.PhysicalMemoryArray.Use property
Gets a value representing the key to retrieve the property value.
Function for which the array is used.
Key Composition
* Structure: PhysicalMemoryArray
* Property: Use
* Unit: None
Return Value
Type: String
Remarks
2.1+
```csharp
public static IPropertyKey Use { get; }
```
## See Also
* class [PhysicalMemoryArray](../DmiProperty.PhysicalMemoryArray.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiBaseType-1/GetUnderlyingSmbiosStructure.md
# DmiBaseType<TSmbios>.GetUnderlyingSmbiosStructure method
Returns a reference to the underlying smbios structure for this dmi type.
```csharp
public TSmbios GetUnderlyingSmbiosStructure()
```
## Return Value
Reference to the object that represents the strongly typed value of the property. Always returns the first appearance of the property.
## See Also
* class [DmiBaseType<TSmbios>](../DmiBaseType-1.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.ManagementDeviceComponent/ThresholdHandle.md
# DmiProperty.ManagementDeviceComponent.ThresholdHandle property
Gets a value representing the key to retrieve the property value.
Handle, or instance number, associated with the device thresholds.
Key Composition
* Structure: ManagementDevice
* Property: ThresholdHandle
* Unit: None
Return Value
Type: UInt16
```csharp
public static IPropertyKey ThresholdHandle { get; }
```
## See Also
* class [ManagementDeviceComponent](../DmiProperty.ManagementDeviceComponent.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Abstractions.Specification.Smbios/SmbiosOperations.cs
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using iTin.Core.Hardware.Abstractions.Specification.Smbios;
using Linux = iTin.Core.Hardware.Linux.Specification.Smbios;
using MacOS = iTin.Core.Hardware.MacOS.Specification.Smbios;
using Windows = iTin.Core.Hardware.Windows.Specification.Smbios;
namespace iTin.Hardware.Abstractions.Specification.Smbios;
/// <summary>
/// Define
/// </summary>
public class SmbiosOperations
{
#region private readonly members
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly ISmbiosOperations _operations;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly Dictionary<OSPlatform, ISmbiosOperations> _operationsTable =
new()
{
{ OSPlatform.Windows, new Windows.SmbiosOperations() },
{ OSPlatform.Linux, new Linux.SmbiosOperations() },
{ OSPlatform.OSX, new MacOS.SmbiosOperations() }
};
#endregion
#region constructor/s
/// <summary>
/// Prevents a default instance of the <see cref="SmbiosOperations"/> class from being created.
/// </summary>
private SmbiosOperations()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
_operations = _operationsTable[OSPlatform.Windows];
}
else
{
_operations = RuntimeInformation.IsOSPlatform(OSPlatform.OSX)
? _operationsTable[OSPlatform.OSX]
: _operationsTable[OSPlatform.Linux];
}
}
#endregion
#region public static readonly properties
/// <summary>
/// Gets an unique instance of this class.
/// </summary>
/// <value>
/// A <see cref="SmbiosOperations"/> reference that contains <b>SMBIOS</b> operations.
/// </value>
public static SmbiosOperations Instance { get; } = new();
#endregion
#region public methods
/// <summary>
/// Gets a value containing the raw <b>SMBIOS</b> data.
/// </summary>
/// <param name="options">Connection options for remote use</param>
/// <returns>
/// The raw <b>SMBIOS</b> data.
/// </returns>
public byte[] GetSmbiosDataArray(ISmbiosConnectOptions options = null) => _operations.GetSmbiosDataArray(options);
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.OnBoardDevicesExtended.Element/DeviceType.md
# DmiProperty.OnBoardDevicesExtended.Element.DeviceType property
Gets a value representing the key to retrieve the property value.
Device type.
Key Composition
* Structure: OnBoardDevicesExtended
* Property: DeviceType
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey DeviceType { get; }
```
## See Also
* class [Element](../DmiProperty.OnBoardDevicesExtended.Element.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiStructure/Class.md
# DmiStructure.Class property
Gets a value that represents the class implemented.
```csharp
public DmiStructureClass Class { get; }
```
## Property Value
One of the values of the enumeration [`DmiStructureClass`](../DmiStructureClass.md) that represents the implemented class.
## See Also
* enum [DmiStructureClass](../DmiStructureClass.md)
* class [DmiStructure](../DmiStructure.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/ChassisContainedElementType.md
# ChassisContainedElementType enumeration
Defines the DMI structures associated with the chassis.
```csharp
public enum ChassisContainedElementType
```
## Values
| name | value | description |
| --- | --- | --- |
| BaseBoardEnumeration | `0` | SystemEnclosure structure |
| SmbiosStructure | `1` | SMBIOS structure |
## See Also
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemPowerSupply.Characteristics.md
# DmiProperty.SystemPowerSupply.Characteristics class
Contains the key definition for the Characteristics section.
```csharp
public static class Characteristics
```
## Public Members
| name | description |
| --- | --- |
| static [InputVoltageRange](DmiProperty.SystemPowerSupply.Characteristics/InputVoltageRange.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [IsHotReplaceable](DmiProperty.SystemPowerSupply.Characteristics/IsHotReplaceable.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [IsPlugged](DmiProperty.SystemPowerSupply.Characteristics/IsPlugged.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [IsPresent](DmiProperty.SystemPowerSupply.Characteristics/IsPresent.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Status](DmiProperty.SystemPowerSupply.Characteristics/Status.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SupplyType](DmiProperty.SystemPowerSupply.Characteristics/SupplyType.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [SystemPowerSupply](./DmiProperty.SystemPowerSupply.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.md
# iTin.Hardware.Specification.Dmi assembly
## iTin.Hardware.Specification namespace
| public type | description |
| --- | --- |
| class [DMI](./iTin.Hardware.Specification/DMI.md) | The Desktop Management Interface (DMI) or the desktop management interface, standard framework for management and component tracking on a desktop, laptop or server. |
## iTin.Hardware.Specification.Dmi namespace
| public type | description |
| --- | --- |
| class [BaseBoardContainedElementCollection](./iTin.Hardware.Specification.Dmi/BaseBoardContainedElementCollection.md) | Represents a collection of objects SmbiosStructure available on a motherboard. |
| enum [ChassisContainedElementType](./iTin.Hardware.Specification.Dmi/ChassisContainedElementType.md) | Defines the DMI structures associated with the chassis. |
| class [DmiAdditionalInformationEntry](./iTin.Hardware.Specification.Dmi/DmiAdditionalInformationEntry.md) | This class represents an element of the structure DmiType040. |
| class [DmiAdditionalInformationEntryCollection](./iTin.Hardware.Specification.Dmi/DmiAdditionalInformationEntryCollection.md) | Represents a collection of objects [`DmiAdditionalInformationEntry`](./iTin.Hardware.Specification.Dmi/DmiAdditionalInformationEntry.md). |
| abstract class [DmiBaseType<TSmbios>](./iTin.Hardware.Specification.Dmi/DmiBaseType-1.md) | The DmiBaseType class provides functions to analyze the properties associated with a structure [`DMI`](./iTin.Hardware.Specification/DMI.md). |
| class [DmiChassisContainedElement](./iTin.Hardware.Specification.Dmi/DmiChassisContainedElement.md) | This class represents an element of the structure DmiType003. |
| class [DmiChassisContainedElementCollection](./iTin.Hardware.Specification.Dmi/DmiChassisContainedElementCollection.md) | Represents a collection of objects ChassisContainedElement. |
| class [DmiClass](./iTin.Hardware.Specification.Dmi/DmiClass.md) | Represents a DMI class. |
| class [DmiClassCollection](./iTin.Hardware.Specification.Dmi/DmiClassCollection.md) | Representa una colección de objetos [`DmiClass`](./iTin.Hardware.Specification.Dmi/DmiClass.md). |
| class [DmiClassPropertiesTable](./iTin.Hardware.Specification.Dmi/DmiClassPropertiesTable.md) | Specialization of the BasePropertiesTable class that stores the available properties for each data table. |
| class [DmiConnectOptions](./iTin.Hardware.Specification.Dmi/DmiConnectOptions.md) | Defines remote user parameters |
| class [DmiGroupAssociationElement](./iTin.Hardware.Specification.Dmi/DmiGroupAssociationElement.md) | This class represents an element of the structure DmiType014. |
| class [DmiGroupAssociationElementCollection](./iTin.Hardware.Specification.Dmi/DmiGroupAssociationElementCollection.md) | Represents a collection of [`DmiGroupAssociationElement`](./iTin.Hardware.Specification.Dmi/DmiGroupAssociationElement.md). |
| class [DmiManagementControllerHostInterfaceProtocolRecord](./iTin.Hardware.Specification.Dmi/DmiManagementControllerHostInterfaceProtocolRecord.md) | This class represents an element of the structure DmiType042. |
| class [DmiManagementControllerHostInterfaceProtocolRecordsCollection](./iTin.Hardware.Specification.Dmi/DmiManagementControllerHostInterfaceProtocolRecordsCollection.md) | Represents a collection of objects [`DmiManagementControllerHostInterfaceProtocolRecordsCollection`](./iTin.Hardware.Specification.Dmi/DmiManagementControllerHostInterfaceProtocolRecordsCollection.md). |
| class [DmiMemoryChannelElement](./iTin.Hardware.Specification.Dmi/DmiMemoryChannelElement.md) | This class represents an element of the structure DmiType037. |
| class [DmiMemoryChannelElementCollection](./iTin.Hardware.Specification.Dmi/DmiMemoryChannelElementCollection.md) | Represents a collection of objects MemoryChannelElement. |
| class [DmiMemoryControllerContainedElementCollection](./iTin.Hardware.Specification.Dmi/DmiMemoryControllerContainedElementCollection.md) | Represents a collection of memory device identifiers. |
| class [DmiPeerDevice](./iTin.Hardware.Specification.Dmi/DmiPeerDevice.md) | This class represents an element of the structure DmiType009. |
| class [DmiPeerDevicesCollection](./iTin.Hardware.Specification.Dmi/DmiPeerDevicesCollection.md) | Represents a collection of objects [`DmiPeerDevice`](./iTin.Hardware.Specification.Dmi/DmiPeerDevice.md). |
| class [DmiStructure](./iTin.Hardware.Specification.Dmi/DmiStructure.md) | Represents a structure [`DMI`](./iTin.Hardware.Specification/DMI.md). |
| enum [DmiStructureClass](./iTin.Hardware.Specification.Dmi/DmiStructureClass.md) | Known [`DMI`](./iTin.Hardware.Specification/DMI.md) structures. |
| class [DmiStructureCollection](./iTin.Hardware.Specification.Dmi/DmiStructureCollection.md) | Represents a collection of [`DmiStructure`](./iTin.Hardware.Specification.Dmi/DmiStructure.md) objects implemented in [`DMI`](./iTin.Hardware.Specification/DMI.md). |
| enum [DmiStructureVersion](./iTin.Hardware.Specification.Dmi/DmiStructureVersion.md) | Defines known implemented version of a DMI structure. |
| class [DmiSupportedEventLogTypeDescriptorElement](./iTin.Hardware.Specification.Dmi/DmiSupportedEventLogTypeDescriptorElement.md) | This class represents an element of the structure. |
| class [DmiSupportedEventLogTypeDescriptorsCollection](./iTin.Hardware.Specification.Dmi/DmiSupportedEventLogTypeDescriptorsCollection.md) | Represents a collection of objects [`DmiSupportedEventLogTypeDescriptorElement`](./iTin.Hardware.Specification.Dmi/DmiSupportedEventLogTypeDescriptorElement.md). |
| interface [IDmiType](./iTin.Hardware.Specification.Dmi/IDmiType.md) | The DmiBaseType class provides functions to analyze the properties associated with a structure [`DMI`](./iTin.Hardware.Specification/DMI.md). |
| enum [MemoryDeviceMappedAddressInterleavedPosition](./iTin.Hardware.Specification.Dmi/MemoryDeviceMappedAddressInterleavedPosition.md) | Defines the type of interpolation of a device. |
| enum [MemorySizeUnit](./iTin.Hardware.Specification.Dmi/MemorySizeUnit.md) | Defines the unit of measurement of the memory. |
| static class [QueryPropertyCollectionResultExtensions](./iTin.Hardware.Specification.Dmi/QueryPropertyCollectionResultExtensions.md) | Static class than contains extension methods for types QueryPropertyCollectionResult. |
| abstract class [SpecificDmiBaseType](./iTin.Hardware.Specification.Dmi/SpecificDmiBaseType.md) | The SmbiosBaseType class provides functions to analyze the properties associated with a structure [`DMI`](./iTin.Hardware.Specification/DMI.md). |
## iTin.Hardware.Specification.Dmi.Property namespace
| public type | description |
| --- | --- |
| static class [DmiProperty](./iTin.Hardware.Specification.Dmi.Property/DmiProperty.md) | Defines available keys for the available devices of a system. |
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.FirmwareInventoryInformation/FirmwareVersionFormat.md
# DmiProperty.FirmwareInventoryInformation.FirmwareVersionFormat property
Gets a value representing the key to retrieve the property value.
Describes the format of the Firmware Version and the Lowest Supported Firmware Version.
Key Composition
* Structure: FirmwareInventoryInformation
* Property: FirmwareVersionFormat
* Unit: None
Return Value
Type: String
Remarks
3.5
```csharp
public static IPropertyKey FirmwareVersionFormat { get; }
```
## See Also
* class [FirmwareInventoryInformation](../DmiProperty.FirmwareInventoryInformation.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/RCDManufacturerId.md
# DmiProperty.MemoryDevice.RCDManufacturerId property
Gets a value representing the key to retrieve the property.
The RCD Manufacturer ID indicates the manufacturer of the RCD on memory device. This field shall be set to the value of the SPD Registering Clock Driver Manufacturer ID Code. A value of 0000h indicates the RCD Manufacturer ID is unknown
Key Composition
* Structure: MemoryDevice
* Property: RCDManufacturerId
* Unit: None
Return Value
Type: UInt16
Remarks
3.7+
```csharp
public static IPropertyKey RCDManufacturerId { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/Specific/DmiSupportedEventLogTypeDescriptorElement.cs
using iTin.Hardware.Specification.Smbios;
namespace iTin.Hardware.Specification.Dmi;
// •—————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Log Type BYTE ENUM Event Log types |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Variable Data Format Type BYTE ENUM Event Log Variable Data Format Type |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// This class represents an element of the structure.
/// </summary>
public class DmiSupportedEventLogTypeDescriptorElement
{
#region constructor/s
/// <summary>
/// Initialize a new instance of the class <see cref="DmiSupportedEventLogTypeDescriptorElement"/> specifying the structure information.
/// </summary>
/// <param name="reference">Untreated information of the current structure.</param>
internal DmiSupportedEventLogTypeDescriptorElement(SupportedEventLogTypeDescriptorElement reference)
{
DescriptorType = reference.DescriptorType;
DescriptorFormat = reference.DescriptorFormat;
}
#endregion
#region public properties
/// <summary>
/// Gets a value that represents the Descriptor Format.
/// </summary>
/// <value>
/// Descriptor Format.
/// </value>
public string DescriptorFormat { get; }
/// <summary>
/// Gets a value that represents the Descriptor Type.
/// </summary>
/// <value>
/// Descriptor Type.
/// </value>
public string DescriptorType { get; }
#endregion
#region public override methods
/// <summary>
/// Returns a class <see cref="string"/> that represents the current instance.
/// </summary>
/// <returns>
/// Object <see cref="string"/> that represents the current <see cref="AdditionalInformationEntry"/> class.
/// </returns>
public override string ToString() => $"Type = \"{DescriptorType}\"";
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType031 [Boot Integrity Services (BIS) Entry Point].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 031: Boot Integrity Services (BIS) Entry Point.
//
// Structure type 31 (decimal) is reserved for use by the Boot Integrity Services (BIS). Refer to the Boot
// Integrity Services API Specification for details.
// NOTE: This structure type was added in version 2.3 of this specification.
// •——————————————————————————————————————————————————————————————————————————————————————•
// | Especificacion extraida de: Boot Integrity Services API Specifications - página 21 |
// | |
// | typedef struct _BIS_ENTRY_POINT |
// | { |
// | UINT8 smBiosType; |
// | UINT8 length; |
// | UINT16 structHandle; |
// | UINT8 structChecksum; |
// | UINT8 reserved1; |
// | UINT16 reserved2; |
// | pBisEntry16 bisEntry16; /* pBisEntry16 definido como: typedef UINT32 pBisEntry16 |
// | pBisEntry32 bisEntry32; /* pBisEntry16 definido como: typedef UINT32 pBisEntry16 |
// | UINT64 reserved3; |
// | UINT32 reserved4; |
// | UINT16 doubleNull; |
// | } |
// | |
// | Quedaria: |
// | C/C++ C# Tamaño Posicion |
// | ------------------------------------------------------------------------ |
// | smBiosType UINT8 byte 1 00h |
// | length UINT8 byte 1 01h |
// | structHandle UINT16 ushort 2 02h |
// | structChecksum UINT8 byte 1 04h |
// | reserved1 UINT8 byte 1 05h |
// | reserved2 UINT16 ushort 2 06h |
// | bisEntry16 UINT32 uint 4 08h |
// | bisEntry32 UINT32 uint 4 0Ch |
// | reserved3 UINT64 ulong 8 14h |
// | reserved4 UINT32 uint 4 1Ch |
// | doubleNull UINT16 ushort 2 20h |
// •——————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Boot Integrity Services (BIS) Entry Point (Type 31) structure.
/// </summary>
internal sealed class SmbiosType031 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType031"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType031(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Checksum</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Checksum => Reader.GetByte(0x04);
/// <summary>
/// Gets a value representing the <b>Bis Entry Point Address 16</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string BisEntryPointAddress16 => $"{Reader.GetWord(0x08)}:{Reader.GetWord(0x0a)}";
/// <summary>
/// Gets a value representing the <b>Bis Entry Point Address 32</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string BisEntryPointAddress32 => $"{Reader.GetQuadrupleWord(0x0c)}";
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.Latest)
{
return;
}
properties.Add(SmbiosProperty.BootIntegrityServicesEntryPoint.Checksum, Checksum);
properties.Add(SmbiosProperty.BootIntegrityServicesEntryPoint.BisEntryPointAddress16, BisEntryPointAddress16);
properties.Add(SmbiosProperty.BootIntegrityServicesEntryPoint.BisEntryPointAddress32, BisEntryPointAddress32);
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Bios/Characteristics.md
# DmiProperty.Bios.Characteristics property
Gets a value representing the key to retrieve the property value.
Defines which functions the BIOS supports: PCI, PCMCIA, Flash, etc.
Key Composition
* Structure: Bios
* Property: Characteristics
* Unit: None
Return Value
Type: ReadOnlyCollection where T is String
Remarks
2.0+
```csharp
public static IPropertyKey Characteristics { get; }
```
## See Also
* class [Bios](../DmiProperty.Bios.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/SmbiosStructureHeaderInfo.cs
using iTin.Core.Helpers;
namespace iTin.Hardware.Specification.Smbios;
/// <summary>
/// Represents the <b>Header</b> structure contained in the initial four bytes of each <see cref="SMBIOS"/> structure.
/// </summary>
public class SmbiosStructureHeaderInfo
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosStructureHeaderInfo"/> class.
/// </summary>
/// <param name="rawData">The raw data.</param>
internal SmbiosStructureHeaderInfo(byte[] rawData)
{
StructureType = (SmbiosStructure)rawData[0x00];
Length = rawData[0x01];
Handle = LogicHelper.Word(rawData[0x02], rawData[0x03]);
RawData = rawData;
}
#endregion
#region public readonly properties
/// <summary>
/// Gets the length of the formatted area of the current <see cref="SMBIOS"/> structure.
/// </summary>
/// <value>
/// Length of the current <see cref="SMBIOS"/> structure.
/// </value>
/// <remarks>
/// Specifies the length of the formatted area of the current structure.
/// Starting at position 0, the length of the formatted zone of strings is not taken into account.
/// </remarks>
public int Length { get; }
/// <summary>
/// Gets the handle of the current structure.
/// </summary>
/// <value>
/// Handle of the current structure.
/// </value>
public int Handle { get; }
/// <summary>
/// Gets an array with the raw data.
/// </summary>
/// <value>
/// Array with raw data.
/// </value>
public byte[] RawData { get; }
/// <summary>
/// Gets the current <see cref="SMBIOS"/> structure type.
/// </summary>
/// <value>
/// One of the <see cref="SmbiosStructure"/> values representing the current struct
/// </value>
public SmbiosStructure StructureType { get; }
/// <summary>
/// Gets the implemented version of this <b>SMBIOS</b> structure.
/// </summary>
/// <value>
/// One of the values of the <see cref="SmbiosStructureVersion"/> enumeration that indicates the implemented version of this <b>SMBIOS</b> structure.
/// </value>
public SmbiosStructureVersion StructureVersion
{
get
{
var result = SmbiosStructureVersion.Unknown;
switch (StructureType)
{
#region Type000 [BIOS Information]
case SmbiosStructure.Bios:
{
if (Length >= 0x19)
{
result = SmbiosStructureVersion.v31;
}
else if (Length >= 0x13 && Length <= 0x18)
{
result = SmbiosStructureVersion.v24;
}
else if (Length <= 0x0b)
{
result = SmbiosStructureVersion.v20;
}
break;
}
#endregion
#region Type001 [System Information]
case SmbiosStructure.System:
{
if (Length >= 0x1a)
{
result = SmbiosStructureVersion.v24;
}
else if (Length >= 0x09 && Length <= 0x19)
{
result = SmbiosStructureVersion.v24;
}
else if (Length <= 0x08)
{
result = SmbiosStructureVersion.v20;
}
break;
}
#endregion
#region Type002 [Baseboard (or Module) Information]
case SmbiosStructure.BaseBoard:
{
if (Length >= 0x08)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type003 [System Enclosure or Chassis]
case SmbiosStructure.SystemEnclosure:
{
var n = 0;
var m = 0;
if (Length >= 0x14)
{
n = RawData[0x13];
}
if (Length >= 0x15)
{
m = RawData[0x14];
}
var nm = n * m;
if (nm != 0 && Length > 0x18)
{
result = SmbiosStructureVersion.v27;
}
else if (Length >= 0x0e && Length <= 0x17)
{
result = SmbiosStructureVersion.v23;
}
else if (Length >= 0x0a && Length <= 0x0d)
{
result = SmbiosStructureVersion.v21;
}
else if (Length <= 0x09)
{
result = SmbiosStructureVersion.v20;
}
break;
}
#endregion
#region Type004 [Processor Information]
case SmbiosStructure.Processor:
{
if (Length >= 0x31)
{
result = SmbiosStructureVersion.v36;
}
else if (Length >= 0x2b)
{
result = SmbiosStructureVersion.v30;
}
else if (Length >= 0x29 && Length <= 0x2b)
{
result = SmbiosStructureVersion.v26;
}
else if (Length >= 0x24 && Length <= 0x28)
{
result = SmbiosStructureVersion.v25;
}
else if (Length >= 0x22 && Length <= 0x23)
{
result = SmbiosStructureVersion.v23;
}
else if (Length >= 0x1b && Length <= 0x21)
{
result = SmbiosStructureVersion.v21;
}
else if (Length <= 0x1a)
{
result = SmbiosStructureVersion.v20;
}
break;
}
#endregion
#region Type005 [Memory Controller Information (Obsolete)]
case SmbiosStructure.MemoryController:
{
byte x = 0;
if (Length >= 0x0f)
{
x = RawData[0x0e];
}
if (Length >= 0x10 + 2 * x)
{
result = SmbiosStructureVersion.v21;
}
else
{
result = SmbiosStructureVersion.v20;
}
break;
}
#endregion
#region Type006 [Memory Module Information (Obsolete)]
case SmbiosStructure.MemoryModule:
{
if (Length <= 0x0c)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type007 [Cache Information]
case SmbiosStructure.Cache:
{
if (Length == 0x1b)
{
result = SmbiosStructureVersion.v31;
}
else if (Length == 0x13)
{
result = SmbiosStructureVersion.v21;
}
else if (Length <= 0x0f)
{
result = SmbiosStructureVersion.v20;
}
break;
}
#endregion
#region Type008 [Port Connector Information]
case SmbiosStructure.PortConnector:
{
if (Length == 0x09)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type009 [Slot Information]
case SmbiosStructure.SystemSlots:
{
if (Length > 0x12)
{
result = SmbiosStructureVersion.v32;
byte n = RawData[0x12];
byte groupsBytes = (byte)(5 * n);
if (Length > 0x18 + groupsBytes)
{
result = SmbiosStructureVersion.v35;
}
else if (Length > 0x14 + groupsBytes)
{
result = SmbiosStructureVersion.v34;
}
}
else if (Length == 0x11)
{
result = SmbiosStructureVersion.v26;
}
else if (Length == 0x0d)
{
result = SmbiosStructureVersion.v21;
}
else if (Length == 0x0c)
{
result = SmbiosStructureVersion.v20;
}
break;
}
#endregion
#region Type010 [On Board Devices (Obsolete)]
case SmbiosStructure.OnBoardDevices:
{
if (Length > 0x05)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type011 [OEM Strings]
case SmbiosStructure.OemStrings:
{
if (Length == 0x05)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type012 [System Configuration Options]
case SmbiosStructure.SystemConfigurationOptions:
{
if (Length == 0x05)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type013 [BIOS Language Information]
case SmbiosStructure.BiosLanguage:
{
if (Length == 0x16)
{
result = SmbiosStructureVersion.v20;
}
break;
}
#endregion
#region Type014 [Group Associations]
case SmbiosStructure.GroupAssociations:
{
if (Length >= 0x05)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type015 [System Event Log]
case SmbiosStructure.SystemEventLog:
{
if (Length > 0x15)
{
result = SmbiosStructureVersion.v21;
}
else if (Length == 0x11)
{
result = SmbiosStructureVersion.v20;
}
break;
}
#endregion
#region Type016 [Physical Memory Array]
case SmbiosStructure.PhysicalMemoryArray:
{
if (Length == 0x17)
{
result = SmbiosStructureVersion.v27;
}
else if (Length == 0x0f)
{
result = SmbiosStructureVersion.v21;
}
break;
}
#endregion
#region Type017 [Memory Device]
case SmbiosStructure.MemoryDevice:
{
if (Length > 0x58)
{
result = SmbiosStructureVersion.v37;
}
if (Length > 0x54 && Length <= 0x58)
{
result = SmbiosStructureVersion.v33;
}
if (Length > 0x28 && Length <= 0x54)
{
result = SmbiosStructureVersion.v32;
}
else if (Length > 0x22 && Length <= 0x28)
{
result = SmbiosStructureVersion.v28;
}
else if (Length > 0x1c && Length <= 0x22)
{
result = SmbiosStructureVersion.v27;
}
else if (Length > 0x1b && Length <= 0x1c)
{
result = SmbiosStructureVersion.v26;
}
else if (Length > 0x15 && Length <= 0x1b)
{
result = SmbiosStructureVersion.v23;
}
else if (Length <= 0x15)
{
result = SmbiosStructureVersion.v21;
}
break;
}
#endregion
#region Type018 [32-Bit Memory Error Information]
case SmbiosStructure.BitMemoryError32:
{
if (Length == 0x17)
{
result = SmbiosStructureVersion.v21;
}
break;
}
#endregion
#region Type019 [Memory Array Mapped Address]
case SmbiosStructure.MemoryArrayMappedAddress:
{
if (Length == 0x1f)
{
result = SmbiosStructureVersion.v27;
}
else if (Length == 0x0f)
{
result = SmbiosStructureVersion.v21;
}
break;
}
#endregion
#region Type020 [Memory Device Mapped Address]
case SmbiosStructure.MemoryDeviceMappedAddress:
{
if (Length == 0x23)
{
result = SmbiosStructureVersion.v27;
}
else if (Length == 0x13)
{
result = SmbiosStructureVersion.v21;
}
break;
}
#endregion
#region Type021 [Built-in Pointing Device]
case SmbiosStructure.BuiltInPointingDevice:
{
if (Length == 0x07)
{
result = SmbiosStructureVersion.v21;
}
break;
}
#endregion
#region Type022 [Portable Battery]
case SmbiosStructure.PortableBattery:
{
if (Length == 0x1a)
{
result = SmbiosStructureVersion.v22;
}
else if (Length == 0x11)
{
result = SmbiosStructureVersion.v21;
}
break;
}
#endregion
#region Type023 [System Reset]
case SmbiosStructure.SystemReset:
{
if (Length == 0x0d)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type024 [Hardware Security]
case SmbiosStructure.HardwareSecurity:
{
if (Length == 0x05)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type025 [System Power Controls]
case SmbiosStructure.SystemPowerControls:
{
if (Length == 0x09)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type026 [Voltage Probe]
case SmbiosStructure.VoltageProbe:
{
if (Length >= 0x14)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type027 [Cooling Device]
case SmbiosStructure.CoolingDevice:
{
if (Length == 0x0f)
{
result = SmbiosStructureVersion.v27;
}
else if (Length == 0x0d)
{
result = SmbiosStructureVersion.v22;
}
break;
}
#endregion
#region Type028 [Temperature Probe]
case SmbiosStructure.TemperatureProbe:
{
if (Length >= 0x14)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type029 [Electrical Current Probe]
case SmbiosStructure.ElectricalCurrentProbe:
{
if (Length >= 0x14)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type030 [Out-of-Band Remote Access]
case SmbiosStructure.OutOfBandRemote:
{
if (Length == 0x06)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type031 [Boot Integrity Services (BIS) Entry Point]
case SmbiosStructure.BootIntegrityServicesEntryPoint:
{
if (Length == 0x1e)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type032 [System Boot Information]
case SmbiosStructure.SystemBoot:
{
if (Length >= 0x0b)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type033 [64-Bit Memory Error Information]
case SmbiosStructure.BitMemoryError64:
{
if (Length == 0x1f)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type034 [Management Device]
case SmbiosStructure.ManagementDevice:
{
if (Length == 0x0b)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type035 [Management Device Component]
case SmbiosStructure.ManagementDeviceComponent:
{
if (Length == 0x0b)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type036 [Management Device Threshold Data]
case SmbiosStructure.ManagementDeviceThresholdData:
{
if (Length == 0x10)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type037 [Memory Channel]
case SmbiosStructure.MemoryChannel:
{
var n = 0;
if (Length >= 0x07)
{
n = RawData[0x06];
}
if (Length == 7 + 3 * n)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type038 [IPMI Device Information]
case SmbiosStructure.IpmiDevice:
{
if (Length >= 0x10)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type039 [System Power Supply]
case SmbiosStructure.SystemPowerSupply:
{
if (Length >= 0x10)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type040 [Additional Information]
case SmbiosStructure.AdditionalInformation:
{
if (Length >= 0x0b)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type041 [Onboard Devices Extended Information]
case SmbiosStructure.OnBoardDevicesExtended:
{
if (Length == 0x0b)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type042 [Management Controller Host Interface]
case SmbiosStructure.ManagementControllerHostInterface:
{
if (Length >= 0x0b)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type043 [TPM Device]
case SmbiosStructure.TpmDevice:
{
if (Length >= 0x1f)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type044 [Processor Additional Information]
case SmbiosStructure.ProcessorAdditionalInformation:
{
var y = 0;
if (Length >= 0x07)
{
y = RawData[0x06];
}
if (Length == 6 + y)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type045 [Firmware Inventory Information]
case SmbiosStructure.FirmwareInventoryInformation:
{
result = SmbiosStructureVersion.v35;
break;
}
#endregion
#region Type046 [String Property]
case SmbiosStructure.StringProperty:
{
if (Length >= 0x09)
{
result = SmbiosStructureVersion.v35;
}
break;
}
#endregion
#region Type126 [Inactive]
case SmbiosStructure.Inactive:
{
if (Length == 0x04)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
#region Type127 [End-Of-Table]
case SmbiosStructure.EndOfTable:
{
if (Length == 0x04)
{
result = SmbiosStructureVersion.Latest;
}
break;
}
#endregion
}
return result;
}
}
#endregion
#region public override methods
/// <summary>
/// Returns a <see cref="string"/> that represents this instance.
/// </summary>
/// <returns>A <see cref="string"/> that represents this instance.</returns>
/// <remarks>
/// The <see cref="ToString()"/> method returns a string that includes the <see cref="StructureType"/> property, <see cref="Handle"/> y <see cref="Length"/>.
/// </remarks>
public override string ToString() => $"Type = {StructureType}, Handle = {Handle:X2}h, Length = {Length:X2}h, Version = {StructureVersion}";
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType003 [System Enclosure or Chassis].cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using iTin.Core;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 003: System Enclosure or Chassis.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length deviceProperty Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.0+ Type BYTE 3 System Enclosure Indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.0+ Length BYTE Varies 09h for version 2.0 |
// | Minimum 0Dh for 2.1 version and 2.1 and later |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 2.0+ Handle WORD Varies |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 2.0+ Manufacturer BYTE STRING Number of null-terminated string |
// | |
// | Note: Please see, Manufacturer |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h 2.0+ Type BYTE Varies Bit 07 - Chassis lock. |
// | 0b - No presente o |
// | Desconocido. |
// | 1b - Presente. |
// | Note: See GetEnclosureLocked(byte) |
// | |
// | Bits 06:00 - Enumeración. |
// | Note: See GetEnclosureType(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h 2.0+ Version BYTE STRING Note: See Version |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h 2.0+ Serial Number BYTE STRING Note: See SerialNumber |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h 2.0+ Asset Tag BYTE STRING Número o cadena terminada en nulo. |
// | Number Note: See AssetTagNumber |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 09h 2.1+ Boot-up State BYTE ENUM Estado del chasis desde el último reinicio |
// | Note: See GetEnclosureState(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ah 2.1+ Power Supply BYTE ENUM Estado de la fuente de alimentación del |
// | State chasis desde el último reinicio. |
// | Note: See GetEnclosureState(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Bh 2.1+ Thermal State BYTE ENUM Estado térmico del chasis desde el último |
// | reinicio. |
// | Note: See GetEnclosureState(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ch 2.1+ Security Status BYTE ENUM Estado de la seguridad física del chasis |
// | desde el último reinicio. |
// | Note: See GetEnclosureSecurityStatus(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Dh 2.3+ OEM-defined DWORD Varies Información OEM (especifica del vendedor). |
// | Note: See OEemDefined |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 11h 2.3+ Height BYTE Varies Altura del chasis, en 'U'. |
// | 'U' es una unidad de medida estandard para |
// | indicar la altura de un rack o |
// | rack-mountable y es igual a 1.75 pulgadas |
// | o 4.445 cm. |
// | Un valor de 00h indica que la altura no |
// | se ha especificado. |
// | Note: See Height |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 12h 2.3+ Number of BYTE Varies Número de conectores de alimentación |
// | Power Cords asociados con este chasis. |
// | Un valor de 00h indica que no se ha |
// | especificado. |
// | Note: See NumberOfPowerCords |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 13h 2.3+ Contained BYTE Varies Número de 'Contained Elements (0 - 255). |
// | Element Cada grupo está comprimido en 'm' bytes, |
// | Count (n) dónde 'm' se especifica en el campo |
// | 'Contained Element Record Length'. |
// | Si no hay elementos el valor de este campo |
// | será 00h. |
// | Note: See ContainedElementCount |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 14h 2.3+ Contained BYTE Varies Longitud de cada registro de tipo |
// | Element 'Contained Element' (0 - 255). |
// | Record Si no hay registros este campo es 00h. |
// | Length (m) En versiones 2.3.2 y posteriores, el valor |
// | de este campo será al menos 03h. |
// | Note: See ContainedElementRecordLenght |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 15h 2.3+ Contained n * m Varies Elementos (estructuras SMBIOS) presentes |
// | Elements BYTEs en este chasis. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 15h + 2.7+ SKU Number BYTE STRING Cadena terminada en nulo que describe el |
// | n * m chasis o el número SKU. |
// | Note: See GetEnclosureSkuNumber(byte, byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the System Enclosure or Chassis (Type 3) structure.
/// </summary>
internal sealed class SmbiosType003 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType003"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType003(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private readonly properties
/// <summary>
/// Gets a value representing the <b>Asset Tag Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string AssetTagNumber => GetString(0x08);
/// <summary>
/// Gets a value representing the <b>Boot Up State</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte BootUpState => Reader.GetByte(0x09);
/// <summary>
/// Gets a value representing the <b>Contained Element Count</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ContainedElementCount => Reader.GetByte(0x13);
/// <summary>
/// Gets a value representing the <b>Contained Element Record Lenght</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ContainedElementRecordLenght => Reader.GetByte(0x14);
/// <summary>
/// Gets a value representing the <b>Enclosure Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte EnclosureType => Reader.GetByte(0x05);
/// <summary>
/// Gets a value representing the <b>Enclosure Locked</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte EnclosureLocked => Reader.GetByte(0x05);
/// <summary>
/// Gets a value representing the <b>Height</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Height => Reader.GetByte(0x11);
/// <summary>
/// Gets a value representing the <b>Manufacturer</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Manufacturer => GetString(0x04);
/// <summary>
/// Gets a value representing the <b>Number Of Power Cords</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte NumberOfPowerCords => Reader.GetByte(0x12);
/// <summary>
/// Gets a value representing the <b>OEM Defined</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint OemDefined => (uint)Reader.GetDoubleWord(0x0d);
/// <summary>
/// Gets a value representing the <b>Power Supply State</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte PowerSupplyState => Reader.GetByte(0x0a);
/// <summary>
/// Gets a value representing the <b>Security Status</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte SecurityStatus => Reader.GetByte(0x0c);
/// <summary>
/// Gets a value representing the <b>Serial Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string SerialNumber => GetString(0x07);
/// <summary>
/// Gets a value representing the <b>Version</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Version => GetString(0x06);
/// <summary>
/// Gets a value representing the <b>Thermal State</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ThermalState => Reader.GetByte(0x0b);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
#region 2.0+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v20)
{
properties.Add(SmbiosProperty.Chassis.Manufacturer, Manufacturer);
properties.Add(SmbiosProperty.Chassis.ChassisType, GetEnclosureType(EnclosureType));
properties.Add(SmbiosProperty.Chassis.Locked, GetEnclosureLocked(EnclosureLocked));
properties.Add(SmbiosProperty.Chassis.Version, Version);
properties.Add(SmbiosProperty.Chassis.SerialNumber, SerialNumber);
properties.Add(SmbiosProperty.Chassis.AssetTagNumber, AssetTagNumber);
}
#endregion
#region 2.1+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v21)
{
properties.Add(SmbiosProperty.Chassis.BootUpState, GetEnclosureState(BootUpState));
properties.Add(SmbiosProperty.Chassis.PowerSupplyState, GetEnclosureState(PowerSupplyState));
properties.Add(SmbiosProperty.Chassis.ThermalState, GetEnclosureState(ThermalState));
properties.Add(SmbiosProperty.Chassis.SecurityStatus, GetEnclosureSecurityStatus(SecurityStatus));
}
#endregion
#region 2.3+, 2.7+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v23)
{
properties.Add(SmbiosProperty.Chassis.OemDefined, OemDefined);
properties.Add(SmbiosProperty.Chassis.Height, Height);
properties.Add(SmbiosProperty.Chassis.NumberOfPowerCords, NumberOfPowerCords);
byte n = ContainedElementCount;
if (n != 0)
{
if (StructureInfo.Length >= 0x15)
{
byte m = ContainedElementRecordLenght;
if (m != 0)
{
if (StructureInfo.Length >= 0x16)
{
byte[] containedElementsArray = StructureInfo.RawData.Extract(0x15, n * m).ToArray();
IEnumerable<ChassisContainedElement> containedElements = GetContainedElements(containedElementsArray, n);
properties.Add(SmbiosProperty.Chassis.ContainedElements, new ChassisContainedElementCollection(containedElements));
}
#region 2.7+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v27)
{
properties.Add(SmbiosProperty.Chassis.SkuNumber, GetEnclosureSkuNumber(n, m));
}
#endregion
}
}
}
else
{
properties.Add(SmbiosProperty.Chassis.ContainedElements, new ChassisContainedElementCollection(new List<ChassisContainedElement>()));
}
}
#endregion
}
#endregion
#region private methods
/// <summary>
/// Gets a value that describes the chassis or SKU number.
/// </summary>
/// <param name="n">Contained Element Count value.</param>
/// <param name="m">Contained ElementRecord Lenght value.</param>
/// <returns>
/// Description of the chassis or SKU number.
/// </returns>
private string GetEnclosureSkuNumber(byte n, byte m)
{
byte offset = (byte)(0x15 + (n * m));
return GetString(offset);
}
#endregion
#region BIOS Specification 3.0.0d (14/08/2014)
/// <summary>
/// Gets the list of items contained in this chassis.
/// </summary>
/// <param name="rawdevicePropertyArray">Raw information.</param>
/// <param name="n">Number of items to be treated.</param>
/// <returns>
/// Collection of elements contained in this chassis.
/// </returns>
private static IEnumerable<ChassisContainedElement> GetContainedElements(byte[] rawdevicePropertyArray, byte n)
{
var m = rawdevicePropertyArray.Length / n;
var containedElements = new Collection<ChassisContainedElement>();
for (var i = 0; i < rawdevicePropertyArray.Length; i += m)
{
var deviceProperty = new byte[m];
Array.Copy(rawdevicePropertyArray, i, deviceProperty, 0, m);
containedElements.Add(new ChassisContainedElement(deviceProperty));
}
return containedElements;
}
/// <summary>
/// Gets a <see cref="string"/> that identifies the type of chassis.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// Chassis type
/// </returns>
private static string GetEnclosureType(byte code)
{
string[] deviceProperty =
{
"Other", // 0x01
"Unknown",
"Desktop",
"Low Profile Desktop",
"Pizza Box",
"Mini Tower",
"Tower",
"Portable",
"Laptop",
"Notebook",
"Hand Held",
"Docking Station",
"All In One",
"Sub Notebook",
"Space-saving",
"Lunch Box",
"Main Server Chassis", // CIM_Chassis.ChassisPackageType says "Main System Chassis"
"Expansion Chassis",
"Sub Chassis",
"Bus Expansion Chassis",
"Peripheral Chassis",
"RAID Chassis",
"Rack Mount Chassis",
"Sealed-case PC",
"Multi-system",
"CompactPCI",
"AdvancedTCA",
"Blade",
"Blade Enclosing",
"Tablet",
"Convertible",
"Detachable",
"IoT Gateway",
"Embedded PC",
"Mini PC",
"Stick PC",
"Detachable" // 0x24
};
if (code >= 0x01 && code <= 0x24)
{
return deviceProperty[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a value indicating whether the chassis is anchored.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// Value indicating whether the chassis is anchored.
/// </returns>
private static string GetEnclosureLocked(byte code)
{
var locked = code >> 7;
string[] deviceProperty =
{
"Not Present",
"Present" // 0x01
};
return deviceProperty[locked];
}
/// <summary>
/// Gets a string that identifies the security state of the chassis.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// Chassis safety status.
/// </returns>
private static string GetEnclosureSecurityStatus(byte code)
{
string[] deviceProperty =
{
"Other", // 0x01
"Unknown",
"None",
"External Interface Locked Out",
"External Interface Enabled" // 0x05
};
if (code >= 0x01 && code <= 0x05)
{
return deviceProperty[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a <see cref="string"/> indicating the status of the chassis.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// Chassis Status.
/// </returns>
private static string GetEnclosureState(byte code)
{
string[] deviceProperty =
{
"Other", // 0x01
"Unknown",
"Safe",
"Warning",
"Critical",
"Non-recoverable" // 0x06
};
if (code >= 0x01 && code <= 0x06)
{
return deviceProperty[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Specific/ProcessorSpecificInformationBlock.cs
using System.Diagnostics;
using System.Linq;
using iTin.Core;
namespace iTin.Hardware.Specification.Smbios;
// Type 044: Processor Specific Block.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Block BYTE Varies Length of Processor-specific Data |
// | Length (N) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Processor BYTE Varies The processor architecture delineated by this |
// | Type Processor-specific Block. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Processor N Varies Processor-specific data. |
// | Specific BYTEs |
// | Data |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// This class represents a processor specific block of the structure <see cref="SmbiosType044"/>.
/// </summary>
public class ProcessorSpecificInformationBlock
{
#region private readonly memebrs
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly byte[] _data;
#endregion
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="ProcessorSpecificInformationBlock"/> class specifying the structure information.
/// </summary>
/// <param name="processorSpecificInformationBlockData">Untreated information of the current structure.</param>
internal ProcessorSpecificInformationBlock(byte[] processorSpecificInformationBlockData)
{
_data = processorSpecificInformationBlockData;
}
#endregion
#region private properties
/// <summary>
/// Gets a value that represents the '<b>Block Lenght</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte BlockLenght => _data[0x00];
/// <summary>
/// Gets a value that represents the '<b>Processor Type</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ProcessorTypeValue => _data[0x01];
#endregion
#region public properties
/// <summary>
/// Gets a value that represents the '<b>Processor Specific Data</b>' field. If not implemented this field return a <see cref="RiskVProcessorSpecificData.NotImplemented"/> instance.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
public IProcessorSpecificData ProcessorSpecificData => ProcessorTypeValue switch
{
0x00 => RiskVProcessorSpecificData.NotImplemented,
0x01 => RiskVProcessorSpecificData.NotImplemented,
0x02 => RiskVProcessorSpecificData.NotImplemented,
0x03 => RiskVProcessorSpecificData.NotImplemented,
0x04 => RiskVProcessorSpecificData.NotImplemented,
0x05 => RiskVProcessorSpecificData.NotImplemented,
0x06 => new RiskVProcessorSpecificData(_data.Extract((byte)0x02, BlockLenght).ToArray()),
0x07 => new RiskVProcessorSpecificData(_data.Extract((byte)0x02, BlockLenght).ToArray()),
0x08 => new RiskVProcessorSpecificData(_data.Extract((byte)0x02, BlockLenght).ToArray()),
_ => new LoongArchProcessorSpecificData(_data.Extract((byte)0x02, BlockLenght).ToArray())
};
/// <summary>
/// Gets a value that represents the '<b>Processor Type</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
public string ProcessorType => GetProcessorType(_data[0x01]);
#endregion
#region public override methods
/// <summary>
/// Returns a class <see cref="string"/> that represents the current object.
/// </summary>
/// <returns>
/// Object <see cref="string"/> that represents the current <see cref="ProcessorSpecificInformationBlock"/> class.
/// </returns>
public override string ToString() => $"ProcessorType = {ProcessorType}";
#endregion
#region private static methods
/// <summary>
/// Gets a string that identifies the processor type.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// Processor type.
/// </returns>
private static string GetProcessorType(byte code)
{
string[] value =
{
"Reserved", // 0x00
"IA32 (x86)",
"x64 (x86-64, Intel64, AMD64, EM64T)",
"Intel® Itanium® architecture",
"32-bit ARM (Aarch32)",
"64-bit ARM (Aarch64)",
"32-bit RISC-V (RV32)",
"64-bit RISC-V (RV64)",
"128-bit RISC-V (RV128)",
"32-bit LoongArch (LoongArch32)",
"64-bit LoongArch (LoongArch64)" // 0x0a
};
if (code <= 0x0a)
{
return value[code];
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryChannel.MemoryDevices.md
# DmiProperty.MemoryChannel.MemoryDevices class
Contains the key definition for the Memory Devices section.
```csharp
public static class MemoryDevices
```
## Public Members
| name | description |
| --- | --- |
| static [Handle](DmiProperty.MemoryChannel.MemoryDevices/Handle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Load](DmiProperty.MemoryChannel.MemoryDevices/Load.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [MemoryChannel](./DmiProperty.MemoryChannel.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType017 [Memory Device].cs
using iTin.Core;
using iTin.Core.Helpers.Enumerations;
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Memory Device (Type 17) structure.<br/>
/// For more information, please see <see cref="SmbiosType017"/>.
/// </summary>
internal sealed class DmiType017 : DmiBaseType<SmbiosType017>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType017"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType017(SmbiosType017 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion >= DmiStructureVersion.v21)
{
properties.Add(DmiProperty.MemoryDevice.PhysicalMemoryArrayHandle, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.PhysicalMemoryArrayHandle));
ushort memoryErrorInformationHandle = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.MemoryDevice.MemoryErrorInformationHandle);
switch (memoryErrorInformationHandle)
{
case 0xffff:
properties.Add(DmiProperty.MemoryDevice.MemoryErrorInformationHandle, -1);
break;
case 0xfffe:
properties.Add(DmiProperty.MemoryDevice.MemoryErrorInformationHandle, -2);
break;
default:
properties.Add(DmiProperty.MemoryDevice.MemoryErrorInformationHandle, memoryErrorInformationHandle);
break;
}
ushort totalWidth = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.MemoryDevice.TotalWidth);
if (totalWidth != 0xffff)
{
properties.Add(DmiProperty.MemoryDevice.TotalWidth, totalWidth);
}
ushort dataWidth = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.MemoryDevice.DataWidth);
if (dataWidth != 0xffff)
{
properties.Add(DmiProperty.MemoryDevice.DataWidth, dataWidth);
}
ushort size = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.MemoryDevice.Size);
if (size == 0x0000)
{
// No memory device installed
}
else if (size == 0xffff)
{
// size is unknown.
}
else if (size != 0x7fff)
{
bool sizeIsMeasuredInKb = IsMeasuredInKb(size);
if (!sizeIsMeasuredInKb)
{
size <<= 0x0a;
}
properties.Add(DmiProperty.MemoryDevice.Size, size);
}
else
{
if (ImplementedVersion >= DmiStructureVersion.v27)
{
uint extendedSize = SmbiosStructure.GetPropertyValue<uint>(SmbiosProperty.MemoryDevice.ExtendedSize);
properties.Add(DmiProperty.MemoryDevice.Size, extendedSize << 0x0a);
}
}
properties.Add(DmiProperty.MemoryDevice.FormFactor, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.FormFactor));
properties.Add(DmiProperty.MemoryDevice.DeviceSet, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.DeviceSet));
properties.Add(DmiProperty.MemoryDevice.DeviceLocator, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.DeviceLocator));
properties.Add(DmiProperty.MemoryDevice.BankLocator, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.BankLocator));
properties.Add(DmiProperty.MemoryDevice.MemoryType, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.MemoryType));
properties.Add(DmiProperty.MemoryDevice.TypeDetail, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.TypeDetail));
}
if (ImplementedVersion >= DmiStructureVersion.v23)
{
ushort maximunSpeed = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.MemoryDevice.Speed);
if (maximunSpeed != 0x0000)
{
properties.Add(DmiProperty.MemoryDevice.Speed, maximunSpeed);
}
properties.Add(DmiProperty.MemoryDevice.Manufacturer, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.Manufacturer));
properties.Add(DmiProperty.MemoryDevice.SerialNumber, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.SerialNumber));
properties.Add(DmiProperty.MemoryDevice.AssetTag, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.AssetTag));
properties.Add(DmiProperty.MemoryDevice.PartNumber, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.PartNumber));
}
if (ImplementedVersion >= DmiStructureVersion.v26)
{
byte rank = SmbiosStructure.GetPropertyValue<byte>(SmbiosProperty.MemoryDevice.Rank);
if (rank != 0x00)
{
properties.Add(DmiProperty.MemoryDevice.Rank, rank);
}
}
if (ImplementedVersion >= DmiStructureVersion.v27)
{
ushort currentSpeed = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.MemoryDevice.ConfiguredMemoryClockSpeed);
if (currentSpeed != 0x0000)
{
properties.Add(DmiProperty.MemoryDevice.ConfiguredMemoryClockSpeed, currentSpeed);
}
}
if (ImplementedVersion >= DmiStructureVersion.v28)
{
ushort minimunVoltage = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.MemoryDevice.MinimumVoltage);
if (minimunVoltage != 0x0000)
{
properties.Add(DmiProperty.MemoryDevice.MinimumVoltage, minimunVoltage);
}
ushort maximumVoltage = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.MemoryDevice.MaximumVoltage);
if (maximumVoltage != 0x0000)
{
properties.Add(DmiProperty.MemoryDevice.MaximumVoltage, maximumVoltage);
}
ushort configuredVoltage = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.MemoryDevice.ConfiguredVoltage);
if (configuredVoltage != 0x0000)
{
properties.Add(DmiProperty.MemoryDevice.ConfiguredVoltage, configuredVoltage);
}
}
if (ImplementedVersion >= DmiStructureVersion.v32)
{
properties.Add(DmiProperty.MemoryDevice.MemoryTechnology, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.MemoryTechnology));
properties.Add(DmiProperty.MemoryDevice.MemoryOperatingModeCapability, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.MemoryOperatingModeCapability));
properties.Add(DmiProperty.MemoryDevice.FirmwareVersion, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.FirmwareVersion));
properties.Add(DmiProperty.MemoryDevice.ModuleManufacturerId, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.ModuleManufacturerId));
properties.Add(DmiProperty.MemoryDevice.ModuleProductId, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.ModuleProductId));
properties.Add(DmiProperty.MemoryDevice.MemorySubsystemControllerManufacturerId, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.MemorySubsystemControllerManufacturerId));
properties.Add(DmiProperty.MemoryDevice.MemorySubsystemControllerProductId, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.MemorySubsystemControllerProductId));
properties.Add(DmiProperty.MemoryDevice.NonVolatileSize, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.NonVolatileSize));
properties.Add(DmiProperty.MemoryDevice.VolatileSize, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.VolatileSize));
properties.Add(DmiProperty.MemoryDevice.CacheSize, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.CacheSize));
properties.Add(DmiProperty.MemoryDevice.LogicalSize, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.LogicalSize));
}
if (ImplementedVersion >= DmiStructureVersion.v33)
{
properties.Add(DmiProperty.MemoryDevice.ExtendedSpeed, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.ExtendedSpeed));
properties.Add(DmiProperty.MemoryDevice.ExtendedConfiguredMemorySpeed, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.ExtendedConfiguredMemorySpeed));
}
if (ImplementedVersion >= DmiStructureVersion.v37)
{
properties.Add(DmiProperty.MemoryDevice.PMIC0ManufacturerId, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.PMIC0ManufacturerId));
properties.Add(DmiProperty.MemoryDevice.PMIC0RevisionNumber, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.PMIC0RevisionNumber));
properties.Add(DmiProperty.MemoryDevice.RCDManufacturerId, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.RCDManufacturerId));
properties.Add(DmiProperty.MemoryDevice.RCDRevisionNumber, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDevice.RCDRevisionNumber));
}
}
/// <summary>
/// Gets a value that indicates whether the memory is measured in KB.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// <b>true</b> if memory is measured in KB;<b>false</b> otherwise.
/// </returns>
private static bool IsMeasuredInKb(int code) => code.CheckBit(Bits.Bit15);
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.System/SkuNumber.md
# DmiProperty.System.SkuNumber property
Gets a value representing the key to retrieve the property value.
This text string identifies a particular computer configuration for sale. It is sometimes also called a product ID or purchase order number.
Key Composition
* Structure: System
* Property: SkuNumber
* Unit: None
Return Value
Type: String
Remarks
2.4+
```csharp
public static IPropertyKey SkuNumber { get; }
```
## See Also
* class [System](../DmiProperty.System.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/Specific/Enums/MemoryDeviceBelongsToSet.cs
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Defines the membership of a memory device to a set with the same size and type.
/// </summary>
internal enum MemoryDeviceBelongsToSet
{
/// <summary>
/// Not belong to a set
/// </summary>
No,
/// <summary>
/// Not known if it belongs to a set
/// </summary>
Unknown,
/// <summary>
/// Belongs to a set
/// </summary>
Yes
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.GroupAssociations.Items.md
# DmiProperty.GroupAssociations.Items class
Contains the key definition for the Items section.
```csharp
public static class Items
```
## Public Members
| name | description |
| --- | --- |
| static [Handle](DmiProperty.GroupAssociations.Items/Handle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Structure](DmiProperty.GroupAssociations.Items/Structure.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [GroupAssociations](./DmiProperty.GroupAssociations.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor/ProcessorId.md
# DmiProperty.Processor.ProcessorId property
Gets a value representing the key to retrieve the property value.
Raw processor identification data.
The Processor ID field contains processor-specific information that describes the processor’s features.
* **x86** – The field’s format depends on the processor’s support of the CPUID instruction. If the instruction is supported, the Processor ID field contains two DWORD-formatted values.
* The first (offsets 08h-0Bh) is the EAX value returned by a CPUID instruction with input EAX set to 1; the second(offsets 0Ch-0Fh) is the EDX value returned by that instruction.
* **ARM32** – The processor ID field contains two DWORD-formatted values. The first (offsets 08h-0Bh) is the contents of the Main ID Register(MIDR); the second(offsets 0Ch-0Fh) is zero.
* **ARM64** – The processor ID field contains two DWORD-formatted values. The first (offsets 08h-0Bh) is the contents of the MIDR_EL1 register; the second (offsets 0Ch-0Fh) is zero.
* **RISC-V** – The processor ID contains a QWORD Machine Vendor ID CSR (mvendroid) of RISC-V processor hart 0. More information of RISC-V class CPU feature is described in RISC-V processor additional information.
Key Composition
* Structure: Processor
* Property: ProcessorId
* Unit: None
Return Value
Type: String
Remarks
2.0+
```csharp
public static IPropertyKey ProcessorId { get; }
```
## See Also
* class [Processor](../DmiProperty.Processor.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Core/iTin.Core.Hardware/iTin.Core.Hardware.MacOS.Specification.Smbios/SmbiosOperations.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using iTin.Core.Hardware.Abstractions.Specification.Smbios;
using iTin.Core.Interop.Shared.MacOS;
namespace iTin.Core.Hardware.MacOS.Specification.Smbios;
/// <summary>
/// Specialization of the <see cref="ISmbiosOperations"/> interface that contains the <b>SMBIOS</b> operations for <b>OSX</b> system.
/// </summary>
public class SmbiosOperations : ISmbiosOperations
{
/// <summary>
/// Gets a value containing the raw <b>SMBIOS</b> data.
/// </summary>
/// <param name="options">Connection options for remote use</param>
/// <returns>
/// The raw <b>SMBIOS</b> data.
/// </returns>
public byte[] GetSmbiosDataArray(ISmbiosConnectOptions options = null)
{
var startInfo = new ProcessStartInfo
{
FileName = Command.IoReg.ToString(),
Arguments = "-lw0 -n \"AppleSMBIOS\" -r | grep \"SMBIOS\"",
/*Arguments = "-w0 -c \"AppleSMBIOS\" -r",*/
UseShellExecute = false,
CreateNoWindow = false,
RedirectStandardOutput = true,
RedirectStandardError = true
};
var process = new Process
{
StartInfo = startInfo
};
string ioAppleSmbios = string.Empty;
process.OutputDataReceived += (sender, data) =>
{
if (data != null)
{
if (data.Data != null)
{
if (data.Data.Contains("\"SMBIOS\" = <"))
{
string[] splitted = data.Data.Split(new[] { "\"SMBIOS\" = " }, StringSplitOptions.RemoveEmptyEntries);
string rawSmbios = splitted[1].Replace("<", string.Empty).Replace(">", string.Empty);
ioAppleSmbios = rawSmbios;
}
}
}
};
process.ErrorDataReceived += (sender, data) =>
{
};
try
{
process.Start();
process.BeginOutputReadLine();
process.BeginErrorReadLine();
process.WaitForExit();
}
catch
{
}
var item = new List<byte>();
for (int i = 0; i <= ioAppleSmbios.Length - 1; i += 2)
{
item.Add(Convert.ToByte(ioAppleSmbios.Substring(i, 2), 16));
}
return (byte[])item.ToArray().Clone();
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/IDmiType/ImplementedVersion.md
# IDmiType.ImplementedVersion property
Returns a value that indicates the implemented version of a [`DMI`](../../iTin.Hardware.Specification/DMI.md) structure.
```csharp
public DmiStructureVersion ImplementedVersion { get; }
```
## Return Value
One of the values of the [`DmiStructureVersion`](../DmiStructureVersion.md) enumeration.
## See Also
* enum [DmiStructureVersion](../DmiStructureVersion.md)
* interface [IDmiType](../IDmiType.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType035 [Management Device Component].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Management Device Component (Type 35) structure.<br/>
/// For more information, please see <see cref="SmbiosType035"/>.
/// </summary>
internal sealed class DmiType035 : DmiBaseType<SmbiosType035>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType035"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType035(SmbiosType035 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion < DmiStructureVersion.Latest)
{
return;
}
properties.Add(DmiProperty.ManagementDeviceComponent.Description, SmbiosStructure.GetPropertyValue(SmbiosProperty.ManagementDeviceComponent.Description));
properties.Add(DmiProperty.ManagementDeviceComponent.ComponentHandle, SmbiosStructure.GetPropertyValue(SmbiosProperty.ManagementDeviceComponent.ComponentHandle));
ushort thresholdHandle = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.ManagementDeviceComponent.ThresholdHandle);
if (thresholdHandle != 0xffff)
{
properties.Add(DmiProperty.ManagementDeviceComponent.ThresholdHandle, thresholdHandle);
}
properties.Add(DmiProperty.ManagementDeviceComponent.ManagementDeviceHandle, SmbiosStructure.GetPropertyValue(SmbiosProperty.ManagementDeviceComponent.ManagementDeviceHandle));
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/MemoryErrorInformationHandle.md
# DmiProperty.MemoryDevice.MemoryErrorInformationHandle property
Gets a value representing the key to retrieve the property.
Handle, or instance number, associated with any error that was previously detected for the device. If no error was detected returns -1. If the system does not provide the error information returns -2.
Key Composition
* Structure: MemoryDevice
* Property: MemoryErrorInformationHandle
* Unit: None
Return Value
Type: UInt16
Remarks
2.1+
```csharp
public static IPropertyKey MemoryErrorInformationHandle { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiConnectOptions.md
# DmiConnectOptions class
Defines remote user parameters
```csharp
public class DmiConnectOptions
```
## Public Members
| name | description |
| --- | --- |
| [DmiConnectOptions](DmiConnectOptions/DmiConnectOptions.md)() | The default constructor. |
| [MachineNameOrIpAddress](DmiConnectOptions/MachineNameOrIpAddress.md) { get; set; } | |
| [Password](DmiConnectOptions/Password.md) { get; set; } | |
| [UserName](DmiConnectOptions/UserName.md) { get; set; } | |
## See Also
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.CoolingDevice/NominalSpeed.md
# DmiProperty.CoolingDevice.NominalSpeed property
Gets a value representing the key to retrieve the property value.
Nominal value for the cooling device’s rotational speed, in revolutions-per-minute (rpm)
Key Composition
* Structure: CoolingDevice
* Property: NominalSpeed
* Unit: RPM
Return Value
Type: UInt16
Remarks
2.2+
```csharp
public static IPropertyKey NominalSpeed { get; }
```
## See Also
* class [CoolingDevice](../DmiProperty.CoolingDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/DataWidth.md
# DmiProperty.MemoryDevice.DataWidth property
Gets a value representing the key to retrieve the property.
Data width, in bits, of this memory device A data width of 0 and a total width of 8 indicates that the device is being used solely to provide 8 error-correction bits
Key Composition
* Structure: MemoryDevice
* Property: DataWidth
* Unit: Bits
Return Value
Type: UInt16
Remarks
2.1+
```csharp
public static IPropertyKey DataWidth { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BitMemoryError32.md
# DmiProperty.BitMemoryError32 class
Contains the key definitions available for a type 018 [BitMemoryError32 Information] structure.
```csharp
public static class BitMemoryError32
```
## Public Members
| name | description |
| --- | --- |
| static [DeviceErrorAddress](DmiProperty.BitMemoryError32/DeviceErrorAddress.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ErrorGranularity](DmiProperty.BitMemoryError32/ErrorGranularity.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ErrorOperation](DmiProperty.BitMemoryError32/ErrorOperation.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ErrorResolution](DmiProperty.BitMemoryError32/ErrorResolution.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ErrorType](DmiProperty.BitMemoryError32/ErrorType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MemoryArrayErrorAddress](DmiProperty.BitMemoryError32/MemoryArrayErrorAddress.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [VendorSyndrome](DmiProperty.BitMemoryError32/VendorSyndrome.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.System/ProductName.md
# DmiProperty.System.ProductName property
Gets a value representing the key to retrieve the property value.
Product name
Key Composition
* Structure: System
* Property: ProductName
* Unit: None
Return Value
Type: String
Remarks
2.0+
```csharp
public static IPropertyKey ProductName { get; }
```
## See Also
* class [System](../DmiProperty.System.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.ManagementDeviceComponent.md
# DmiProperty.ManagementDeviceComponent class
Contains the key definitions available for a type 035 [ManagementDeviceComponent] structure.
```csharp
public static class ManagementDeviceComponent
```
## Public Members
| name | description |
| --- | --- |
| static [ComponentHandle](DmiProperty.ManagementDeviceComponent/ComponentHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Description](DmiProperty.ManagementDeviceComponent/Description.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ManagementDeviceHandle](DmiProperty.ManagementDeviceComponent/ManagementDeviceHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ThresholdHandle](DmiProperty.ManagementDeviceComponent/ThresholdHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.EndOfTable.md
# DmiProperty.EndOfTable class
Contains the key definitions available for a type 127 [EndOfTable] structure.
```csharp
public static class EndOfTable
```
## Public Members
| name | description |
| --- | --- |
| static [Status](DmiProperty.EndOfTable/Status.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType002 [Baseboard (or Module) Information].cs
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using iTin.Core;
using iTin.Core.Helpers.Enumerations;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 0002: Baseboard (or Module) Information
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length deviceProperty Description |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 2 Baseboard Information Indicator |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE Varies Length of the structure. At least 08h. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Manufacturer BYTE STRING Number of null-terminated string |
// | |
// | Note: Please see, Manufacturer |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Product BYTE STRING Number of null-terminated string |
// | |
// | Note: Please see, Product |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h Version BYTE STRING Number of null-terminated string |
// | |
// | Note: Please see, Version |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h Serial Number BYTE STRING Number of null-terminated string |
// | |
// | Note: Please see, SerialNumber |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h Asset Tag BYTE STRING Number of null-terminated string |
// | |
// | Note: Please see, AssetTag |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 09h Feature BYTE Bit Field A collection of 'flags' that identify the characteristics of |
// | Flags this baseboard. |
// | |
// | Bit(s) Description |
// | 07:05 - Reserved for future definition by this |
// | specification; set to 000b. |
// | |
// | 04 - Set to 1 if the board is hot swappable; it is |
// | possible to replace the board with a physically |
// | different but equivalent board while power is applied |
// | to the board. The board is inherently replaceable and |
// | removable. |
// | Note: Please see, IsHotSwappable |
// | |
// | 03 - Set to 1 if the board is replaceable; it is possible |
// | to replace (either as a field repair or upgrade) the |
// | board with a physically different board. The board is |
// | inherently removable. |
// | Note: Please see, IsReplaceable |
// | |
// | 02 - Set to 1 if the board is removable; it is designed to |
// | be taken in and out of the chassis without impairing |
// | the function of the chassis. |
// | Note: Please see, IsRemovable |
// | |
// | 01 - Set to 1 if the board requires at least one daughter |
// | board or auxiliary card to function properly. |
// | Note: Please see, RequiredDaughterBoard |
// | |
// | 00 - Set to 1 if the board is a hosting board |
// | (for example, a motherboard). |
// | Note: Please see, IsHostingBoard |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ah Location in BYTE STRING Number of null-terminated string which describes the location |
// | Chassis of this motherboard within the chassis (described below). |
// | This field supports a CIM_Container class mapping |
// | where: |
// | · LocationWithinContainer is this field. |
// | · GroupComponent is the chassis referenced by Chassis Handle |
// | · PartComponent is this baseboard. |
// | Note: Please see, LocationInChassis |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Bh Chassis WORD Varies Identifier or instance number associated with the chassis that |
// | Handle contains this baseboard. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Dh Board BYTE ENUM Identifies the type of baseboard. |
// | Type Note: Please see, GetBoardType(byte) |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Eh Number of BYTE Varies Identifies the number (0 - 255) of contained objects in this |
// | Contained baseboard. |
// | Object |
// | Handles (n) |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Fh Contained n Varies List of identifiers of other SMBIOS structures (For example, |
// | Object WORDs Baseboard, Proccessor, Port, System, Slots, Memory Device) |
// | Handles present on this motherboard. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Baseboard (or Module) Information (Type 2) structure.
/// </summary>
internal sealed class SmbiosType002 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType002"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType002(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private readonly properties
/// <summary>
/// Gets a value representing the <b>Manufacturer</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Manufacturer => GetString(0x04);
/// <summary>
/// Gets a value representing the <b>Product</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Product => GetString(0x05);
/// <summary>
/// Gets a value representing the <b>Version</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Version => GetString(0x06);
/// <summary>
/// Gets a value representing the <b>Serial Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string SerialNumber => GetString(0x07);
/// <summary>
/// Gets a value representing the <b>Asset Tag</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string AssetTag => GetString(0x08);
/// <summary>
/// Gets a value representing the <b>Feature Flags</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte FeatureFlags => Reader.GetByte(0x09);
/// <summary>
/// Gets a value representing the <b>Is Hosting Board</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool IsHostingBoard => FeatureFlags.CheckBit(Bits.Bit00);
/// <summary>
/// Gets a value representing the <b>Required Daughter Board</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool RequiredDaughterBoard => FeatureFlags.CheckBit(Bits.Bit01);
/// <summary>
/// Gets a value representing the <b>Is Removable</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool IsRemovable => FeatureFlags.CheckBit(Bits.Bit02);
/// <summary>
/// Gets a value representing the <b>Is Replaceable</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool IsReplaceable => FeatureFlags.CheckBit(Bits.Bit03);
/// <summary>
/// Gets a value representing the <b>Is Hot Swappable</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool IsHotSwappable => FeatureFlags.CheckBit(Bits.Bit04);
/// <summary>
/// Gets a value representing the <b>Location In Chassis</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string LocationInChassis => GetString(0x0a);
/// <summary>
/// Gets a value representing the <b>Chassis Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ChassisHandle => (ushort)Reader.GetWord(0x0b);
/// <summary>
/// Gets a value representing the <b>Board Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte BoardType => Reader.GetByte(0x0d);
/// <summary>
/// Gets a value representing the <b>Number Of Contained Object Handles</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte NumberOfContainedObjectHandles => Reader.GetByte(0x0e);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
properties.Add(SmbiosProperty.BaseBoard.Manufacturer, Manufacturer);
properties.Add(SmbiosProperty.BaseBoard.Product, Product);
properties.Add(SmbiosProperty.BaseBoard.Version, Version);
properties.Add(SmbiosProperty.BaseBoard.SerialNumber, SerialNumber);
if (StructureInfo.Length >= 0x09)
{
properties.Add(SmbiosProperty.BaseBoard.AssetTag, AssetTag);
}
if (StructureInfo.Length >= 0x0a)
{
properties.Add(SmbiosProperty.BaseBoard.Features.IsHotSwappable, IsHotSwappable);
properties.Add(SmbiosProperty.BaseBoard.Features.IsReplaceable, IsReplaceable);
properties.Add(SmbiosProperty.BaseBoard.Features.IsRemovable, IsRemovable);
properties.Add(SmbiosProperty.BaseBoard.Features.RequiredDaughterBoard, RequiredDaughterBoard);
properties.Add(SmbiosProperty.BaseBoard.Features.IsHostingBoard, IsHostingBoard);
}
if (StructureInfo.Length >= 0x0b)
{
properties.Add(SmbiosProperty.BaseBoard.LocationInChassis, LocationInChassis);
}
if (StructureInfo.Length >= 0x0c)
{
properties.Add(SmbiosProperty.BaseBoard.ChassisHandle, ChassisHandle);
}
if (StructureInfo.Length >= 0x0d)
{
properties.Add(SmbiosProperty.BaseBoard.BoardType, GetBoardType(BoardType));
}
if (StructureInfo.Length >= 0x0e)
{
byte n = NumberOfContainedObjectHandles;
properties.Add(SmbiosProperty.BaseBoard.NumberOfContainedObjectHandles, n);
if (n != 0x00 && StructureInfo.Length >= 0x0f)
{
byte[] containedElementsArray = StructureInfo.RawData.Extract((byte)0x0f, n).ToArray();
IEnumerable<SmbiosStructure> containedElements = GetContainedElements(containedElementsArray);
properties.Add(SmbiosProperty.BaseBoard.ContainedElements, new BaseBoardContainedElementCollection(containedElements));
}
}
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets a <see cref="string"/> that identifies the type of motherboard.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// Type of motherboard.
/// </returns>
private static string GetBoardType(byte code)
{
string[] deviceProperty =
{
"Unknown", // 0x01
"Other",
"Server Blade",
"Connectivity Switch",
"System Management Module",
"Processor Module",
"I/O Module",
"Memory Module",
"Daughter Board",
"Motherboard",
"Processor+Memory Module",
"Processor+I/O Module",
"Interconnect Board" // 0x0D
};
if (code >= 0x01 && code <= 0x0D)
{
return deviceProperty[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets the list of items contained in this motherboard
/// </summary>
/// <param name="rawdevicePropertyArray">Raw information.</param>
/// <returns>
/// Collection of items contained in this motherboard..
/// </returns>
private static IEnumerable<SmbiosStructure> GetContainedElements(IEnumerable<byte> rawdevicePropertyArray)
{
var containedElements = new Collection<SmbiosStructure>();
foreach (var deviceProperty in rawdevicePropertyArray)
{
containedElements.Add((SmbiosStructure)deviceProperty);
}
return containedElements;
}
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Tpm/TpmFirmwareVersion.cs
using iTin.Core;
namespace iTin.Hardware.Specification.Tpm;
// TPM_VERSION definition
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Type Name Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | TPM_VERSION_BYTE Major This SHALL indicate the major version of the TPM, mostSigVer MUST be 0x01, leastSigVer MUST be 0x00 |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | TPM_VERSION_BYTE Minor This SHALL indicate the minor version of the TPM, mostSigVer MUST be 0x01 or 0x02, leastSigVer MUST be 0x00 |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | TPM_VERSION_BYTE revMajor This SHALL be the value of the TPM_PERMANENT_DATA -> revMajor |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | TPM_VERSION_BYTE revMinor This SHALL be the value of the TPM_PERMANENT_DATA -> revMinor |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
//
// Notes
// 1. The major and minor fields indicate the specification version the TPM was designed for
// 2. The revMajor and revMinor fields indicate the manufacturer’s revision of the TPM
// a. Most challengers of the TPM MAY ignore the revMajor and revMinor fields
//
// TPM_VERSION_BYTE definition
// Allocating a byte for the version information is wasteful of space.The current allocation does not provide sufficient resolution to indicate completely the version of the TPM.
// To allow for backwards compatibility the size of the structure does not change from 1.1.
// To enable minor version numbers with 2-digit resolution, the byte representing a version splits into two BCD encoded nibbles.The ordering of the low and high order provides
// backwards compatibility with existing numbering.
// An example of an implementation of this is; a version of 1.23 would have the value 2 in bit positions 3-0 and the value 3 in bit positions 7-4.
// TPM_VERSION_BYTE is a byte.
//
// The byte is broken up according to the following rule
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Bit position Name Description |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 7-4 leastSigVer Least significant nibble of the minor version. MUST be values within the range of 0000-1001 |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 3-0 mostSigVer Most significant nibble of the minor version. MUST be values within the range of 0000-1001 |
// •——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Represents <b>TPM</b> firmware version.
/// </summary>
public class TpmFirmwareVersion
{
#region public static readonly properties
/// <summary>
/// Gets a <see cref="TpmFirmwareVersion"/> reference with all field set to minus one (-1).
/// </summary>
/// <value>
/// An empty <see cref="TpmFirmwareVersion"/> reference. All values sets to zero (0)
/// </value>
public static TpmFirmwareVersion Unknown => new TpmFirmwareVersion {MajorVersion = -1, MinorVersion = -1, MajorRevision = -1, MinorRevision = -1};
#endregion
#region public readonly properties
/// <summary>
/// Gets a value indicating whether this instance is unknown version.
/// </summary>
/// <value>
/// <b>true</b> if this <b>TpmFirmwareVersion</b> instance has a unknown version contains the default; otherwise, <b>false</b>.
/// </value>
public bool IsUnknownVersion =>MajorVersion == -1 && MinorVersion == -1 && MajorRevision == -1 && MinorRevision == -1;
#endregion
#region public properties
/// <summary>
/// Gets or sets a value representing firmware major version.
/// </summary>
/// <value>
/// Firmware major version.
/// </value>
public int MajorVersion { get; set; }
/// <summary>
/// Gets or sets a value representing firmware minor version.
/// </summary>
/// <value>
/// Firmware minor version.
/// </value>
public int MinorVersion { get; set; }
/// <summary>
/// Gets or sets a value representing firmware major revision, this value is usually the manufacturer's major revision.
/// </summary>
/// <value>
/// Firmware major revision.
/// </value>
public int MajorRevision { get; set; }
/// <summary>
/// Gets or sets a value representing firmware minor revision, this value is usually the manufacturer's minor revision.
/// </summary>
/// <value>
/// Firmware minor revision.
/// </value>
public int MinorRevision { get; set; }
#endregion
#region public static methods
/// <summary>
/// Parses firmware version raw data, valid only for <b>Firmware Spec Version 1</b>.
/// </summary>
/// <param name="rawBytes">Target data to analyze</param>
/// <returns>
/// A <see cref="TpmFirmwareVersion"/> reference that contains the firmware version.
/// </returns>
public static TpmFirmwareVersion Parse(byte[] rawBytes)
{
var majorVersion = rawBytes[0x00];
var majorVersionNibbles = majorVersion.ToNibbles();
var mostSigVerMajorVersion = majorVersionNibbles[1];
var leastSigVerMajorVersion = majorVersionNibbles[0];
var minorVersion = rawBytes[0x01];
var minorVersionNibbles = minorVersion.ToNibbles();
var mostSigVerMinorVersion = minorVersionNibbles[1];
var leastSigVerMinorVersion = minorVersionNibbles[0];
var majorRevision = rawBytes[0x02];
var minorRevision = rawBytes[0x03];
return new TpmFirmwareVersion
{
MajorVersion = mostSigVerMajorVersion,
MinorVersion = mostSigVerMinorVersion,
MajorRevision = majorRevision,
MinorRevision = minorRevision
};
}
#endregion
#region public override methods
/// <summary>
/// Returns a class <see cref="string"/> that represents the current object.
/// </summary>
/// <returns>
/// Object <see cref="string"/> that represents the current <see cref="TpmFirmwareVersion"/> class.
/// </returns>
public override string ToString() => MajorRevision != 0 ? $"{MajorVersion}.{MinorVersion}.{MajorRevision}.{MinorRevision}" : $"{MajorVersion}.{MinorVersion}";
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/SmbiosStructureInfo.cs
using System;
using System.Collections.Generic;
using iTin.Core.Hardware.Common;
namespace iTin.Hardware.Specification.Smbios;
/// <summary>
/// Defines the contents of a structure type.
/// </summary>
internal readonly struct SmbiosStructureInfo : IEquatable<SmbiosStructureInfo>
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosStructureInfo"/> struct.
/// </summary>
/// <param name="context">The <see cref="SMBIOS"/> context.</param>
/// <param name="structureType">Type of the structure.</param>
public SmbiosStructureInfo(SMBIOS context, SmbiosStructure structureType)
{
Context = context;
StructureType = structureType;
SmbiosVersion = context.Version;
}
#endregion
#region public readonly properties
/// <summary>
/// Gets a value that represents the structure friendly name.
/// </summary>
/// <value>
/// The structure friendly name
/// </value>
public string FriendlyStructureName => StructureType.GetPropertyName();
/// <summary>
/// Gets a value representing the version of <see cref="SMBIOS"/>.
/// </summary>
/// <value>
/// <see cref="SMBIOS"/> versión.
/// </value>
public int SmbiosVersion { get; }
/// <summary>
/// Gets the type of structure.
/// </summary>
/// <value>Type of structure.</value>
public SmbiosStructure StructureType { get; }
/// <summary>
/// Gets collection of available structures.
/// </summary>
/// <value>
/// Collection of available structures.
/// </value>
public SmbiosStructureCollection Structures
{
get
{
IEnumerable<SmbiosBaseType> structures = SmbiosStructureFactory.Create(this);
return new SmbiosStructureCollection(structures);
}
}
#endregion
#region internal readonly properties
/// <summary>
/// Gets a value that represents the underliying <see cref="SMBIOS"/>.
/// </summary>
/// <value>
/// The current <see cref="SMBIOS"/> context.
/// </value>
internal SMBIOS Context { get; }
#endregion
#region public operators
/// <summary>
/// Implements the == operator.
/// </summary>
/// <param name="structureInfo1">The structure info1.</param>
/// <param name="structureInfo2">The structure info2.</param>
/// <returns>
/// Returns <b>true</b> if <b>structureInfo1</b> is equal to <b>structureInfo2</b>; <b>false</b> otherwise.
/// </returns>
public static bool operator ==(SmbiosStructureInfo structureInfo1, SmbiosStructureInfo structureInfo2) => structureInfo1.Equals(structureInfo2);
/// <summary>
/// Implements the != operator.
/// </summary>
/// <param name="structureInfo1">The structure info1.</param>
/// <param name="structureInfo2">The structure info2.</param>
/// <returns>
/// Returns <b>true</b> if <b>structureInfo1</b> is not equal to <b>structureInfo2</b>; <b>false</b> otherwise.
/// </returns>
public static bool operator !=(SmbiosStructureInfo structureInfo1, SmbiosStructureInfo structureInfo2) => !structureInfo1.Equals(structureInfo2);
#endregion
#region public methods
/// <inheritdoc/>
/// <summary>
/// Indicates whether the current object is equal to another object of the same type.
/// </summary>
/// <param name="other">Object to be compared to this object.</param>
/// <returns>
/// <b>true</b> if the current object is equal to the parameter <paramref name="other"/>; Otherwise, <b>false</b>.
/// </returns>
public bool Equals(SmbiosStructureInfo other) => other.Equals((object)this);
/// <summary>
/// Returns the structure description.
/// </summary>
/// <returns>
/// The structure description.
/// </returns>
public string GetStructureDescrition() => StructureType.GetPropertyDescription();
#endregion
#region public override methods
/// <summary>
/// Returns a hash code for this instance.
/// </summary>
/// <returns>
/// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
/// </returns>
public override int GetHashCode() => StructureType.GetHashCode() ^ SmbiosVersion;
/// <summary>
/// Determines whether the specified <see cref="T:System.Object"/> is equal to this instance.
/// </summary>
/// <param name="obj">Another object with which the comparison is to be made.</param>
/// <returns>
/// <b>true</b> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <b>false</b>.
/// </returns>
public override bool Equals(object obj)
{
if (obj is not SmbiosStructureInfo other)
{
return false;
}
return
other.StructureType == StructureType &&
other.SmbiosVersion == SmbiosVersion;
}
/// <summary>
/// Returns a <see cref="string"/> that represents this instance.
/// </summary>
/// <returns>A <see cref="string"/> that represents this instance.</returns>
/// <remarks>
/// The <see cref="ToString()"/> method returns a string that includes the <see cref="StructureType"/>.
/// </remarks>
public override string ToString() => $"SMBIOS = {SmbiosVersion:X2}, Type = {StructureType}, Structures = {Structures.Count}";
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemSlots.Peers/DataBusWidth.md
# DmiProperty.SystemSlots.Peers.DataBusWidth property
Gets a value representing the key to retrieve the property value.
Indicates electrical bus width of peer Segment/Bus/Device/Function.
Key Composition
* Structure: SystemSlots
* Property: DataBusWidth
* Unit: None
Return Value
Type: Byte
Remarks
3.2
```csharp
public static IPropertyKey DataBusWidth { get; }
```
## See Also
* class [Peers](../DmiProperty.SystemSlots.Peers.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryController/MaximumMemoryModuleSize.md
# DmiProperty.MemoryController.MaximumMemoryModuleSize property
Gets a value representing the key to retrieve the property value.
Size of the largest memory module supported (per slot), specified as n, where 2**n is the maximum size in MB. The maximum amount of memory supported by this controller is that value times the number of slots, as specified in [`NumberMemorySlots`](./NumberMemorySlots.md) property.
Key Composition
* Structure: MemoryController
* Property: MaximumMemoryModuleSize
* Unit: MB
Return Value
Type: Int32
Remarks
2.0+
```csharp
public static IPropertyKey MaximumMemoryModuleSize { get; }
```
## See Also
* class [MemoryController](../DmiProperty.MemoryController.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryController/CurrentInterleave.md
# DmiProperty.MemoryController.CurrentInterleave property
Gets a value representing the key to retrieve the property value.
Current interleave.
Key Composition
* Structure: MemoryController
* Property: CurrentInterleave
* Unit: None
Return Value
Type: String
Remarks
2.0+
```csharp
public static IPropertyKey CurrentInterleave { get; }
```
## See Also
* class [MemoryController](../DmiProperty.MemoryController.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Chassis/NumberOfPowerCords.md
# DmiProperty.Chassis.NumberOfPowerCords property
Gets a value representing the key to retrieve the property value.
Number of power cords associated with the enclosure or chassis.
Key Composition
* Structure: SystemEnclosure
* Property: NumberOfPowerCords
* Unit: None
Return Value
Type: Byte
Remarks
2.3+
```csharp
public static IPropertyKey NumberOfPowerCords { get; }
```
## See Also
* class [Chassis](../DmiProperty.Chassis.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.ManagementControllerHostInterface.Protocol/ProtocolType.md
# DmiProperty.ManagementControllerHostInterface.Protocol.ProtocolType property
Gets a value representing the key to retrieve the property value.
Protocol type.
Key Composition
* Structure: ManagementControllerHostInterface
* Property: ProtocolType
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey ProtocolType { get; }
```
## See Also
* class [Protocol](../DmiProperty.ManagementControllerHostInterface.Protocol.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType046 [String Property].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the String Property (Type 46) structure.<br/>
/// For more information, please see <see cref="SmbiosType046"/>.
/// </summary>
internal sealed class DmiType046: DmiBaseType<SmbiosType046>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType046"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType046(SmbiosType046 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
#region version 3.5
properties.Add(DmiProperty.StringProperty.PropertyId, SmbiosStructure.GetPropertyValue(SmbiosProperty.StringProperty.PropertyId));
properties.Add(DmiProperty.StringProperty.PropertyValue, SmbiosStructure.GetPropertyValue(SmbiosProperty.StringProperty.PropertyValue));
properties.Add(DmiProperty.StringProperty.ParentHandle, SmbiosStructure.GetPropertyValue(SmbiosProperty.StringProperty.ParentHandle));
#endregion
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiStructure.md
# DmiStructure class
Represents a structure [`DMI`](../iTin.Hardware.Specification/DMI.md).
```csharp
public sealed class DmiStructure
```
## Public Members
| name | description |
| --- | --- |
| [Class](DmiStructure/Class.md) { get; } | Gets a value that represents the class implemented. |
| [Elements](DmiStructure/Elements.md) { get; } | Gets the collection of available items. |
| [FriendlyClassName](DmiStructure/FriendlyClassName.md) { get; } | Gets a value that represents the structure friendly name. |
| [GetStructureDescrition](DmiStructure/GetStructureDescrition.md)() | Returns the structure description. |
| override [ToString](DmiStructure/ToString.md)() | Returns a String that represents this instance. |
## See Also
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PhysicalMemoryArray/Location.md
# DmiProperty.PhysicalMemoryArray.Location property
Gets a value representing the key to retrieve the property value.
Physical location of the Memory Array, whether on the system board or an add-in board.
Key Composition
* Structure: PhysicalMemoryArray
* Property: Location
* Unit: None
Return Value
Type: String
Remarks
2.1+
```csharp
public static IPropertyKey Location { get; }
```
## See Also
* class [PhysicalMemoryArray](../DmiProperty.PhysicalMemoryArray.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.OutOfBandRemote.Connections/OutBoundConnection.md
# DmiProperty.OutOfBandRemote.Connections.OutBoundConnection property
Gets a value representing the key to retrieve the property value.
Indicates whether is allowed to initiate outbound connections to contact an alert management facility when critical conditions occur.
Key Composition
* Structure: OutOfBandRemote
* Property: OutBoundConnection
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey OutBoundConnection { get; }
```
## See Also
* class [Connections](../DmiProperty.OutOfBandRemote.Connections.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType018 [32-Bit Memory Error Information].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 018: 32-Bit Memory Error Information.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.1+ Type BYTE 18 32-bit Memory Error Information type |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.1+ Length BYTE 17h Length of the structure. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 2.1+ Handle WORD Varies The handle, or instance number, associated|
// | with the structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 2.1+ Error Type BYTE ENUM The type of error that is associated with |
// | the current status reported for the memory|
// | array or device. |
// | Note: See GetErrorType(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h 2.1+ Error BYTE ENUM Identifies the granularity (for example, |
// | Granularity device versus Partition) to which the |
// | error can be resolved. |
// | Note: See GetErrorGranularity(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h 2.1+ Error Operation BYTE ENUM The memory access operation that caused |
// | the error. |
// | Note: See GetErrorOperation(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h 2.1+ Vendor DWORD Varies The vendor-specific ECC syndrome or CRC |
// | Syndrome data associated with the erroneous access.|
// | If the value is unknown, this field |
// | contains 0000 0000h. |
// | Note: See CrcData |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Bh 2.1+ Memory Array DWORD Varies The 32-bit physical address of the error |
// | Error Address based on the addressing of the bus to |
// | which the memory array is connected. |
// | If the address is unknown, this field |
// | contains 8000 0000h. |
// | Note: See BusErrorAddress |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Fh 2.1+ Device Error DWORD Varies The 32-bit physical address of the error |
// | Address relative to the start of the failing |
// | memory device, in bytes. |
// | If the address is unknown, this field |
// | contains 8000 0000h. |
// | Note: See DeviceErrorAddress |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 13h 2.1+ Error DWORD Varies The range, in bytes, within which the |
// | Resolution error can be determined, when an error |
// | address is given. |
// | If the range is unknown, this field |
// | contains 8000 0000h. |
// | Note: See ErrorResolution |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the 32-Bit Memory Error Information (Type 18) structure.
/// </summary>
internal class SmbiosType018 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType018"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType018(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
#region Version 2.1+ fields
/// <summary>
/// Gets a value representing the <b>Error Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ErrorType => Reader.GetByte(0x04);
/// <summary>
/// Gets a value representing the <b>Error Granularity</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ErrorGranularity => Reader.GetByte(0x05);
/// <summary>
/// Gets a value representing the <b>Error Operation</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ErrorOperation => Reader.GetByte(0x06);
/// <summary>
/// Gets a value representing the <b>Crc Data</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint CrcData => (uint)Reader.GetDoubleWord(0x07);
/// <summary>
/// Gets a value representing the <b>Bus Error Address</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint BusErrorAddress => (uint)Reader.GetDoubleWord(0x0b);
/// <summary>
/// Gets a value representing the <b>Device Error Address</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint DeviceErrorAddress => (uint)Reader.GetDoubleWord(0x0f);
/// <summary>
/// Gets a value representing the <b>Error Resolution</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint ErrorResolution => (uint)Reader.GetDoubleWord(0x13);
#endregion
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.v21)
{
return;
}
properties.Add(SmbiosProperty.BitMemoryError32.ErrorType, GetErrorType(ErrorType));
properties.Add(SmbiosProperty.BitMemoryError32.ErrorGranularity, GetErrorGranularity(ErrorGranularity));
properties.Add(SmbiosProperty.BitMemoryError32.ErrorOperation, GetErrorOperation(ErrorOperation));
properties.Add(SmbiosProperty.BitMemoryError32.VendorSyndrome, CrcData);
properties.Add(SmbiosProperty.BitMemoryError32.MemoryArrayErrorAddress, BusErrorAddress);
properties.Add(SmbiosProperty.BitMemoryError32.DeviceErrorAddress, DeviceErrorAddress);
properties.Add(SmbiosProperty.BitMemoryError32.ErrorResolution, ErrorResolution);
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets a string representing the type of error.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// Error type.
/// </returns>
internal static string GetErrorType(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"OK",
"Bad Read",
"Parity Error",
"Single-bit Error",
"Double-bit Error",
"Multi-bit Error",
"Nibble Error",
"Checksum Error",
"CRC Error",
"Corrected Single-bit Error",
"Corrected Error",
"Uncorrectable Error" // 0x0E
};
if (code >= 0x01 && code <= 0x0E)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string indicating 'Granularity'.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// Indicates the 'Granularity'.
/// </returns>
internal static string GetErrorGranularity(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"Device level",
"Memory partition level" // 0x04
};
if (code >= 0x01 && code <= 0x04)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string indicating which memory operation generated the error.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The operation generated the error.
/// </returns>
internal static string GetErrorOperation(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"Read",
"Write",
"Partial write" // 0x05
};
if (code >= 0x01 && code <= 0x05)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor/ThreadEnabled.md
# DmiProperty.Processor.ThreadEnabled property
Gets a value representing the key to retrieve the property value.
Number of enabled threads per processor.
* If the value is unknown, the field is set to 0000h.
* If the value is valid, the field contains the thread enabled counts 1 to 65534, respectively
* If the value is reserved, the field is set to ffffh
* Unit: None
Key Composition
* Structure: Processor
* Property: ThreadEnabled
* Unit: None
Return Value
Type: UInt16
Remarks
3.6+
```csharp
public static IPropertyKey ThreadEnabled { get; }
```
## See Also
* class [Processor](../DmiProperty.Processor.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType039 [System Power Supply].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the System Power Supply (Type 39) structure.<br/>
/// For more information, please see <see cref="SmbiosType039"/>.
/// </summary>
internal sealed class DmiType039 : DmiBaseType<SmbiosType039>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType039"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType039(SmbiosType039 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
properties.Add(DmiProperty.SystemPowerSupply.IsRedundant, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemPowerSupply.IsRedundant));
properties.Add(DmiProperty.SystemPowerSupply.Location, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemPowerSupply.Location));
properties.Add(DmiProperty.SystemPowerSupply.DeviceName, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemPowerSupply.DeviceName));
properties.Add(DmiProperty.SystemPowerSupply.Manufacturer, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemPowerSupply.Manufacturer));
properties.Add(DmiProperty.SystemPowerSupply.SerialNumber, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemPowerSupply.SerialNumber));
properties.Add(DmiProperty.SystemPowerSupply.AssetTagNumber, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemPowerSupply.AssetTagNumber));
properties.Add(DmiProperty.SystemPowerSupply.ModelPartNumber, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemPowerSupply.ModelPartNumber));
properties.Add(DmiProperty.SystemPowerSupply.RevisionLevel, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemPowerSupply.RevisionLevel));
ushort maxPowerCapacity = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.SystemPowerSupply.MaxPowerCapacity);
if (maxPowerCapacity != 0x8000)
{
properties.Add(DmiProperty.SystemPowerSupply.MaxPowerCapacity, maxPowerCapacity);
}
properties.Add(DmiProperty.SystemPowerSupply.Characteristics.SupplyType, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemPowerSupply.Characteristics.SupplyType));
properties.Add(DmiProperty.SystemPowerSupply.Characteristics.Status, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemPowerSupply.Characteristics.Status));
properties.Add(DmiProperty.SystemPowerSupply.Characteristics.InputVoltageRange, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemPowerSupply.Characteristics.InputVoltageRange));
properties.Add(DmiProperty.SystemPowerSupply.Characteristics.IsPlugged, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemPowerSupply.Characteristics.IsPlugged));
properties.Add(DmiProperty.SystemPowerSupply.Characteristics.IsPresent, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemPowerSupply.Characteristics.IsPresent));
properties.Add(DmiProperty.SystemPowerSupply.Characteristics.IsHotReplaceable, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemPowerSupply.Characteristics.IsHotReplaceable));
if (SmbiosStructure.StructureInfo.Length >= 0x11)
{
ushort inputVoltageProbeHandle = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.SystemPowerSupply.InputVoltageProbeHandle);
if (inputVoltageProbeHandle != 0xffff)
{
properties.Add(DmiProperty.SystemPowerSupply.InputVoltageProbeHandle, inputVoltageProbeHandle);
}
}
if (SmbiosStructure.StructureInfo.Length >= 0x13)
{
ushort coolingDeviceHandle = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.SystemPowerSupply.CoolingDeviceHandle);
if (coolingDeviceHandle != 0xffff)
{
properties.Add(DmiProperty.SystemPowerSupply.CoolingDeviceHandle, coolingDeviceHandle);
}
}
if (SmbiosStructure.StructureInfo.Length >= 0x15)
{
ushort inputCurrentProbeHandle = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.SystemPowerSupply.InputCurrentProbeHandle);
if (inputCurrentProbeHandle != 0xffff)
{
properties.Add(DmiProperty.SystemPowerSupply.InputCurrentProbeHandle, inputCurrentProbeHandle);
}
}
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Extensions/QueryPropertyCollectionResultExtensions.cs
using System.Collections.Generic;
using System.Linq;
using iTin.Core.ComponentModel;
using iTin.Core.Hardware.Common;
using iTin.Core.Hardware.Common.ComponentModel;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Static class than contains extension methods for types <see cref="QueryPropertyCollectionResult"/>.
/// </summary>
public static class QueryPropertyCollectionResultExtensions
{
/// <summary>
/// Converts a <see cref="QueryPropertyCollectionResult"/> instance into a new <see cref="QueryPropertyDictionaryResult"/> instance.
/// </summary>
/// <param name="result">Property collection to convert.</param>
/// <returns>
/// A new <see cref="QueryPropertyDictionaryResult"/> instance from <see cref="QueryPropertyCollectionResult"/>.
/// </returns>
public static QueryPropertyDictionaryResult AsDictionaryResult(this QueryPropertyCollectionResult result)
{
var propertyTable = new PropertyItemDictionary();
if (!result.Success)
{
return QueryPropertyDictionaryResult.CreateErroResult((IResultError[])result.Errors.ToArray().Clone());
}
int index = 0;
IEnumerable<PropertyItem> items = result.Result.ToList();
foreach (var item in items)
{
propertyTable.Add(index, item);
index++;
}
return QueryPropertyDictionaryResult.CreateSuccessResult(propertyTable);
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BitMemoryError64/DeviceErrorAddress.md
# DmiProperty.BitMemoryError64.DeviceErrorAddress property
Gets a value representing the key to retrieve the property value.
32-bit physical address of the error relative to the start of the failing memory device, in bytes
Key Composition
* Structure: BitMemoryError64
* Property: DeviceErrorAddress
* Unit: Bytes
Return Value
Type: UInt64
```csharp
public static IPropertyKey DeviceErrorAddress { get; }
```
## See Also
* class [BitMemoryError64](../DmiProperty.BitMemoryError64.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType023 [System Reset].cs
using System.Diagnostics;
using iTin.Core;
using iTin.Core.Helpers.Enumerations;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 023: System Reset.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 23 System Reset |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE 0Dh Length of the structure. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies The handle, or instance number, associated with the |
// | structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Capabilities BYTE Bit Field Identifies the system-reset capabilities for the |
// | system. |
// | |
// | Bits 07:06 - Reserved for future assignment by this |
// | specification; set to 00b. |
// | |
// | Bit 05 - System contains a watchdog timer. |
// | 0b - False |
// | 1b - True |
// | Note: See WatchdogTimer |
// | |
// | Bits 04:03 - Boot Option on Limit. |
// | Identifies one of the following system |
// | actions to be taken when the Reset Limit |
// | is reached: |
// | 00b - Reserved, do not use |
// | 01b - Operating system |
// | 10b - System utilities |
// | 11b - Do not reboot |
// | Note: See GetBootOption(byte) |
// | |
// | Bits 02:01 - Boot Option. |
// | Indicates one of the following actions |
// | to be taken after a watchdog reset: |
// | 00b - Reserved, do not use |
// | 01b - Operating system |
// | 10b - System utilities |
// | 11b - Do not reboot |
// | Note: See GetBootOption(byte) |
// | |
// | Bit 00 - Status. |
// | Identifies whether (1) or not (0) the |
// | system reset is enabled by the user. |
// | Note: See Status |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Reset Count WORD Varies The number of automatic system resets since the last |
// | intentional reset. |
// | A value of 0FFFFh indicates unknown. |
// | Note: See ResetCount |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h Reset Limit WORD Varies The number of consecutive times the system reset is |
// | attempted. |
// | A value of 0FFFFh indicates unknown. |
// | Note: See ResetLimit |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 09h Timer Interval WORD Varies The number of minutes to use for the watchdog timer. |
// | If the timer is not reset within this interval, the |
// | system reset timeout begins. |
// | A value of 0FFFFh indicates unknown. |
// | Note: See TimerInterval |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Bh Timeout WORD Varies Identifies the number of minutes before the reboot is |
// | initiated. |
// | It is used after a system power cycle, system reset |
// | (local or remote), and automatic system reset. |
// | A value of 0FFFFh indicates unknown. |
// | Note: See TimeOut |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the System Reset (Type 23) structure.
/// </summary>
internal sealed class SmbiosType023 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType023"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType023(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Capabilities</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Capabilities => Reader.GetByte(0x04);
/// <summary>
/// Gets a value representing the <b>Status</b> capability of the <b>Capabilities</b> field
/// </summary>
/// <value>
/// Capability value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Status => Capabilities.CheckBit(Bits.Bit00) ? "Enabled" : "Disabled";
/// <summary>
/// Gets a value representing the <b>Boot Option</b> capability of the <b>Capabilities</b> field
/// </summary>
/// <value>
/// Capability value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte BootOption => (byte) ((Capabilities >> 1) & 0x03);
/// <summary>
/// Gets a value representing the <b>Boot Option On Limit</b> capability of the <b>Capabilities</b> field
/// </summary>
/// <value>
/// Capability value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte BootOptionOnLimit => (byte) ((Capabilities >> 3) & 0x03);
/// <summary>
/// Gets a value representing the <b>Watchdog Timer</b> capability of the <b>Capabilities</b> field
/// </summary>
/// <value>
/// Capability value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool WatchdogTimer => Capabilities.CheckBit(Bits.Bit05);
/// <summary>
/// Gets a value representing the <b>Reset Count</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ResetCount => (ushort) Reader.GetWord(0x05);
/// <summary>
/// Gets a value representing the <b>Reset Limit</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ResetLimit => (ushort)Reader.GetWord(0x07);
/// <summary>
/// Gets a value representing the <b>Timer Interval</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort TimerInterval => (ushort)Reader.GetWord(0x09);
/// <summary>
/// Gets a value representing the <b>Time Out</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort TimeOut => (ushort)Reader.GetWord(0x09);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.Latest)
{
return;
}
properties.Add(SmbiosProperty.SystemReset.ResetCount, ResetCount);
properties.Add(SmbiosProperty.SystemReset.ResetLimit, ResetLimit);
properties.Add(SmbiosProperty.SystemReset.TimerInterval, TimerInterval);
properties.Add(SmbiosProperty.SystemReset.Timeout, TimeOut);
properties.Add(SmbiosProperty.SystemReset.Capabilities.Status, Status);
properties.Add(SmbiosProperty.SystemReset.Capabilities.BootOption, GetBootOption(BootOption));
properties.Add(SmbiosProperty.SystemReset.Capabilities.BootOptionOnLimit, GetBootOption(BootOptionOnLimit));
properties.Add(SmbiosProperty.SystemReset.Capabilities.WatchdogTimer, WatchdogTimer);
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets a string representing the boot option.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// Boot option.
/// </returns>
private static string GetBootOption(byte code)
{
string[] value =
{
"Reserved", // 0x00
"Operating System",
"System Utilities",
"Do Not Reboot" // 0x03
};
return value[code];
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BaseBoard.Features.md
# DmiProperty.BaseBoard.Features class
Contains the key definition for the Features section.
```csharp
public static class Features
```
## Public Members
| name | description |
| --- | --- |
| static [IsHostingBoard](DmiProperty.BaseBoard.Features/IsHostingBoard.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [IsHotSwappable](DmiProperty.BaseBoard.Features/IsHotSwappable.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [IsRemovable](DmiProperty.BaseBoard.Features/IsRemovable.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [IsReplaceable](DmiProperty.BaseBoard.Features/IsReplaceable.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [RequiredDaughterBoard](DmiProperty.BaseBoard.Features/RequiredDaughterBoard.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [BaseBoard](./DmiProperty.BaseBoard.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.AdditionalInformation.Entry/Value.md
# DmiProperty.AdditionalInformation.Entry.Value property
Gets a value representing the key to retrieve the property value.
Enumerated value or updated field content that has not yet been approved for publication in this specification and therefore could not be used in the field referenced by referenced offset.
Key Composition
* Structure: AdditionalInformation
* Property: Value
* Unit: None
Return Value
Type: Byte
```csharp
public static IPropertyKey Value { get; }
```
## See Also
* class [Entry](../DmiProperty.AdditionalInformation.Entry.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.ElectricalCurrentProbe.md
# DmiProperty.ElectricalCurrentProbe class
Contains the key definitions available for a type 029 [ElectricalCurrentProbe] structure.
```csharp
public static class ElectricalCurrentProbe
```
## Public Members
| name | description |
| --- | --- |
| static [Accuracy](DmiProperty.ElectricalCurrentProbe/Accuracy.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Description](DmiProperty.ElectricalCurrentProbe/Description.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MaximumValue](DmiProperty.ElectricalCurrentProbe/MaximumValue.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MinimumValue](DmiProperty.ElectricalCurrentProbe/MinimumValue.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [NominalValue](DmiProperty.ElectricalCurrentProbe/NominalValue.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [OemDefined](DmiProperty.ElectricalCurrentProbe/OemDefined.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Resolution](DmiProperty.ElectricalCurrentProbe/Resolution.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Tolerance](DmiProperty.ElectricalCurrentProbe/Tolerance.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static class [LocationAndStatus](DmiProperty.ElectricalCurrentProbe.LocationAndStatus.md) | Contains the key definition for the Location And Status section. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.IpmiDevice/BaseAddress.md
# DmiProperty.IpmiDevice.BaseAddress property
Gets a value representing the key to retrieve the property value.
Base address (either memory-mapped or I/O) of the BMC. If the least-significant bit of the field is a 1, the address is in I/O space; otherwise, the address is memory-mapped.
Key Composition
* Structure: IpmiDevice
* Property: BaseAddress
* Unit: None
Return Value
Type: UInt64
```csharp
public static IPropertyKey BaseAddress { get; }
```
## See Also
* class [IpmiDevice](../DmiProperty.IpmiDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiChassisContainedElementCollection/ToString.md
# DmiChassisContainedElementCollection.ToString method
Returns a class String that represents the current object.
```csharp
public override string ToString()
```
## Return Value
Object String that represents the current ChassisContainedElementCollection class.
## Remarks
This method returns a string that includes the number of available elements.
## See Also
* class [DmiChassisContainedElementCollection](../DmiChassisContainedElementCollection.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.CoolingDevice.DeviceTypeAndStatus/DeviceType.md
# DmiProperty.CoolingDevice.DeviceTypeAndStatus.DeviceType property
Gets a value representing the key to retrieve the property value.
Cooling device type.
Key Composition
* Structure: CoolingDevice
* Property: DeviceType
* Unit: None
Return Value
Type: String
Remarks
2.2+
```csharp
public static IPropertyKey DeviceType { get; }
```
## See Also
* class [DeviceTypeAndStatus](../DmiProperty.CoolingDevice.DeviceTypeAndStatus.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType016 [Physical Memory Array].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Physical Memory Array (Type 16) structure.<br/>
/// For more information, please see <see cref="SmbiosType016"/>.
/// </summary>
internal sealed class DmiType016 : DmiBaseType<SmbiosType016>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType016"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType016(SmbiosType016 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion < DmiStructureVersion.v21)
{
return;
}
properties.Add(DmiProperty.PhysicalMemoryArray.Location, SmbiosStructure.GetPropertyValue(SmbiosProperty.PhysicalMemoryArray.Location));
properties.Add(DmiProperty.PhysicalMemoryArray.Use, SmbiosStructure.GetPropertyValue(SmbiosProperty.PhysicalMemoryArray.Use));
properties.Add(DmiProperty.PhysicalMemoryArray.MemoryErrorCorrection, SmbiosStructure.GetPropertyValue(SmbiosProperty.PhysicalMemoryArray.MemoryErrorCorrection));
properties.Add(DmiProperty.PhysicalMemoryArray.MemoryErrorInformationHandle, SmbiosStructure.GetPropertyValue(SmbiosProperty.PhysicalMemoryArray.MemoryErrorInformationHandle));
properties.Add(DmiProperty.PhysicalMemoryArray.NumberOfMemoryDevices, SmbiosStructure.GetPropertyValue(SmbiosProperty.PhysicalMemoryArray.NumberOfMemoryDevices));
uint maximumCapacity = SmbiosStructure.GetPropertyValue<uint>(SmbiosProperty.PhysicalMemoryArray.MaximumCapacity);
if (maximumCapacity != 0x08000000)
{
properties.Add(DmiProperty.PhysicalMemoryArray.MaximumCapacity, maximumCapacity);
}
else
{
if (ImplementedVersion >= DmiStructureVersion.v27)
{
properties.Add(DmiProperty.PhysicalMemoryArray.MaximumCapacity, SmbiosStructure.GetPropertyValue(SmbiosProperty.PhysicalMemoryArray.ExtendedMaximumCapacity));
}
}
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/Base/DmiBaseType.cs
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using iTin.Core.Hardware.Common;
using iTin.Core.Helpers;
using iTin.Hardware.Specification.Smbios;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// The <b>DmiBaseType</b> class provides functions to analyze the properties associated with a structure <see cref="DMI"/>.
/// </summary>
/// <typeparam name="TSmbios">Smbios strucutre type</typeparam>
public abstract class DmiBaseType<TSmbios> : IDmiType
{
#region private members
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private DmiClassPropertiesTable _smbiosPropertiesTable;
#endregion
#region constructor/s
/// <summary>
/// Initializes a new instance of the class <see cref="SmbiosBaseType"/> by specifying the Header of the structure and current
/// </summary>
/// <param name="smbiosStructure">Header of the current structure.</param>
/// <param name="smbiosVersion">Current SMBIOS version.</param>
protected DmiBaseType(TSmbios smbiosStructure, int smbiosVersion)
{
SmbiosVersion = smbiosVersion;
SmbiosStructure = smbiosStructure;
}
#endregion
#region interfaces
#region IDmiType
#region explicit
/// <inheritdoc />
/// <summary>
/// Gets the properties available for this structure.
/// </summary>
/// <returns>
/// Availables properties.
/// </returns>
DmiClassPropertiesTable IDmiType.Properties => Properties;
#endregion
#region public readonly properties
/// <inheritdoc/>
public IEnumerable<IPropertyKey> ImplementedProperties => Properties.Keys;
/// <summary>
/// Returns a value that indicates the implemented version of this <see cref="DMI"/> structure.
/// </summary>
/// <returns>
/// One of the values of the <see cref="DmiStructureVersion"/> enumeration.
/// </returns>
public DmiStructureVersion ImplementedVersion => (DmiStructureVersion)(SmbiosStructure as SmbiosBaseType).StructureInfo.StructureVersion;
#endregion
#region public methods
/// <summary>
/// Returns the value of specified property. Always returns the first appearance of the property.
/// </summary>
/// <param name="propertyKey">Key to the property to obtain</param>
/// <returns>
/// <para>
/// A <see cref="QueryPropertyResult"/> reference that contains the result of the operation, to check if the operation is correct, the <b>Success</b>
/// property will be <b>true</b> and the <b>Value</b> property will contain the value; Otherwise, the the <b>Success</b> property
/// will be false and the <b>Errors</b> property will contain the errors associated with the operation, if they have been filled in.
/// </para>
/// <para>
/// The type of the <b>Value</b> property is <see cref="PropertyItem"/>. Contains the result of the operation.
/// </para>
/// <para>
/// </para>
/// </returns>
public QueryPropertyResult GetProperty(IPropertyKey propertyKey)
{
PropertyItem candidate = Properties.FirstOrDefault(property => property.Key.Equals(propertyKey));
return candidate == null
? QueryPropertyResult.CreateErroResult("Can not found specified property key")
: QueryPropertyResult.CreateSuccessResult(candidate);
}
#endregion
#endregion
#endregion
#region internal readonly properties
/// <summary>
/// Gets the properties available for this structure.
/// </summary>
/// <value>
/// Availables properties.
/// </value>
internal DmiClassPropertiesTable Properties
{
get
{
if (_smbiosPropertiesTable != null)
{
return _smbiosPropertiesTable;
}
_smbiosPropertiesTable = new DmiClassPropertiesTable();
Parse(_smbiosPropertiesTable);
return _smbiosPropertiesTable;
}
}
#endregion
#region protected readonly properties
/// <summary>
/// Gets the current version of <see cref="SMBIOS"/>.
/// </summary>
/// <value>
/// Value representing the current version of <see cref="SMBIOS"/>.
/// </value>
protected int SmbiosVersion { get; }
/// <summary>
/// Gets a reference to smbios structure.
/// </summary>
/// <value>
/// A reference to smbios structure.
/// </value>
protected TSmbios SmbiosStructure { get; }
#endregion
#region public methods
/// <summary>
/// Returns a reference to the underlying smbios structure for this dmi type.
/// </summary>
/// <returns>
/// Reference to the object that represents the strongly typed value of the property. Always returns the first appearance of the property.
/// </returns>
public TSmbios GetUnderlyingSmbiosStructure() => SmbiosStructure;
#endregion
#region public override methods
/// <summary>
/// Returns a <see cref="string"/> that represents this instance.
/// </summary>
/// <returns>
/// A <see cref="string"/> that represents this instance.
/// </returns>
public override string ToString() => $"Type = {GetType().Name}";
#endregion
#region protected methods
/// <summary>
/// Parse and populates the property collection for this structure.
/// </summary>
/// <param name="properties">Collection of properties of this structure.</param>
protected void Parse(DmiClassPropertiesTable properties)
{
SentinelHelper.ArgumentNull(properties, nameof(properties));
PopulateProperties(properties);
}
#endregion
#region protected virtual methods
/// <summary>
/// Populates the property collection for this structure.
/// </summary>
/// <param name="properties">Collection of properties of this structure.</param>
protected virtual void PopulateProperties(DmiClassPropertiesTable properties)
{
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PortConnector/ExternalReferenceDesignator.md
# DmiProperty.PortConnector.ExternalReferenceDesignator property
Gets a value representing the key to retrieve the property value.
String number for the External Reference Designation external to the system enclosure.
Key Composition
* Structure: PortConnector
* Property: ExternalReferenceDesignator
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey ExternalReferenceDesignator { get; }
```
## See Also
* class [PortConnector](../DmiProperty.PortConnector.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Specific/ChassisContainedElement.cs
using System.Diagnostics;
using iTin.Core.Helpers;
using iTin.Core.Helpers.Enumerations;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 003: System Enclosure or Chassis. Contained Elements
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.3+ Contained BYTE Bit Field Specifies the type of element associated |
// | Element with this record: |
// | Type |
// | Bit(s) Meaning |
// | ————————————————————————————————————————— |
// | 07 Type Select. |
// | 0b - SMBIOS Baseboard Type |
// | enumeration. |
// | |
// | 1b - SMBIOS structure type |
// | enumeration. |
// | |
// | 06:00 Type. |
// | The value specifies either |
// | an SMBIOS Board Type |
// | enumeration or an SMBIOS |
// | structure type, dependent on |
// | the setting of the Type |
// | Select. |
// | |
// | For example, a contained Power Supply is |
// | specified as A7h (1 0100111b) — the MSB is|
// | 1, so the remaining seven bits (27h = 39) |
// | represent an SMBIOS structure type; |
// | structure type 39 represents a System |
// | Power Supply. |
// | A contained Server Blade is specified as |
// | 03h — the MSB is 0, so the remaining seven|
// | bits represent an SMBIOS board type; |
// | board type 03h represents a Server Blade. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.3+ Contained BYTE Varies Specifies the minimum number of the |
// | Element element type that can be installed in the |
// | Minimum chassis for the chassis to |
// | properly operate, in the range 0 to 254. |
// | The value 255 (0FFh) is reserved for |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | |
// | 02h 2.3+ Contained BYTE Varies Specifies the maximum number of the |
// | Element element type that can be installed in the |
// | Maximum chassis, in the range 1 to 255. |
// | The value 0 is reserved for future |
// | definition by this specification. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// This class represents an element of the structure <see cref="SmbiosType003"/>.
/// </summary>
public class ChassisContainedElement : SpecificSmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initialize a new instance of the class <see cref="ChassisContainedElement"/> specifying the structure information.
/// </summary>
/// <param name="chassisContainedElementsArray">Untreated information of the current structure.</param>
internal ChassisContainedElement(byte[] chassisContainedElementsArray) : base(chassisContainedElementsArray)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value that represents the '<b>Type</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string ItemType
{
get
{
var ret = string.Empty;
var targetByte = GetByte(0x00);
switch (TypeSelect)
{
case ChassisContainedElementType.BaseBoardEnumeration:
ret = GetBoardType(targetByte);
break;
case ChassisContainedElementType.SmbiosStructure:
int type = targetByte & 0x7f;
ret = ((SmbiosStructure)type).ToString();
break;
}
return ret;
}
}
/// <summary>
/// Gets a value that represents the '<b>Contained Element Maximum</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Max => GetByte(0x01);
/// <summary>
/// Gets a value that represents the '<b>Contained Element Minimun</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Min => GetByte(0x02);
/// <summary>
/// Gets a value that represents the '<b>TypeSelect</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ChassisContainedElementType TypeSelect => (ChassisContainedElementType)LogicHelper.GetBit(GetByte(0x00), Bits.Bit07);
#endregion
#region public override methods
/// <summary>
/// Returns a class <see cref="string"/> that represents the current object.
/// </summary>
/// <returns>
/// Object <see cref="string"/> that represents the current <see cref="AdditionalInformationEntry"/> class.
/// </returns>
/// <remarks>
/// This method returns a string that includes the property <see cref="TypeSelect"/> and
/// <see cref="ItemType"/>.
/// </remarks>
public override string ToString() => $"Select = {TypeSelect}, Type = {ItemType}";
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
properties.Add(SmbiosProperty.Chassis.Elements.Min, Min);
properties.Add(SmbiosProperty.Chassis.Elements.Max, Max);
properties.Add(SmbiosProperty.Chassis.Elements.TypeSelect, TypeSelect);
properties.Add(SmbiosProperty.Chassis.Elements.ItemType, ItemType);
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Obtiene una cadena que permite identificar el tipo de placa base.
/// </summary>
/// <param name="code">Valor a analizar.</param>
/// <returns>Tipo de placa base.</returns>
private static string GetBoardType(byte code)
{
string[] value =
{
"Unknown", // 0x01
"Other",
"Server Blade",
"Connectivity Switch",
"System Management Module",
"Processor Module",
"I/O Module",
"Memory Module",
"Daughter Board",
"Motherboard",
"Processor+Memory Module",
"Processor+I/O Module",
"Interconnect Board" // 0x0D
};
if (code >= 0x01 && code <= 0x0D)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/MemoryDeviceMappedAddressInterleavedPosition.md
# MemoryDeviceMappedAddressInterleavedPosition enumeration
Defines the type of interpolation of a device.
```csharp
public enum MemoryDeviceMappedAddressInterleavedPosition
```
## Values
| name | value | description |
| --- | --- | --- |
| NonInterleaved | `0` | Not interpolated |
| FirstInterleavePosition | `1` | First interpolated position |
| SecondInterleavePosition | `2` | Second interpolated position. |
| Unknown | `255` | Unknown |
## See Also
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PortableBattery/DeviceName.md
# DmiProperty.PortableBattery.DeviceName property
Gets a value representing the key to retrieve the property value.
Battery name.
Key Composition
* Structure: PortableBattery
* Property: DeviceName
* Unit: None
Return Value
Type: String
Remarks
2.1+
```csharp
public static IPropertyKey DeviceName { get; }
```
## See Also
* class [PortableBattery](../DmiProperty.PortableBattery.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType022 [Portable Battery].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Portable Battery (Type 22) structure.<br/>
/// For more information, please see <see cref="SmbiosType022"/>.
/// </summary>
internal sealed class DmiType022 : DmiBaseType<SmbiosType022>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType022"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType022(SmbiosType022 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion >= DmiStructureVersion.v21)
{
properties.Add(DmiProperty.PortableBattery.Location, SmbiosStructure.GetPropertyValue(SmbiosProperty.PortableBattery.Location));
properties.Add(DmiProperty.PortableBattery.Manufacturer, SmbiosStructure.GetPropertyValue(SmbiosProperty.PortableBattery.Manufacturer));
properties.Add(DmiProperty.PortableBattery.DeviceName, SmbiosStructure.GetPropertyValue(SmbiosProperty.PortableBattery.DeviceName));
ushort designVoltage = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.PortableBattery.DesignVoltage);
if (designVoltage != 0x0000)
{
properties.Add(DmiProperty.PortableBattery.DesignVoltage, designVoltage);
}
properties.Add(DmiProperty.PortableBattery.SBDSVersionNumber, SmbiosStructure.GetPropertyValue(SmbiosProperty.PortableBattery.SBDSVersionNumber));
byte maximumErrorInBatteryData = SmbiosStructure.GetPropertyValue<byte>(SmbiosProperty.PortableBattery.MaximunErrorInBatteryData);
if (maximumErrorInBatteryData != 0xff)
{
properties.Add(DmiProperty.PortableBattery.MaximunErrorInBatteryData, maximumErrorInBatteryData);
}
properties.Add(DmiProperty.PortableBattery.ManufactureDate, SmbiosStructure.GetPropertyValue(SmbiosProperty.PortableBattery.ManufactureDate));
properties.Add(DmiProperty.PortableBattery.SerialNumber, SmbiosStructure.GetPropertyValue(SmbiosProperty.PortableBattery.SerialNumber));
properties.Add(DmiProperty.PortableBattery.DeviceChemistry, SmbiosStructure.GetPropertyValue(SmbiosProperty.PortableBattery.DeviceChemistry));
properties.Add(DmiProperty.PortableBattery.DesignCapacity, SmbiosStructure.GetPropertyValue(SmbiosProperty.PortableBattery.DesignCapacity));
properties.Add(DmiProperty.PortableBattery.DesignCapacityMultiplier, SmbiosStructure.GetPropertyValue(SmbiosProperty.PortableBattery.DesignCapacityMultiplier));
}
if (SmbiosStructure.StructureInfo.Length >= 0x17)
{
properties.Add(DmiProperty.PortableBattery.OemSpecific, SmbiosStructure.GetPropertyValue(SmbiosProperty.PortableBattery.OemSpecific));
}
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.OnBoardDevices/Enabled.md
# DmiProperty.OnBoardDevices.Enabled property
Gets a value representing the key to retrieve the property value.
Device status.
Key Composition
* Structure: OnBoardDevices
* Property: Enabled
* Unit: None
Return Value
Type: Boolean
```csharp
public static IPropertyKey Enabled { get; }
```
## See Also
* class [OnBoardDevices](../DmiProperty.OnBoardDevices.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/Specific/DmiManagementControllerHostInterfaceProtocolRecord.cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// This class represents an element of the structure <see cref="DmiType042"/>.
/// </summary>
public class DmiManagementControllerHostInterfaceProtocolRecord
{
#region private members
private readonly SmbiosPropertiesTable _reference;
#endregion
#region constructor/s
/// <summary>
/// Initialize a new instance of the class <see cref="DmiManagementControllerHostInterfaceProtocolRecord"/>.
/// </summary>
/// <param name="reference"><b>SMBIOS</b> properties.</param>
internal DmiManagementControllerHostInterfaceProtocolRecord(SmbiosPropertiesTable reference)
{
_reference = reference;
}
#endregion
#region public properties
/// <summary>
/// Gets the properties available for this structure.
/// </summary>
/// <value>
/// Availables properties.
/// </value>
public DmiClassPropertiesTable Properties =>
new()
{
{DmiProperty.ManagementControllerHostInterface.Protocol.ProtocolType, _reference[SmbiosProperty.ManagementControllerHostInterface.Protocol.ProtocolType]},
{DmiProperty.ManagementControllerHostInterface.Protocol.ProtocolTypeSpecificData, _reference[SmbiosProperty.ManagementControllerHostInterface.Protocol.ProtocolTypeSpecificData]}
};
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemEventLog/DataStartOffset.md
# DmiProperty.SystemEventLog.DataStartOffset property
Gets a value representing the key to retrieve the property value.
Defines the starting offset (or index) within the nonvolatile storage of the event-log’s first data byte, from the Access Method Address
Key Composition
* Structure: SystemEventLog
* Property: DataStartOffset
* Unit: None
Return Value
Type: Int32
```csharp
public static IPropertyKey DataStartOffset { get; }
```
## See Also
* class [SystemEventLog](../DmiProperty.SystemEventLog.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/SpecificDmiBaseType/GetBytes.md
# SpecificDmiBaseType.GetBytes method
Returns the stored array from start with specified lenght.
```csharp
protected byte[] GetBytes(byte start, byte lenght)
```
| parameter | description |
| --- | --- |
| start | start byte |
| lenght | lenght |
## Return Value
The array value stored.
## See Also
* class [SpecificDmiBaseType](../SpecificDmiBaseType.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/PMIC0ManufacturerId.md
# DmiProperty.MemoryDevice.PMIC0ManufacturerId property
Gets a value representing the key to retrieve the property.
The PMIC0 Manufacturer ID indicates the manufacturer of the PMIC0 on memory device. This field shall be set to the value of the SPD PMIC 0 Manufacturer ID Code. A value of 0000h indicates the PMIC0 Manufacturer ID is unknown.
Key Composition
* Structure: MemoryDevice
* Property: PMIC0ManufacturerId
* Unit: None
Return Value
Type: UInt16
Remarks
3.7+
```csharp
public static IPropertyKey PMIC0ManufacturerId { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/SmbiosStructureCollection.cs
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
namespace iTin.Hardware.Specification.Smbios;
/// <summary>
/// Represents a read-only collection of objects <see cref="SmbiosBaseType"/>.
/// </summary>
public sealed class SmbiosStructureCollection : ReadOnlyCollection<SmbiosBaseType>
{
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosStructureCollection"/> class.
/// </summary>
/// <param name="selectedStructure">The selected structure.</param>
internal SmbiosStructureCollection(IEnumerable<SmbiosBaseType> selectedStructure) : base(selectedStructure.ToList())
{
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType016 [Physical Memory Array].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 016: Physical Memory Array.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.1+ Type BYTE 16 Physical Memory Array type |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.1+ Length BYTE 0Fh Length of the structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 2.1+ Handle WORD Varies The handle, or instance number, associated|
// | with the structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 2.1+ Location BYTE ENUM The physical location of the Memory Array,|
// | whether on the system board or an add-in |
// | board. |
// | Note: See GetLocation(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h 2.1+ Use BYTE ENUM The function for which the array is used. |
// | whether on the system board or an add-in |
// | Note: Ver GetUse(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h 2.1+ Memory Error BYTE ENUM The primary hardware error correction or |
// | Correction detection method supported by this memory |
// | array. |
// | Note: See GetErrorCorrectionTypes(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h 2.1+ Maximum DWORD Varies The maximum memory capacity, in kilobytes,|
// | Capacity for this array. |
// | If the capacity is not represented in this|
// | field, then this field contains 8000 0000h|
// | and the Extended Maximum Capacity field |
// | should be used. Values 2 TB (8000 0000h) |
// | or greater must be represented in the |
// | Extended Maximum Capacity field. |
// | Note: See MaximumCapacity(uint) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Bh 2.1+ Memory Error WORD Varies The handle, or instance number, associated|
// | Information with any error that was previously |
// | Handle detected for the array. |
// | If the system does not provide the error |
// | information structure, the field contains |
// | FFFEh; otherwise, the field contains |
// | either FFFFh (if no error was detected) or|
// | the handle of the errorinformation |
// | structure |
// | Note: See GetErrorHandle(int) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Dh 2.1+ Number of WORD Varies The number of slots or sockets available |
// | Memory for Memory Devices in this array. |
// | Devices This value represents the number of Memory|
// | Device structures that comprise this |
// | Memory Array. |
// | Each Memory Device has a reference to the |
// | “owning” Memory Array. |
// | Note: See NumberOfMemoryDevices |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Fh 2.7+ Extended QWORD Varies The maximum memory capacity, in bytes, |
// | Maximum for this array. |
// | Capacity This field is only valid when the Maximum |
// | Capacity field contains 8000 0000h. |
// | When Maximum Capacity contains a value |
// | that is not 8000 0000h, Extended Maximum |
// | Capacity must contain zeros. |
// | Note: See ExtendedMaximumCapacity |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Physical Memory Array (Type 16) structure.
/// </summary>
internal sealed class SmbiosType016 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType016"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType016(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
#region Version 2.1+ fields
/// <summary>
/// Gets a value representing the <b>Location</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Location => Reader.GetByte(0x04);
/// <summary>
/// Gets a value representing the <b>Use</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Use => Reader.GetByte(0x05);
/// <summary>
/// Gets a value representing the <b>Error Correction</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ErrorCorrection => StructureInfo.RawData[0x06];
/// <summary>
/// Gets a value representing the <b>Maximum Capacity</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint MaximumCapacity => (uint)Reader.GetDoubleWord(0x07);
/// <summary>
/// Gets a value representing the <b>Maximum Capacity</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ErrorInformationHandle => (ushort)Reader.GetWord(0x0b);
/// <summary>
/// Gets a value representing the <b>Number Of Memory Devices</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort NumberOfMemoryDevices => (ushort)Reader.GetWord(0x0d);
#endregion
#region Version 2.7+ fields
/// <summary>
/// Gets a value representing the <b>Extended Maximum Capacity</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ulong ExtendedMaximumCapacity => (ulong)Reader.GetQuadrupleWord(0x0f);
#endregion
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v21)
{
properties.Add(SmbiosProperty.PhysicalMemoryArray.Location, GetLocation(Location));
properties.Add(SmbiosProperty.PhysicalMemoryArray.Use, GetUse(Use));
properties.Add(SmbiosProperty.PhysicalMemoryArray.MemoryErrorCorrection, GetErrorCorrectionTypes(ErrorCorrection));
properties.Add(SmbiosProperty.PhysicalMemoryArray.MaximumCapacity, MaximumCapacity);
properties.Add(SmbiosProperty.PhysicalMemoryArray.MemoryErrorInformationHandle, GetErrorHandle(ErrorInformationHandle));
properties.Add(SmbiosProperty.PhysicalMemoryArray.NumberOfMemoryDevices, NumberOfMemoryDevices);
}
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v27)
{
properties.Add(SmbiosProperty.PhysicalMemoryArray.ExtendedMaximumCapacity, ExtendedMaximumCapacity);
}
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets a string indicating the location of the array.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// Matrix location
/// </returns>
private static string GetLocation(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"System board or motherboard",
"ISA add-on-cardS",
"EISA Add-on Card",
"PCI Add-on Card",
"MCA Add-on Card",
"PCMCIA Add-on Card",
"Proprietary Add-on Card",
"NuBus" // 0x0A
};
string[] value2 =
{
"PC-98/C20 Add-on Card", // 0xA0
"PC-98/C24 Add-on Card",
"PC-98/E Add-on Card",
"PC-98/Local Bus Add-on Card" // 0xA3
};
if (code >= 0x01 && code <= 0x0A)
{
return value[code - 0x01];
}
if (code >= 0xA0 && code <= 0xA3)
{
return value2[code - 0xA0];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string indicating the use of the array.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// Using the Matrix.
/// </returns>
private static string GetUse(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"System memory",
"Video memory",
"Flash memory",
"Non-volatile RAM",
"Cache memory",
"PCMCIA Add-on Card" // 0x08
};
if (code >= 0x01 && code <= 0x08)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string indicating the type of error correction.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The type of error correction.
/// </returns>
private static string GetErrorCorrectionTypes(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"None",
"Parity",
"Single-bit ECC",
"Multi-bit ECC",
"CRC" // 0x07
};
if (code >= 0x01 && code <= 0x07)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string representing the error handler.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The error handler.
/// </returns>
private static string GetErrorHandle(int code)
{
if (code == 0xFFFE)
{
return "Not Provided";
}
if (code == 0xFFFF)
{
return "No Error";
}
return $"{code:X}";
}
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType044 [Processor Additional Information].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 044: Processor Additional Information.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 44 Processor Additional Information |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE 6 + Y Length of the structure. Y is the length of Processor |
// | specific Block specified at offset 06h. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies Handle, or instance number, associated with the |
// | structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Referenced WORD Varies Handle, or instance number, associated with the |
// | Handle Processor structure (SMBIOS type 4) which the |
// | Processor Additional Information structure describes. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h Processor Varies Varies Processor-specific block. |
// | Specific (Y) |
// | Block |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Processor Additional Information (Type 44) structure.
/// </summary>
internal sealed class SmbiosType044 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType044"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType044(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private readonly properties
/// <summary>
/// Gets a value representing the <b>Length</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Length => Reader.GetByte(0x01);
/// <summary>
/// Gets a value representing the <b>Referenced Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ReferencedHandle => (ushort)Reader.GetWord(0x04);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
properties.Add(SmbiosProperty.ProcessorAdditionalInformation.ReferencedHandle, ReferencedHandle);
#if NETSTANDARD2_1 || NET5_0_OR_GREATER
properties.Add(SmbiosProperty.ProcessorAdditionalInformation.ProcessorSpecificBlock, new ProcessorSpecificInformationBlock(Reader.GetBytes(0x06, (byte)(Length - 6)).ToArray()));
#else
properties.Add(SmbiosProperty.ProcessorAdditionalInformation.ProcessorSpecificBlock, new ProcessorSpecificInformationBlock(Reader.GetBytes(0x06, (byte)(Length - 6))));
#endif
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiStructure/Elements.md
# DmiStructure.Elements property
Gets the collection of available items.
```csharp
public DmiClassCollection Elements { get; }
```
## Property Value
Object [`DmiClassCollection`](../DmiClassCollection.md) that contains the collection of [`DmiClass`](../DmiClass.md) objects available. If there is no object [`DmiClass`](../DmiClass.md), null is returned.
## See Also
* class [DmiClassCollection](../DmiClassCollection.md)
* class [DmiStructure](../DmiStructure.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType041 [Onboard Devices Extended Information].cs
using System.Diagnostics;
using iTin.Core;
using iTin.Core.Helpers.Enumerations;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 041: Onboard Devices Extended Information.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 41 Onboard Devices Extended Information |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE Varies 0Bh for version 2.6 and later |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Reference BYTE STRING String number of the onboard device reference |
// | Designation designation. |
// | Note: See ReferenceDesignation |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Device Type BYTE ENUM Bit 07 – Device Status: |
// | 01b – Device Enabled |
// | 00b – Device Disabled |
// | Note: Ver DeviceStatus |
// | |
// | Bits 06:00 – Type of Device |
// | Note: Ver DeviceType |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h Device Type BYTE Varies Note: See DeviceTypeInstance |
// | Instance |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h Segment Group WORD Varies Note: See SegmentGroupNumber |
// | Number |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 09h Bus Number BYTE Varies Note: See BusNumber |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ah Device/ BYTE Bit Field Bits 07:03 – Device number |
// | Function Note: Ver DeviceNumber |
// | Number |
// | Bits 02:00 – Function number |
// | Note: See FunctionNumber |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Onboard Devices Extended Information (Type 41) structure.
/// </summary>
internal sealed class SmbiosType041 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType041"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType041(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private readonly properties
/// <summary>
/// Gets a value representing the <b>Reference Designation</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string ReferenceDesignation => GetString(0x04);
/// <summary>
/// Gets a value representing the <b>Device Status</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string DeviceStatus => Reader.GetByte(0x05).CheckBit(Bits.Bit07) ? "Enabled" : "Disabled";
/// <summary>
/// Gets a value representing the <b>Device Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte DeviceType => (byte) (Reader.GetByte(0x05) & 0x7f);
/// <summary>
/// Gets a value representing the <b>Device Type Instance</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte DeviceTypeInstance => Reader.GetByte(0x06);
/// <summary>
/// Gets a value representing the <b>Segment Group Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort SegmentGroupNumber => (ushort)Reader.GetWord(0x07);
/// <summary>
/// Gets a value representing the <b>Bus Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte BusNumber => Reader.GetByte(0x09);
/// <summary>
/// Gets a value representing the <b>Device Function</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte DeviceFunction => (byte)(Reader.GetByte(0x0a) & 0x07);
/// <summary>
/// Gets a value representing the <b>Device Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte DeviceNumber => (byte)((Reader.GetByte(0x0a) >> 3) & 0x1f);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.Latest)
{
return;
}
properties.Add(SmbiosProperty.OnBoardDevicesExtended.ReferenceDesignation, ReferenceDesignation);
properties.Add(SmbiosProperty.OnBoardDevicesExtended.Element.DeviceStatus, DeviceStatus);
properties.Add(SmbiosProperty.OnBoardDevicesExtended.Element.DeviceType, GetDeviceType(DeviceType));
}
#endregion
#region BIOS Specification 3.5.0 (15/09/2021)
/// <summary>
/// Gets a string representing the device type.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The device type..
/// </returns>
private static string GetDeviceType(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"Video",
"SCSI Controller",
"Ethernet",
"Token Ring",
"Sound",
"PATA Controller",
"SATA Controller",
"SAS Controller",
"Wireless LAN",
"Bluetooth",
"WWAN",
"eMMC (embedded Multi-Media Controller)",
"NVMe Controller",
"UFS Controller" // 0x10
};
if (code >= 0x01 && code <= 0x10)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Chassis/Height.md
# DmiProperty.Chassis.Height property
Gets a value representing the key to retrieve the property value.
Height of the enclosure, in 'U's A U is a standard unit of measure for the height of a rack or rack-mountable component and is equal to 1.75 inches or 4.445 cm.
A value of 00h indicates that the enclosure height is unspecified.
Key Composition
* Structure: SystemEnclosure
* Property: Height
* Unit: U
Return Value
Type: Byte
Remarks
2.3+
```csharp
public static IPropertyKey Height { get; }
```
## See Also
* class [Chassis](../DmiProperty.Chassis.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.EndOfTable/Status.md
# DmiProperty.EndOfTable.Status property
Gets a value representing the key to retrieve the property value.
Indicates end of structures. Always returns the 'End Of Table Structures' string.
Key Composition
* Structure: EndOfTable
* Property: Status
* Unit: None
Return Value
Type: String
Remarks
Any version
```csharp
public static IPropertyKey Status { get; }
```
## See Also
* class [EndOfTable](../DmiProperty.EndOfTable.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/DmiStructureCollection.cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using iTin.Core.Hardware.Common;
using iTin.Core.Helpers;
using iTin.Hardware.Specification.Smbios;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Represents a collection of <see cref="DmiStructure"/> objects implemented in <see cref="DMI"/>.
/// </summary>
public sealed class DmiStructureCollection : ReadOnlyCollection<DmiStructure>
{
#region constructor/s
/// <inheritdoc/>
/// <summary>
/// Initialize a new instance of the <see cref="DmiStructureCollection"/> class.
/// </summary>
/// <param name="context">a <see cref="SMBIOS"/> reference.</param>
internal DmiStructureCollection(SMBIOS context) : base(new List<DmiStructure>())
{
if (context.Version == 0 && context.ImplementedStructures.Count == 0 && context.Lenght == 0)
{
return;
}
foreach (var smbiosStructure in context.ImplementedStructures)
{
Items.Add(new DmiStructure((DmiStructureClass)(int)smbiosStructure, context));
}
}
#endregion
#region public indexers
/// <summary>
/// Gets the element with the specified key.
/// </summary>
/// <Result>
/// Object <see cref="DmiStructure"/> specified by its key.
/// </Result>
/// <remarks>
/// If the element does not exist, <b>null</b> is returned.
/// </remarks>
/// <exception cref="InvalidEnumArgumentException"></exception>
public DmiStructure this[DmiStructureClass resultKey]
{
get
{
bool knownBlockValid = SentinelHelper.IsEnumValid(resultKey, true);
if (!knownBlockValid)
{
throw new InvalidEnumArgumentException(nameof(resultKey), (int)resultKey, typeof(SmbiosStructure));
}
int blockIndex = IndexOf(resultKey);
if (blockIndex != -1)
{
return this[blockIndex];
}
return null;
}
}
#endregion
#region public methods
/// <summary>
/// Determines whether the element with the specified key is in the collection.
/// </summary>
/// <param name="resultKey">One of the Results of <see cref="SmbiosStructure"/> that represents the key of the object <see cref="DmiStructure"/> to search.</param>
/// <returns>
/// <b>true</b> if the object <see cref="DmiStructure"/> with the <paramref name="resultKey"/> is in the collection; otherwise, it is <b>false</b>.
/// </returns>
/// <exception cref="InvalidEnumArgumentException"></exception>
public bool Contains(DmiStructureClass resultKey)
{
bool knownBlockValid = SentinelHelper.IsEnumValid(resultKey, true);
if (!knownBlockValid)
{
throw new InvalidEnumArgumentException(nameof(resultKey), (int)resultKey, typeof(DmiStructureClass));
}
DmiStructure block = Items.FirstOrDefault(item => item.Class == resultKey);
return Items.Contains(block);
}
/// <summary>
/// Returns a Result that contains the result of the operation. Always returns the first appearance of the property
/// </summary>
/// <param name="propertyKey">Key to the property to obtain</param>
/// <returns>
/// <para>
/// A <see cref="QueryPropertyResult"/> reference that contains the result of the operation, to check if the operation is correct, the <b>Success</b>
/// property will be <b>true</b> and the <b>Result</b> property will contain the Result; Otherwise, the the <b>Success</b> property
/// will be false and the <b>Errors</b> property will contain the errors associated with the operation, if they have been filled in.
/// </para>
/// <para>
/// The type of the <b>Result</b> property is <see cref="PropertyItem"/>.
/// </para>
/// <para>
/// </para>
/// </returns>
public QueryPropertyResult GetProperty(IPropertyKey propertyKey)
{
Enum propertyId = propertyKey.StructureId;
DmiStructure structure = this[(DmiStructureClass)propertyId];
object result = structure?.Elements[0].Properties[propertyKey];
if (!(result is List<PropertyItem> itemList))
{
return QueryPropertyResult.CreateErroResult("Can not found specified property key");
}
bool hasItems = itemList.Any();
if (!hasItems)
{
return QueryPropertyResult.CreateErroResult("Can not found specified property key");
}
bool onlyOneItem = itemList.Count == 1;
if (onlyOneItem)
{
return structure.Elements.FirstOrDefault()?.GetProperty(propertyKey);
}
return QueryPropertyResult.CreateErroResult("Can not found specified property key");
}
/// <summary>
/// Returns a Result that contains the result of the operation.
/// </summary>
/// <param name="propertyKey">Key to the property to obtain</param>
/// <returns>
/// <para>
/// A <see cref="QueryPropertyCollectionResult"/> reference that contains the result of the operation, to check if the operation is correct, the <b>Success</b>
/// property will be <b>true</b> and the <b>Result</b> property will contain the Result; Otherwise, the the <b>Success</b> property
/// will be false and the <b>Errors</b> property will contain the errors associated with the operation, if they have been filled in.
/// </para>
/// <para>
/// The type of the <b>Result</b> property is <see cref="IEnumerable{T}"/> where <b>T</b> is <see cref="PropertyItem"/>.
/// </para>
/// <para>
/// </para>
/// </returns>
public QueryPropertyCollectionResult GetProperties(IPropertyKey propertyKey)
{
Enum propertyId = propertyKey.StructureId;
Collection<PropertyItem> properties = new Collection<PropertyItem>();
DmiStructure structure = this[(DmiStructureClass)propertyId];
if (structure == null)
{
return QueryPropertyCollectionResult.CreateErroResult("Can not found specified property key");
}
DmiClassCollection elements = structure.Elements;
foreach (var element in elements)
{
properties.Add(element.GetProperty(propertyKey).Result);
}
return QueryPropertyCollectionResult.CreateSuccessResult(properties);
}
/// <summary>
/// Returns the index of the object with the key specified in the collection
/// </summary>
/// <param name="ResultKey">One of the Results of <see cref="SmbiosStructure"/> that represents the key of the object to be searched in the collection.</param>
/// <returns>
/// Zero-base index of the first appearance of the item in the collection, if found; otherwise, -1.
/// </returns>
/// <exception cref="InvalidEnumArgumentException"></exception>
public int IndexOf(DmiStructureClass ResultKey)
{
bool knownBlockValid = SentinelHelper.IsEnumValid(ResultKey, true);
if (!knownBlockValid)
{
throw new InvalidEnumArgumentException(nameof(ResultKey), (int)ResultKey, typeof(DmiStructureClass));
}
DmiStructure block = null;
foreach (var item in Items)
{
if (item.Class != ResultKey)
{
continue;
}
block = item;
break;
}
return IndexOf(block);
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/DeviceLocator.md
# DmiProperty.MemoryDevice.DeviceLocator property
Gets a value representing the key to retrieve the property.
String number of the string that identifies the physically-labeled socket or board position where the memory device is located.
Key Composition
* Structure: MemoryDevice
* Property: DeviceLocator
* Unit: None
Return Value
Type: String
Remarks
2.1+
```csharp
public static IPropertyKey DeviceLocator { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType001 [System Information].cs
using System;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using iTin.Core;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 001: System Information.
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length Value Description |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.0+ Type BYTE 1 System Information Indicator |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.0+ Length BYTE Varies 08h for version 2.0 |
// | 19h for versions 2.1 – 2.3.4 |
// | 1Bh for version 2.4 and later |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 2.0+ Handle WORD Varies |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 2.0+ Manufacturer BYTE STRING Number of null-terminated string |
// | |
// | Note: Please see, Manufacturer |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h 2.0+ Product Name BYTE STRING Number of null-terminated string |
// | |
// | Note: Please see,ProductName |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h 2.0+ Version BYTE STRING Number of null-terminated string |
// | |
// | Note: Please see, Version |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h 2.0+ Serial Number BYTE STRING Number of null-terminated string |
// | |
// | Note: Please see, SerialNumber |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h 2.1+ UUID 16 BYTE's Varies Universal Unique ID number |
// | |
// | Note: Please see, GetUUID(byte[], uint) |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 18h 2.1+ Wake-up BYTE ENUM Identifies the event that caused the system to |
// | Type power up. |
// | |
// | Note: Please see, GetWakeUpType(byte) |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 19h 2.4+ SKU Number BYTE STRING Number of null-terminated string |
// | |
// | This text string identifies a particular computer |
// | configuration for sale. It is sometimes also |
// | called a product ID or purchase order number. |
// | This number is frequently found in existing |
// | fields, but there is no standard format. |
// | Typically for a given system board from a given |
// | OEM, there are tens of unique processor, memory, |
// | hard drive, and optical drive configurations. |
// | |
// | Note: Please see, SkuNumber |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 1Ah 2.4+ Family BYTE STRING Number of null-terminated string |
// | |
// | This text string identifies the family to which a |
// | particular computer belongs. A family refers to |
// | a set of computers that are similar but not |
// | identical from a hardware or software point of |
// | view. Typically, a family is composed of different |
// | computer models, which have different |
// | configurations and pricing points. |
// | Computers in the same family often have similar |
// | branding and cosmetic features. |
// | |
// | Note: Please see, Family |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the System Information (Type 1) structure.
/// </summary>
internal sealed class SmbiosType001 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType001"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType001(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private readonly properties
/// <summary>
/// Gets a value representing the <b>Family</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Family
{
get
{
string ret;
try
{
ret = GetString(0x1A);
}
catch (ArgumentOutOfRangeException)
{
ret = string.Empty;
}
return ret;
}
}
/// <summary>
/// Gets a value representing the <b>Family</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Manufacturer => GetString(0x04);
/// <summary>
/// Gets a value representing the <b>Product name</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string ProductName => GetString(0x05);
/// <summary>
/// Gets a value representing the <b>Sku</b> field.
/// </summary>
/// <value>Property value.</value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Sku => GetString(0x19);
/// <summary>
/// Gets a value representing the <b>Serial number</b> field.
/// </summary>
/// <value>Property value.</value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string SerialNumber => GetString(0x07);
/// <summary>
/// Gets a value representing the <b>Version</b> field.
/// </summary>
/// <value>Property value.</value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Version => GetString(0x06);
/// <summary>
/// Gets a value representing the <b>Wake up type</b> field.
/// </summary>
/// <value>Property value.</value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte WakeUpType => Reader.GetByte(0x18);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
#region 2.0+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v20)
{
properties.Add(SmbiosProperty.System.Manufacturer, Manufacturer);
properties.Add(SmbiosProperty.System.ProductName, ProductName);
properties.Add(SmbiosProperty.System.Version, Version);
properties.Add(SmbiosProperty.System.SerialNumber, SerialNumber);
}
#endregion
#region 2.1+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v21)
{
properties.Add(SmbiosProperty.System.WakeUpType, GetWakeUpType(WakeUpType));
byte[] uuid = StructureInfo.RawData.Extract(0x08, 0x10).ToArray();
properties.Add(SmbiosProperty.System.UUID, GetUuid(uuid, SmbiosVersion));
}
#endregion
#region 2.4+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v24)
{
properties.Add(SmbiosProperty.System.SkuNumber, Sku);
properties.Add(SmbiosProperty.System.Family, Family);
}
#endregion
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
// UUID Byte Order and RFC4122 Field Names
// •—————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset RFC 4122 Name Length deviceProperty Description |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h time_low DWORD Varies The low field of the timestamp |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h time_mid WORD Varies The middle field of the timestamp |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h time_hi_and_version WORD Varies The high field of the timestamp |
// | multiplexed with the version number |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h clock_seq_hi_and_reserved BYTE Varies The high field of the clock sequence |
// | multiplexed with the variant |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 09h clock_seq_low BYTE Varies The low field of the clock sequence |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ah Node 6 BYTEs Varies The spatially unique node identifier |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Universal Unique ID number.
/// </summary>
/// <param name="uuid">UUID.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
/// A <see cref="string"/> containing Universal Unique ID number.
private static string GetUuid(byte[] uuid, int smbiosVersion)
{
var only0xFF = true;
var only0x00 = true;
for (var i = 0; i < 16 && (only0x00 || only0xFF); i++)
{
if (uuid[i] != 0x00) only0x00 = false;
if (uuid[i] != 0xFF) only0xFF = false;
}
if (only0xFF)
{
return "Not Present";
}
if (only0x00)
{
return "Not Settable";
}
// As off version 2.6 of the SMBIOS specification, the first 3 fields of the UUID are supposed to be encoded on little-endian.
// The specification says that this is the defacto standard, however I've seen systems following RFC 4122 instead and use
// network byte order, so I am reluctant to apply the byte-swapping for older versions.
return smbiosVersion >= 0x0206
? string.Format(
CultureInfo.InvariantCulture,
"{{{0}{1}{2}{3}-{4}{5}-{6}{7}-{8}{9}-{10}{11}{12}{13}{14}{15}}}",
uuid[3].ToString("X2", CultureInfo.InvariantCulture),
uuid[2].ToString("X2", CultureInfo.InvariantCulture),
uuid[1].ToString("X2", CultureInfo.InvariantCulture),
uuid[0].ToString("X2", CultureInfo.InvariantCulture),
uuid[5].ToString("X2", CultureInfo.InvariantCulture),
uuid[4].ToString("X2", CultureInfo.InvariantCulture),
uuid[7].ToString("X2", CultureInfo.InvariantCulture),
uuid[6].ToString("X2", CultureInfo.InvariantCulture),
uuid[8].ToString("X2", CultureInfo.InvariantCulture),
uuid[9].ToString("X2", CultureInfo.InvariantCulture),
uuid[10].ToString("X2", CultureInfo.InvariantCulture),
uuid[11].ToString("X2", CultureInfo.InvariantCulture),
uuid[12].ToString("X2", CultureInfo.InvariantCulture),
uuid[13].ToString("X2", CultureInfo.InvariantCulture),
uuid[14].ToString("X2", CultureInfo.InvariantCulture),
uuid[15].ToString("X2", CultureInfo.InvariantCulture))
: string.Format(
CultureInfo.InvariantCulture,
"{{{0}{1}{2}{3}-{4}{5}-{6}{7}-{8}{9}-{10}{11}{12}{13}{14}{15}}}",
uuid[0].ToString("X2", CultureInfo.InvariantCulture),
uuid[1].ToString("X2", CultureInfo.InvariantCulture),
uuid[2].ToString("X2", CultureInfo.InvariantCulture),
uuid[3].ToString("X2", CultureInfo.InvariantCulture),
uuid[4].ToString("X2", CultureInfo.InvariantCulture),
uuid[5].ToString("X2", CultureInfo.InvariantCulture),
uuid[6].ToString("X2", CultureInfo.InvariantCulture),
uuid[7].ToString("X2", CultureInfo.InvariantCulture),
uuid[8].ToString("X2", CultureInfo.InvariantCulture),
uuid[9].ToString("X2", CultureInfo.InvariantCulture),
uuid[10].ToString("X2", CultureInfo.InvariantCulture),
uuid[11].ToString("X2", CultureInfo.InvariantCulture),
uuid[12].ToString("X2", CultureInfo.InvariantCulture),
uuid[13].ToString("X2", CultureInfo.InvariantCulture),
uuid[14].ToString("X2", CultureInfo.InvariantCulture),
uuid[15].ToString("X2", CultureInfo.InvariantCulture));
}
/// <summary>
/// Identifies the event that turns on the system.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// A <see cref="string"/> containing the event that starts the system.
/// </returns>
private static string GetWakeUpType(byte code)
{
string[] deviceProperty =
{
"Reserved", // 0x00
"Other",
"Unknown",
"APM Timer",
"Modem Ring",
"LAN Remote",
"Power Switch",
"PCI PME#",
"AC Power Restored" // 0x08
};
return
code <= 0x08
? deviceProperty[code]
: SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.OnBoardDevicesExtended.Element.md
# DmiProperty.OnBoardDevicesExtended.Element class
Contains the key definition for the Element section.
```csharp
public static class Element
```
## Public Members
| name | description |
| --- | --- |
| static [DeviceStatus](DmiProperty.OnBoardDevicesExtended.Element/DeviceStatus.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [DeviceType](DmiProperty.OnBoardDevicesExtended.Element/DeviceType.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [OnBoardDevicesExtended](./DmiProperty.OnBoardDevicesExtended.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType026 [Voltage Probe].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Voltage Probe (Type 26) structure.<br/>
/// For more information, please see <see cref="SmbiosType026"/>.
/// </summary>
internal sealed class DmiType026 : DmiBaseType<SmbiosType026>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType026"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType026(SmbiosType026 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion >= DmiStructureVersion.Latest)
{
properties.Add(DmiProperty.VoltageProbe.Description, SmbiosStructure.GetPropertyValue(SmbiosProperty.VoltageProbe.Description));
properties.Add(DmiProperty.VoltageProbe.LocationAndStatus.Status, SmbiosStructure.GetPropertyValue(SmbiosProperty.VoltageProbe.LocationAndStatus.Status));
properties.Add(DmiProperty.VoltageProbe.LocationAndStatus.Location, SmbiosStructure.GetPropertyValue(SmbiosProperty.VoltageProbe.LocationAndStatus.Location));
ushort maximumValue = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.VoltageProbe.MaximumValue);
if (maximumValue != 0x8000)
{
properties.Add(DmiProperty.VoltageProbe.MaximumValue, maximumValue);
}
ushort minimumValue = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.VoltageProbe.MinimumValue);
if (minimumValue != 0x8000)
{
properties.Add(DmiProperty.VoltageProbe.MinimumValue, minimumValue);
}
ushort resolution = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.VoltageProbe.Resolution);
if (resolution != 0x8000)
{
properties.Add(DmiProperty.VoltageProbe.Resolution, resolution);
}
ushort tolerance = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.VoltageProbe.Tolerance);
if (tolerance != 0x8000)
{
properties.Add(DmiProperty.VoltageProbe.Tolerance, tolerance);
}
ushort accuracy = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.VoltageProbe.Accuracy);
if (accuracy != 0x8000)
{
properties.Add(DmiProperty.VoltageProbe.Accuracy, accuracy);
}
properties.Add(DmiProperty.VoltageProbe.OemDefined, SmbiosStructure.GetPropertyValue(SmbiosProperty.VoltageProbe.OemDefined));
}
if (SmbiosStructure.StructureInfo.Length < 0x15)
{
return;
}
ushort nominalValue = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.VoltageProbe.NominalValue);
if (nominalValue != 0x8000)
{
properties.Add(DmiProperty.VoltageProbe.NominalValue, nominalValue);
}
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType029 [Electrical Current Probe].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Electrical Current Probe (Type 29) structure.<br/>
/// For more information, please see <see cref="SmbiosType029"/>.
/// </summary>
internal sealed class DmiType029 : DmiBaseType<SmbiosType029>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType029"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType029(SmbiosType029 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion >= DmiStructureVersion.Latest)
{
properties.Add(DmiProperty.ElectricalCurrentProbe.Description, SmbiosStructure.GetPropertyValue(SmbiosProperty.ElectricalCurrentProbe.Description));
properties.Add(DmiProperty.ElectricalCurrentProbe.LocationAndStatus.Status, SmbiosStructure.GetPropertyValue(SmbiosProperty.ElectricalCurrentProbe.LocationAndStatus.Status));
properties.Add(DmiProperty.ElectricalCurrentProbe.LocationAndStatus.Location, SmbiosStructure.GetPropertyValue(SmbiosProperty.ElectricalCurrentProbe.LocationAndStatus.Location));
ushort maximumValue = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.ElectricalCurrentProbe.MaximumValue);
if (maximumValue != 0x8000)
{
properties.Add(DmiProperty.ElectricalCurrentProbe.MaximumValue, maximumValue);
}
ushort minimumValue = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.ElectricalCurrentProbe.MinimumValue);
if (minimumValue != 0x8000)
{
properties.Add(DmiProperty.ElectricalCurrentProbe.MinimumValue, minimumValue);
}
ushort resolution = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.ElectricalCurrentProbe.Resolution);
if (resolution != 0x8000)
{
properties.Add(DmiProperty.ElectricalCurrentProbe.Resolution, resolution);
}
ushort tolerance = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.ElectricalCurrentProbe.Tolerance);
if (tolerance != 0x8000)
{
properties.Add(DmiProperty.ElectricalCurrentProbe.Tolerance, tolerance);
}
ushort accuracy = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.ElectricalCurrentProbe.Accuracy);
if (accuracy != 0x8000)
{
properties.Add(DmiProperty.ElectricalCurrentProbe.Accuracy, accuracy);
}
properties.Add(DmiProperty.ElectricalCurrentProbe.OemDefined, SmbiosStructure.GetPropertyValue(SmbiosProperty.ElectricalCurrentProbe.OemDefined));
}
if (SmbiosStructure.StructureInfo.Length < 0x15)
{
return;
}
ushort nominalValue = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.ElectricalCurrentProbe.NominalValue);
if (nominalValue != 0x8000)
{
properties.Add(DmiProperty.ElectricalCurrentProbe.NominalValue, nominalValue);
}
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType018 [32-Bit Memory Error Information].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the 32-Bit Memory Error Information (Type 18) structure.<br/>
/// For more information, please see <see cref="SmbiosType018"/>.
/// </summary>
internal sealed class DmiType018 : DmiBaseType<SmbiosType018>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType018"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType018(SmbiosType018 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion < DmiStructureVersion.v21)
{
return;
}
properties.Add(DmiProperty.BitMemoryError32.ErrorType, SmbiosStructure.GetPropertyValue(SmbiosProperty.BitMemoryError32.ErrorType));
properties.Add(DmiProperty.BitMemoryError32.ErrorGranularity, SmbiosStructure.GetPropertyValue(SmbiosProperty.BitMemoryError32.ErrorGranularity));
properties.Add(DmiProperty.BitMemoryError32.ErrorOperation, SmbiosStructure.GetPropertyValue(SmbiosProperty.BitMemoryError32.ErrorOperation));
uint vendorSyndrome = SmbiosStructure.GetPropertyValue<uint>(SmbiosProperty.BitMemoryError32.VendorSyndrome);
if (vendorSyndrome != 0x00000000)
{
properties.Add(DmiProperty.BitMemoryError32.VendorSyndrome, vendorSyndrome);
}
uint busErrorAddress = SmbiosStructure.GetPropertyValue<uint>(SmbiosProperty.BitMemoryError32.MemoryArrayErrorAddress);
if (busErrorAddress != 0x80000000)
{
properties.Add(DmiProperty.BitMemoryError32.MemoryArrayErrorAddress, busErrorAddress);
}
uint deviceErrorAddress = SmbiosStructure.GetPropertyValue<uint>(SmbiosProperty.BitMemoryError32.DeviceErrorAddress);
if (deviceErrorAddress != 0x80000000)
{
properties.Add(DmiProperty.BitMemoryError32.DeviceErrorAddress, deviceErrorAddress);
}
uint errorResolution = SmbiosStructure.GetPropertyValue<uint>(SmbiosProperty.BitMemoryError32.ErrorResolution);
if (errorResolution != 0x80000000)
{
properties.Add(DmiProperty.BitMemoryError32.ErrorResolution, errorResolution);
}
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor.Voltage/IsLegacyMode.md
# DmiProperty.Processor.Voltage.IsLegacyMode property
Gets a value representing the key to retrieve the property value.
Indicating 'legacy' mode for processor voltage
Key Composition
* Structure: Processor
* Property: IsLegacyMode
* Unit: None
Return Value
Type: Boolean
Remarks
2.0+
```csharp
public static IPropertyKey IsLegacyMode { get; }
```
## See Also
* class [Voltage](../DmiProperty.Processor.Voltage.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BitMemoryError64/ErrorGranularity.md
# DmiProperty.BitMemoryError64.ErrorGranularity property
Gets a value representing the key to retrieve the property value.
Granularity (for example, device versus Partition) to which the error can be resolved.
Key Composition
* Structure: BitMemoryError64
* Property: ErrorGranularity
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey ErrorGranularity { get; }
```
## See Also
* class [BitMemoryError64](../DmiProperty.BitMemoryError64.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDeviceMappedAddress.md
# DmiProperty.MemoryDeviceMappedAddress class
Contains the key definitions available for a type 020 [MemoryDeviceMappedAddress] structure.
```csharp
public static class MemoryDeviceMappedAddress
```
## Public Members
| name | description |
| --- | --- |
| static [EndingAddress](DmiProperty.MemoryDeviceMappedAddress/EndingAddress.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [InterleavedDataDepth](DmiProperty.MemoryDeviceMappedAddress/InterleavedDataDepth.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [InterleavePosition](DmiProperty.MemoryDeviceMappedAddress/InterleavePosition.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MemoryArrayMappedAddressHandle](DmiProperty.MemoryDeviceMappedAddress/MemoryArrayMappedAddressHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MemoryDeviceHandle](DmiProperty.MemoryDeviceMappedAddress/MemoryDeviceHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [PartitionRowPosition](DmiProperty.MemoryDeviceMappedAddress/PartitionRowPosition.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [StartingAddress](DmiProperty.MemoryDeviceMappedAddress/StartingAddress.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType043 [TPM Device].cs
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using iTin.Core;
using iTin.Hardware.Specification.Smbios.Property;
using iTin.Hardware.Specification.Tpm;
namespace iTin.Hardware.Specification.Smbios;
// Type 043: TPM Device.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 43 TPM Device |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE 1Fh Length of the structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies Handle, or instance number, associated with the |
// | structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Vendor ID 4 Varies Specified as four ASCII characters, as defined by TCG |
// | BYTEs Vendor ID (see CAP_VID in TCG Vendor ID Registry). |
// | |
// | For example: |
// | Vendor ID string of "ABC" = (41 42 43 00) |
// | Vendor ID string of "ABCD" = (41 42 43 44) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h Major Spec BYTE Varies Major TPM version supported by the TPM device. |
// | Version For rexample, |
// | · The value is 01h for TPM v1.2 and is 02h for |
// | TPM v2.0. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 09h Minor Spec BYTE Varies Major TPM version supported by the TPM device. |
// | Version For rexample, |
// | · The value is 02h for TPM v1.2 and is 00h for |
// | TPM v2.0. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ah Firmware DWORD Varies For Major Spec Version 01h, this field contains the |
// | Version 1 TPM_VERSION structure defined in the TPM Main |
// | Specification, Part 2, Section 5.3. |
// | |
// | For Major Spec Version 02h, this field contains the |
// | most significant 32 bits of a TPM vendor-specific |
// | value for firmware version (please see |
// | TPM_PT_FIRMWARE_VERSION_1 in TPM Structures spec.) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Eh Firmware DWORD Varies For Major Spec Version 01h, this field contains 00h |
// | Version 2 |
// | For Major Spec Version 02h, this field contains the |
// | least significant 32 bits of a TPM vendor-specific |
// | value for firmware version (please see |
// | TPM_PT_FIRMWARE_VERSION_2 in TPM Structures spec.) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 12h Description BYTE STRING String number of descriptive information of the TPM |
// | Version 2 device |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 13h Characteristics QWORD Varies TPM device characteristics information (see 7.44.1) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 1Bh OEM-defined DWORD Varies OEM- or BIOS vendor-specific information |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the TPM Device (Type 43) structure.
/// </summary>
internal sealed class SmbiosType043 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType043"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType043(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private readonly properties
/// <summary>
/// Gets a value representing the <b>Vendor ID</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte[] RawVendorId =>
#if NETSTANDARD2_1 || NET5_0_OR_GREATER
Reader.GetBytes(0x04, 0x04).ToArray();
#else
Reader.GetBytes(0x04, 0x04);
#endif
/// <summary>
/// Gets a value representing the <b>Major Spec Version</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte MajorSpecVersion => Reader.GetByte(0x08);
/// <summary>
/// Gets a value representing the <b>Minor Spec Version</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte MinorSpecVersion => Reader.GetByte(0x09);
/// <summary>
/// Gets a value representing the <b>Firmware Version 1</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte[] RawFirmwareVersion1 =>
#if NETSTANDARD2_1 || NET5_0_OR_GREATER
Reader.GetBytes(0x0a, 0x04).ToArray();
#else
Reader.GetBytes(0x0a, 0x04);
#endif
/// <summary>
/// Gets a value representing the <b>Firmware Version 2</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte[] RawFirmwareVersion2 =>
#if NETSTANDARD2_1 || NET5_0_OR_GREATER
Reader.GetBytes(0x0e, 0x04).ToArray();
#else
Reader.GetBytes(0x0e, 0x04);
#endif
/// <summary>
/// Gets a value representing the <b>Description Version 2</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string DescriptionVersion2 => GetString(0x12);
/// <summary>
/// Gets a value representing the <b>Characteristics</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
private ulong Characteristics => (ulong)Reader.GetQuadrupleWord(0x13);
/// <summary>
/// Gets a value representing the <b>OEM Defined</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
private uint OemDefined => (uint)Reader.GetDoubleWord(0x1b);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.Latest)
{
return;
}
TpmCapabilityVendorId tpmCapabilityVendorIdEntry = GetTpmCapabilityVendorId(RawVendorId);
properties.Add(SmbiosProperty.TpmDevice.VendorId, tpmCapabilityVendorIdEntry.ASCII);
properties.Add(SmbiosProperty.TpmDevice.VendorIdDescription, tpmCapabilityVendorIdEntry.Description);
properties.Add(SmbiosProperty.TpmDevice.MajorSpecVersion, MajorSpecVersion);
properties.Add(SmbiosProperty.TpmDevice.MinorSpecVersion, MinorSpecVersion);
var firmwareVersion = TpmFirmwareVersion.Unknown;
if (MajorSpecVersion >= 0x01 && MajorSpecVersion <= 0x02)
{
firmwareVersion =
MajorSpecVersion == 0x01
? TpmFirmwareVersion.Parse(RawFirmwareVersion1)
: new TpmFirmwareVersion
{
MajorVersion = Reader.GetDoubleWord(0x0a),
MinorVersion = Reader.GetDoubleWord(0x0e)
};
}
properties.Add(SmbiosProperty.TpmDevice.FirmwareVersion, firmwareVersion);
properties.Add(SmbiosProperty.TpmDevice.Description, DescriptionVersion2);
properties.Add(SmbiosProperty.TpmDevice.Characteristics, GetTpmCharacteristics(Characteristics));
properties.Add(SmbiosProperty.TpmDevice.OemDefined, OemDefined);
}
#endregion
#region BIOS Specification 3.1.0 (21/11/2016)
/// <summary>
/// Gets a collection of <b>TPM</b> characteristics.
/// </summary>
/// <param name="target">Value to analyze</param>
/// <returns>
/// Collection of <b>TPM</b> characteristics.
/// </returns>
private static ReadOnlyCollection<string> GetTpmCharacteristics(ulong target)
{
string[] value =
{
"TPM Device Characteristics are not supported", // 0x02
"Family configurable via firmware update",
"Family configurable via platform software support, such as BIOS Setup",
"Family configurable via OEM proprietary mechanism" // 0x05
};
List<string> items = new List<string>();
for (byte i = 2; i < 6; i++)
{
bool addCharacteristic = target.CheckBit(i);
if (addCharacteristic)
{
items.Add(value[i - 0x02]);
}
}
return items.AsReadOnly();
}
/// <summary>
/// Returns a string that contains vendor id field.
/// </summary>
/// <param name="data">Vendor Id raw data</param>
/// <returns>
/// A <see cref="string"/> containing vendor id field.
/// </returns>
private static string PopulatesVendorId(IEnumerable<byte> data)
{
var builder = new StringBuilder();
foreach (var item in data)
{
if (item == 0x00)
{
continue;
}
builder.Append((char) item);
}
return builder.ToString();
}
#endregion
#region TPM Vendor ID Registry 1.01 (18/10/2017), for more info please see, TpmCapabilityVendorId class
/// <summary>
/// Returns <b>TPM vendor information</b> from hexadecimal vendor data. For more info please see, <see cref="TpmCapabilityVendorId"/> class.
/// </summary>
/// <param name="data">target vendor id data</param>
/// <returns>
/// A <see cref="TpmCapabilityVendorId"/> thats contains vendor information.
/// </returns>
private static TpmCapabilityVendorId GetTpmCapabilityVendorId(byte[] data)
{
var knownTpmCapabilityVendors = new Collection<TpmCapabilityVendorId>
{
TpmCapabilityVendorId.AMD,
TpmCapabilityVendorId.Atmel,
TpmCapabilityVendorId.Broadcom,
TpmCapabilityVendorId.HPE,
TpmCapabilityVendorId.IBM,
TpmCapabilityVendorId.Infineon,
TpmCapabilityVendorId.Intel,
TpmCapabilityVendorId.Lenovo,
TpmCapabilityVendorId.Microsoft,
TpmCapabilityVendorId.NationalSemiconductor,
TpmCapabilityVendorId.Nationz,
TpmCapabilityVendorId.NuvotonTechnology,
TpmCapabilityVendorId.Qualcomm,
TpmCapabilityVendorId.SMSC,
TpmCapabilityVendorId.STMicroelectronics,
TpmCapabilityVendorId.Samsung,
TpmCapabilityVendorId.Sinosun,
TpmCapabilityVendorId.TexasInstruments,
TpmCapabilityVendorId.Winbond,
TpmCapabilityVendorId.FuzhouRockchip,
TpmCapabilityVendorId.Google
};
var cadidateEntry = knownTpmCapabilityVendors.FirstOrDefault(entry => entry.Hex.SequenceEqual(data));
if (cadidateEntry != null)
{
return cadidateEntry;
}
var newEntry = PopulatesVendorId(data);
return new TpmCapabilityVendorId
{
Hex = data,
ASCII = newEntry,
Description = newEntry
};
}
#endregion
}
<file_sep>/src/test/NetCore/iSMBIOS.ConsoleAppCore60/Program.cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using iTin.Core.ComponentModel;
using iTin.Core.Hardware.Common;
using iTin.Hardware.Specification;
using iTin.Hardware.Specification.Dmi;
using iTin.Hardware.Specification.Dmi.Property;
namespace iSMBIOS.ConsoleAppCore;
class Program
{
static void Main(string[] args)
{
DMI dmi = DMI.CreateInstance();
Console.WriteLine(@" ——————————————————————————————————————————————————————————————");
Console.WriteLine(@" SMBIOS");
Console.WriteLine(@" ——————————————————————————————————————————————————————————————");
Console.WriteLine($@" Version > {dmi.SmbiosVersion}");
Console.WriteLine();
Console.WriteLine(@" ——————————————————————————————————————————————————————————————");
Console.WriteLine(@" Availables structures");
Console.WriteLine(@" ——————————————————————————————————————————————————————————————");
DmiStructureCollection structures = dmi.Structures;
foreach (DmiStructure structure in structures)
{
Console.WriteLine($@" {(int)structure.Class:D3}-{structure.FriendlyClassName}");
int totalStructures = structure.Elements.Count;
if (totalStructures > 1)
{
Console.WriteLine($@" > {totalStructures} structures");
}
}
Console.WriteLine();
Console.WriteLine(@" ——————————————————————————————————————————————————————————————");
Console.WriteLine(@" Implemented SMBIOS Structure Version");
Console.WriteLine(@" ——————————————————————————————————————————————————————————————");
foreach (DmiStructure structure in structures)
{
Console.WriteLine($@" {(int)structure.Class:D3}-{structure.FriendlyClassName}");
DmiClassCollection elements = structure.Elements;
foreach (DmiClass element in elements)
{
Console.WriteLine($@" > {element.ImplementedVersion}");
}
}
foreach (DmiStructure structure in structures)
{
DmiClassCollection elements = structure.Elements;
foreach (DmiClass element in elements)
{
Console.WriteLine();
Console.WriteLine(element.ImplementedVersion == DmiStructureVersion.Latest
? $@" ———————————————————————————————————————————————————— {element.ImplementedVersion} ——"
: $@" ——————————————————————————————————————————————————————— {element.ImplementedVersion} ——");
Console.WriteLine($@" {(int)structure.Class:D3}-{structure.FriendlyClassName} structure detail");
Console.WriteLine(@" ——————————————————————————————————————————————————————————————");
IEnumerable<IPropertyKey> properties = element.ImplementedProperties;
foreach (var property in properties)
{
QueryPropertyResult queryResult = element.GetProperty(property);
PropertyItem propertyItem = queryResult.Result;
object value = propertyItem.Value;
string friendlyName = property.GetPropertyName();
PropertyUnit valueUnit = property.PropertyUnit;
string unit = valueUnit == PropertyUnit.None ? string.Empty : valueUnit.ToString();
if (value == null)
{
Console.WriteLine($@" > {friendlyName} > NULL");
continue;
}
if (value is string)
{
Console.WriteLine($@" > {friendlyName} > {value} {unit}");
}
else if (value is byte)
{
Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X2}h]");
}
else if (value is short)
{
Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X4}h]");
}
else if (value is ushort)
{
Console.WriteLine(property.Equals(DmiProperty.MemoryDevice.ConfiguredMemoryClockSpeed)
? $@" > {friendlyName} > {value} {(int.Parse(dmi.SmbiosVersion) > 300 ? PropertyUnit.MTs : PropertyUnit.MHz)} [{value:X4}h]"
: $@" > {friendlyName} > {value} {unit} [{value:X4}h]");
}
else if (value is int)
{
Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X4}h]");
}
else if (value is uint)
{
Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X4}h]");
}
else if (value is long)
{
Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X8}h]");
}
else if (value is ulong)
{
Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X8}h]");
}
else if (value.GetType() == typeof(ReadOnlyCollection<byte>))
{
Console.WriteLine($@" > {friendlyName} > {string.Join(", ", (ReadOnlyCollection<byte>)value)}");
}
else if (value is DmiGroupAssociationElementCollection)
{
// prints elements
}
else if (value.GetType() == typeof(ReadOnlyCollection<string>))
{
Console.WriteLine($@" > {friendlyName}");
var collection = (ReadOnlyCollection<string>)value;
foreach (var entry in collection)
{
Console.WriteLine($@" > {entry} {unit}");
}
}
else
{
Console.WriteLine($@" > {friendlyName} > {value} {unit}");
}
}
}
}
Console.WriteLine();
Console.WriteLine(@" ——————————————————————————————————————————————————————————————");
Console.WriteLine(@" Gets a single property directly");
Console.WriteLine(@" ——————————————————————————————————————————————————————————————");
QueryPropertyResult biosVersion = structures.GetProperty(DmiProperty.Bios.BiosVersion);
if (biosVersion.Success)
{
Console.WriteLine($@" > BIOS Version > {biosVersion.Result.Value}");
}
QueryPropertyResult biosVendor = structures.GetProperty(DmiProperty.Bios.Vendor);
if (biosVendor.Success)
{
Console.WriteLine($@" > BIOS Vendor > {biosVendor.Result.Value}");
}
QueryPropertyResult currentSpeed = structures.GetProperty(DmiProperty.Processor.CurrentSpeed);
if (currentSpeed.Success)
{
Console.WriteLine($@" > Current Speed > {currentSpeed.Result.Value} {currentSpeed.Result.Key.PropertyUnit}");
}
QueryPropertyResult processorManufacturer = structures.GetProperty(DmiProperty.Processor.ProcessorManufacturer);
if (processorManufacturer.Success)
{
Console.WriteLine($@" > Processor Manufacturer > {processorManufacturer.Result.Value}");
}
Console.WriteLine();
Console.WriteLine(@" ———————————————————————————————————————————————— Collection ——");
Console.WriteLine(@" Gets a multiple properties directly");
Console.WriteLine(@" Handle result as collection");
Console.WriteLine(@" ——————————————————————————————————————————————————————————————");
QueryPropertyCollectionResult systemSlotsQueryResult = structures.GetProperties(DmiProperty.SystemSlots.SlotDesignation);
if (!systemSlotsQueryResult.Success)
{
Console.WriteLine($@" > Error(s)");
Console.WriteLine($@" {systemSlotsQueryResult.Errors.AsMessages().ToStringBuilder()}");
}
else
{
IEnumerable<PropertyItem> systemSlotsItems = systemSlotsQueryResult.Result.ToList();
bool hasSystemSlotsItems = systemSlotsItems.Any();
if (!hasSystemSlotsItems)
{
Console.WriteLine($@" > Sorry, The '{DmiProperty.SystemSlots.SlotId}' property has not implemented on this system");
}
else
{
int index = 0;
foreach (var systemSlotItem in systemSlotsItems)
{
Console.WriteLine($@" > System Slot ({index}) > {systemSlotItem.Value}");
index++;
}
}
}
Console.WriteLine();
Console.WriteLine(@" ———————————————————————————————————————————————— Dictionary ——");
Console.WriteLine(@" Gets a multiple properties directly");
Console.WriteLine(@" Handle result as dictionary");
Console.WriteLine(@" ——————————————————————————————————————————————————————————————");
var systemSlotsQueryDictionayResult = systemSlotsQueryResult.AsDictionaryResult();
if (!systemSlotsQueryDictionayResult.Success)
{
Console.WriteLine($@" > Error(s)");
Console.WriteLine($@" {systemSlotsQueryDictionayResult.Errors.AsMessages().ToStringBuilder()}");
}
else
{
var systemSlotsItems = systemSlotsQueryDictionayResult.Result.ToList();
bool hasSystemSlotsItems = systemSlotsItems.Any();
if (!hasSystemSlotsItems)
{
Console.WriteLine($@" > Sorry, The '{DmiProperty.SystemSlots.SlotId}' property has not implemented on this system");
}
else
{
foreach (var systemSlotItemEntry in systemSlotsItems)
{
var itemIndex = systemSlotItemEntry.Key;
var itemValue = systemSlotItemEntry.Value;
Console.WriteLine($@" > System Slot ({itemIndex}) > {itemValue.Value}");
}
}
}
Console.ReadLine();
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType008 [Port Connector Information].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 008: Port Connector Information
// •———————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length deviceProperty Description |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 8 Connector Information Indicator |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE 9h |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Internal BYTE STRING String number for Internal Reference Designator, |
// | Reference that is, internal to the system enclosure |
// | Designator EXAMPLE: ‘J101’, 0 |
// | Note: Please see, InternalReference |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Internal BYTE ENUM Tipo de conector interno. |
// | Connector Note: Please see, GetConnectorType(byte) |
// | Type |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h External BYTE STRING String number for the External Reference |
// | Reference Designation external to the system enclosure |
// | Designator EXAMPLE: ‘COM A’, 0 |
// | Note: Please see, ExternalReference |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h External BYTE ENUM Tipo de conector externo. |
// | Connector Note: Please see, GetConnectorType(byte) |
// | type |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h Port BYTE ENUM Descripción de la función de este puerto. |
// | Type Note: Please see, GetPortType(byte) |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Port Connector Information (Type 8) structure.
/// </summary>
internal sealed class SmbiosType008 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType008"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType008(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Internal Reference</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string InternalReference => GetString(0x04);
/// <summary>
/// Gets a value representing the <b>Internal Connector Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte InternalConnectorType => Reader.GetByte(0x05);
/// <summary>
/// Gets a value representing the <b>External Reference</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string ExternalReference => GetString(0x06);
/// <summary>
/// Gets a value representing the <b>External Connector Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ExternalConnectorType => Reader.GetByte(0x07);
/// <summary>
/// Gets a value representing the <b>Port Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte PortType => Reader.GetByte(0x08);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
properties.Add(SmbiosProperty.PortConnector.InternalReferenceDesignator, InternalReference);
properties.Add(SmbiosProperty.PortConnector.InternalConnectorType, GetConnectorType(InternalConnectorType));
properties.Add(SmbiosProperty.PortConnector.ExternalReferenceDesignator, ExternalReference);
properties.Add(SmbiosProperty.PortConnector.ExternalConnectorType, GetConnectorType(ExternalConnectorType));
properties.Add(SmbiosProperty.PortConnector.PortType, GetPortType(PortType));
}
#endregion
#region BIOS Specification 3.2.0 (26/04/2018)
/// <summary>
/// Gets a string representing the type of connector on this port.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// Type of connector on this port.
/// </returns>
private static string GetConnectorType(byte code)
{
string[] deviceProperty =
{
"None", // 0x00
"Centronics",
"Mini Centronics",
"Proprietary",
"DB-25 male",
"DB-25 female",
"DB-15 male",
"DB-15 female",
"DB-9 male",
"DB-9 female",
"RJ-11",
"RJ-45",
"50 Pin MiniSCSI",
"Mini DIN",
"Micro DIN",
"PS/2",
"Infrared",
"HP-HIL",
"Access Bus (USB)",
"SSA SCSI",
"Circular DIN-8 male",
"Circular DIN-8 female",
"On Board IDE",
"On Board Floppy",
"9 Pin Dual Inline (pin 10 cut)",
"25 Pin Dual Inline (pin 26 cut)",
"50 Pin Dual Inline",
"68 Pin Dual Inline",
"On Board Sound Input From CD-ROM",
"Mini Centronics Type-14",
"Mini Centronics Type-26",
"Mini Jack (headphones)",
"BNC",
"IEEE 1394",
"SAS/SATA Plug Receptacle",
"USB Type-C Receptacle" // 0x23
};
string[] deviceProperty1 =
{
"PC-98", // 0xA0
"PC-98 Hireso",
"PC-H98",
"PC-98 Note",
"PC-98 Full" // 0xA4
};
if (code <= 0x23)
{
return deviceProperty[code];
}
if (code >= 0xA0 && code <= 0xA4)
{
return deviceProperty1[code - 0xA0];
}
if (code == 0xFF)
{
return "Other";
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string representing the function of this port.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// The function of this port.
/// </returns>
private static string GetPortType(byte code)
{
string[] deviceProperty =
{
"None", // 0x00
"Parallel Port XT/AT Compatible",
"Parallel Port PS/2",
"Parallel Port ECP",
"Parallel Port EPP",
"Parallel Port ECP/EPP",
"Serial Port XT/AT Compatible",
"Serial Port 16450 Compatible",
"Serial Port 16550 Compatible",
"Serial Port 16550A Compatible",
"SCSI Port",
"MIDI Port",
"Joystick Port",
"Keyboard Port",
"Mouse Port",
"SSA SCSI",
"USB",
"Firewire (IEEE P1394)",
"PCMCIA Type I",
"PCMCIA Type II",
"PCMCIA Type III",
"Cardbus",
"Access Bus Port",
"SCSI II",
"SCSI Wide",
"PC-98",
"PC-98 Hireso",
"PC-H98",
"Video Port",
"Audio Port",
"Modem Port",
"Network Port",
"SATA",
"SAS",
"MFDP (Multi-Function Display Port)",
"Thunderbolt" // 0x23
};
string[] deviceProperty1 =
{
"8251 Compatible", // 0xA0
"8251 FIFO Compatible" // 0xA1
};
if (code <= 0x23)
{
return deviceProperty[code];
}
if (code >= 0xA0 && code <= 0xA1)
{
return deviceProperty1[code - 0xA0];
}
if (code == 0xFF)
{
return "Other";
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Chassis.Elements/Max.md
# DmiProperty.Chassis.Elements.Max property
Gets a value representing the key to retrieve the property value.
Specifies the maximum number of the element type that can be installed in the chassis, in the range 1 to 255.
Key Composition
* Structure: SystemEnclosure
* Property: ContainedElementMaximum
* Unit: None
Return Value
Type: Byte
Remarks
2.3+
```csharp
public static IPropertyKey Max { get; }
```
## See Also
* class [Elements](../DmiProperty.Chassis.Elements.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemSlots/SlotLength.md
# DmiProperty.SystemSlots.SlotLength property
Gets a value representing the key to retrieve the property value.
Slot length.
Key Composition
* Structure: SystemSlots
* Property: SlotLength
* Unit: None
Return Value
Type: String
Remarks
2.0+
```csharp
public static IPropertyKey SlotLength { get; }
```
## See Also
* class [SystemSlots](../DmiProperty.SystemSlots.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PortableBattery/OemSpecific.md
# DmiProperty.PortableBattery.OemSpecific property
Gets a value representing the key to retrieve the property value.
Contains OEM or BIOS vendor-specific information.
Key Composition
* Structure: PortableBattery
* Property: OemSpecific
* Unit: None
Return Value
Type: UInt32
Remarks
2.2+
```csharp
public static IPropertyKey OemSpecific { get; }
```
## See Also
* class [PortableBattery](../DmiProperty.PortableBattery.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryChannel/Devices.md
# DmiProperty.MemoryChannel.Devices property
Gets a value representing the key to retrieve the property value.
Devices collection.
Key Composition
* Structure: MemoryChannel
* Property: Devices
* Unit: None
Return Value
Type: [`DmiMemoryChannelElementCollection`](../../iTin.Hardware.Specification.Dmi/DmiMemoryChannelElementCollection.md)
```csharp
public static IPropertyKey Devices { get; }
```
## See Also
* class [MemoryChannel](../DmiProperty.MemoryChannel.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BitMemoryError32/ErrorResolution.md
# DmiProperty.BitMemoryError32.ErrorResolution property
Gets a value representing the key to retrieve the property value.
Range, in bytes, within which the error can be determined, when an error address is given
Key Composition
* Structure: BitMemoryError32
* Property: ErrorResolution
* Unit: Bytes
Return Value
Type: UInt32
Remarks
2.1+
```csharp
public static IPropertyKey ErrorResolution { get; }
```
## See Also
* class [BitMemoryError32](../DmiProperty.BitMemoryError32.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.AdditionalInformation.Entry/ReferencedOffset.md
# DmiProperty.AdditionalInformation.Entry.ReferencedOffset property
Gets a value representing the key to retrieve the property value.
Offset of the field within the structure referenced by the referenced handle for which additional information is provided.
Key Composition
* Structure: AdditionalInformation
* Property: ReferencedOffset
* Unit: None
Return Value
Type: Byte
```csharp
public static IPropertyKey ReferencedOffset { get; }
```
## See Also
* class [Entry](../DmiProperty.AdditionalInformation.Entry.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType010 [On Board Devices (Obsolete)].cs
using System;
using System.Diagnostics;
using System.Text;
using iTin.Core.Helpers;
using iTin.Core.Helpers.Enumerations;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 010: On Board Devices Information.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 10 On Board Devices Information Indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE Varies 4 + 2 * (Number of Devices). |
// | The user of this structure determines the number of |
// | devices as (Length - 4) / 2. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 4+2*(n-1) Devicen Type, BYTE Varies Bit 07 Device(n) Status |
// | n ranges from 1b - Device Enabled |
// | 1 to Number of 0b - Device Disabled |
// | Devices Bits 06:00 Type of Device |
// | NOTE: See GetDeviceType(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 5+2*(n-1) Description BYTE STRING String number of device description |
// | String |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the On Board Devices (Type 10, Obsolete) structure.
/// </summary>
internal sealed class SmbiosType010 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType010"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType010(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Device Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte DeviceType => (byte) (Reader.GetByte(0x04) & 0x7f);
/// <summary>
/// Gets a value representing the <b>Is Enabled</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool IsEnabled => LogicHelper.CheckBit(Reader.GetByte(0x04), Bits.Bit07);
/// <summary>
/// Gets a value representing the <b>Description</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Description
{
get
{
const byte begin = 0x06;
byte end = (byte)(StructureInfo.RawData.Length - 0x02);
byte lenght = (byte)(end - begin);
byte[] descriptionArray = new byte[lenght];
Array.Copy(StructureInfo.RawData, begin, descriptionArray, 0x00, lenght);
string description = Encoding.ASCII.GetString(descriptionArray, 0x00, lenght);
return description;
}
}
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
properties.Add(SmbiosProperty.OnBoardDevices.Enabled, IsEnabled);
properties.Add(SmbiosProperty.OnBoardDevices.DeviceType, GetDeviceType(DeviceType));
properties.Add(SmbiosProperty.OnBoardDevices.Description, Description);
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets a value representing the built-in device type.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The built-in device type.
/// </returns>
private static string GetDeviceType(byte code)
{
var value = new[]
{
"Other", // 0x01
"Unknown",
"Video",
"SCSI Controller",
"Ethernet",
"Token Ring",
"Sound",
"PATA Controller",
"SATA Controller",
"SAS Controller" // 0x0A
};
if (code >= 0x01 && code <= 0x0A)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BiosLanguage/IsCurrentAbbreviated.md
# DmiProperty.BiosLanguage.IsCurrentAbbreviated property
Gets a value representing the key to retrieve the property value.
Indicates if the abbreviated format is used.
Key Composition
* Structure: BiosLanguage
* Property: IsCurrentAbbreviated
* Unit: None
Return Value
Type: Boolean
Remarks
2.1+
```csharp
public static IPropertyKey IsCurrentAbbreviated { get; }
```
## See Also
* class [BiosLanguage](../DmiProperty.BiosLanguage.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.FirmwareInventoryInformation/FirmwareVersion.md
# DmiProperty.FirmwareInventoryInformation.FirmwareVersion property
Gets a value representing the key to retrieve the property value.
String number of the Firmware Version of this firmware. The format of this value is defined by the Version Format.
Key Composition
* Structure: FirmwareInventoryInformation
* Property: FirmwareVersion
* Unit: None
Return Value
Type: String
Remarks
3.5
```csharp
public static IPropertyKey FirmwareVersion { get; }
```
## See Also
* class [FirmwareInventoryInformation](../DmiProperty.FirmwareInventoryInformation.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Specific/PeerDevice.cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 037: Memory Channel. Contained Devices.
// •—————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •—————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Segment Group WORD Varies The channel load provided by the |
// | Number (Peer) associated with this channel. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Bus Number BYTE Varies The channel load provided by th |
// | (Peer) associated with this channel. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————•
// | 03h Device/Function BYTE Bit Field Bits 7:3 – Device Number |
// | Number (Peer) Bits 2:0 – Function Number |
// •—————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Data bus width BYTE Varies Indicates electrical bus width of peer |
// | (Peer) Segment/Bus/Device/Function. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// This class represents an element of the structure <see cref="PeerDevice"/>.
/// </summary>
public class PeerDevice : SpecificSmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="PeerDevice"/> class specifying the structure information.
/// </summary>
/// <param name="peerDeviceArray">Untreated information of the current structure.</param>
internal PeerDevice(byte[] peerDeviceArray) : base(peerDeviceArray)
{
}
#endregion
#region private readonly properties
/// <summary>
/// Gets a value that represents the '<b>Segment Group Number</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort SegmentGroupNumber => (ushort)GetWord(0x00);
/// <summary>
/// Gets a value that represents the '<b>Bus Number</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte BusNumber => GetByte(0x02);
/// <summary>
/// Gets a value that represents the '<b>Device / Function Number</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte DeviceFunctionNumber => GetByte(0x03);
/// <summary>
/// Gets a value representing the <b>Device</b> feature of the <b>Device/Function Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Device => (byte)((DeviceFunctionNumber & 0xf8) >> 3);
/// <summary>
/// Gets a value representing the <b>Function</b> feature of the <b>Device/Function Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Function => (byte)(DeviceFunctionNumber & 0x07);
/// <summary>
/// Gets a value that represents the '<b>Data Bus Width</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte DataBusWidth => GetByte(0x04);
#endregion
#region protected methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
properties.Add(SmbiosProperty.SystemSlots.Peers.SegmentGroupNumber, SegmentGroupNumber);
properties.Add(SmbiosProperty.SystemSlots.Peers.BusDeviceFunction, GetBusDeviceFunction(BusNumber, Device, Function));
properties.Add(SmbiosProperty.SystemSlots.Peers.DataBusWidth, DataBusWidth);
}
#endregion
#region BIOS Specification 3.4.0 (20/08/2020)
/// <summary>
/// Gets a string representing Bus / Device / Function of the slot.
/// </summary>
/// <param name="bus">Bus.</param>
/// <param name="device">Device.</param>
/// <param name="function">Función.</param>
/// <returns>
/// Bus/Device/Function slot information
/// </returns>
private static string GetBusDeviceFunction(byte bus, byte device, byte function) => $"Bus = {bus}, Device = {device}, Function = {function}";
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.TpmDevice/Characteristics.md
# DmiProperty.TpmDevice.Characteristics property
Gets a value representing the key to retrieve the property value.
TPM device characteristics information.
Key Composition
* Structure: TpmDevice
* Property: Characteristics
* Unit: None
Return Value
Type: ReadOnlyCollection where T is String
```csharp
public static IPropertyKey Characteristics { get; }
```
## See Also
* class [TpmDevice](../DmiProperty.TpmDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Cache.CacheConfiguration.md
# DmiProperty.Cache.CacheConfiguration class
Contains the key definition for the CacheConfiguration section.
```csharp
public static class CacheConfiguration
```
## Public Members
| name | description |
| --- | --- |
| static [CacheEnabled](DmiProperty.Cache.CacheConfiguration/CacheEnabled.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [CacheSocketed](DmiProperty.Cache.CacheConfiguration/CacheSocketed.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Level](DmiProperty.Cache.CacheConfiguration/Level.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Location](DmiProperty.Cache.CacheConfiguration/Location.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [OperationalMode](DmiProperty.Cache.CacheConfiguration/OperationalMode.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [Cache](./DmiProperty.Cache.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryChannel.MemoryDevices/Load.md
# DmiProperty.MemoryChannel.MemoryDevices.Load property
Gets a value representing the key to retrieve the property value.
Channel load provided by the memory device associated with this channel.
Key Composition
* Structure: MemoryChannel
* Property: Load
* Unit: None
Return Value
Type: Byte
```csharp
public static IPropertyKey Load { get; }
```
## See Also
* class [MemoryDevices](../DmiProperty.MemoryChannel.MemoryDevices.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BiosLanguage/InstallableLanguages.md
# DmiProperty.BiosLanguage.InstallableLanguages property
Gets a value representing the key to retrieve the property value.
Number of languages available. Each available language has a description string
Key Composition
* Structure: BiosLanguage
* Property: InstallableLanguages
* Unit: None
Return Value
Type: ReadOnlyCollection where T is String
Remarks
2.0+
```csharp
public static IPropertyKey InstallableLanguages { get; }
```
## See Also
* class [BiosLanguage](../DmiProperty.BiosLanguage.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiBaseType-1/SmbiosStructure.md
# DmiBaseType<TSmbios>.SmbiosStructure property
Gets a reference to smbios structure.
```csharp
protected TSmbios SmbiosStructure { get; }
```
## Property Value
A reference to smbios structure.
## See Also
* class [DmiBaseType<TSmbios>](../DmiBaseType-1.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.FirmwareInventoryInformation/FirmwareImageSize.md
# DmiProperty.FirmwareInventoryInformation.FirmwareImageSize property
Gets a value representing the key to retrieve the property value.
Size of the firmware image that is currently programmed in the device, in bytes. If the Firmware Image Size is unknown, the field is set to FFFFFFFFFFFFFFFFh
Key Composition
* Structure: FirmwareInventoryInformation
* Property: FirmwareImageSize
* Unit: Bytes
Return Value
Type: UInt64
Remarks
3.5
```csharp
public static IPropertyKey FirmwareImageSize { get; }
```
## See Also
* class [FirmwareInventoryInformation](../DmiProperty.FirmwareInventoryInformation.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Bios/Vendor.md
# DmiProperty.Bios.Vendor property
Gets a value representing the key to retrieve the property value.
String number of the BIOS Vendor’s Name.
Key Composition
* Structure: Bios
* Property: Vendor
* Unit: None
Return Value
Type: String
Remarks
2.0+
```csharp
public static IPropertyKey Vendor { get; }
```
## See Also
* class [Bios](../DmiProperty.Bios.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiStructure/GetStructureDescrition.md
# DmiStructure.GetStructureDescrition method
Returns the structure description.
```csharp
public string GetStructureDescrition()
```
## Return Value
The structure description.
## See Also
* class [DmiStructure](../DmiStructure.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType013 [BIOS Language Information].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the BIOS Language Information (Type 13) structure.<br/>
/// For more information, please see <see cref="SmbiosType013"/>.
/// </summary>
internal sealed class DmiType013 : DmiBaseType<SmbiosType013>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType013"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType013(SmbiosType013 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion < DmiStructureVersion.v20)
{
return;
}
properties.Add(DmiProperty.BiosLanguage.InstallableLanguages, SmbiosStructure.GetPropertyValue(SmbiosProperty.BiosLanguage.InstallableLanguages));
properties.Add(DmiProperty.BiosLanguage.IsCurrentAbbreviated, SmbiosStructure.GetPropertyValue(SmbiosProperty.BiosLanguage.IsCurrentAbbreviated));
properties.Add(DmiProperty.BiosLanguage.Current, SmbiosStructure.GetPropertyValue(SmbiosProperty.BiosLanguage.Current));
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/Specific/DmiChassisContainedElementCollection.cs
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using iTin.Hardware.Specification.Smbios;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Represents a collection of objects <see cref="ChassisContainedElement"/>.
/// </summary>
public sealed class DmiChassisContainedElementCollection : ReadOnlyCollection<DmiChassisContainedElement>
{
#region constructor/s
/// <summary>
/// Initialize a new instance of the class <see cref="DmiChassisContainedElementCollection"/>.
/// </summary>
/// <param name="elements">Item list.</param>
internal DmiChassisContainedElementCollection(ChassisContainedElementCollection elements) : base(AsDmiCollectionFrom(elements).ToList())
{
}
#endregion
#region public override methods
/// <summary>
/// Returns a class <see cref="string"/> that represents the current object.
/// </summary>
/// <returns>
/// Object <see cref="string"/> that represents the current <see cref="ChassisContainedElementCollection"/> class.
/// </returns>
/// <remarks>
/// This method returns a string that includes the number of available elements.
/// </remarks>
public override string ToString() => $"Elements = {Items.Count}";
#endregion
#region private static methods
private static IEnumerable<DmiChassisContainedElement> AsDmiCollectionFrom(ChassisContainedElementCollection elements)
{
var items = new Collection<DmiChassisContainedElement>();
foreach (var element in elements)
{
items.Add(new DmiChassisContainedElement(element.Properties));
}
return items;
}
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType127 [End-Of-Table].cs
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 127: End-of-Table.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 127 End-of-table indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE Varies Length of the structure, a minimum of 0Bh |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies The handle, or instance number, associated with the |
// | structure. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the End Of Table (Type 127) structure.
/// </summary>
internal class SmbiosType127 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType127"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType127(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
properties.Add(SmbiosProperty.EndOfTable.Status, "End Of Table Structures");
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemReset.Capabilities/WatchdogTimer.md
# DmiProperty.SystemReset.Capabilities.WatchdogTimer property
Gets a value representing the key to retrieve the property value.
Indicates whether the system contains a watchdog timer.
Key Composition
* Structure: SystemReset
* Property: WatchdogTimer
* Unit: None
Return Value
Type: Boolean
```csharp
public static IPropertyKey WatchdogTimer { get; }
```
## See Also
* class [Capabilities](../DmiProperty.SystemReset.Capabilities.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification/DMI/CreateInstance.md
# DMI.CreateInstance method
Gets an instance of this class for remote machine. If *options* is null (Nothing in Visual Basic) always returns an instance for this machine.
```csharp
public static DMI CreateInstance(DmiConnectOptions options = null)
```
## Property Value
A [`DMI`](../DMI.md) reference that contains DMI information.
## See Also
* class [DmiConnectOptions](../../iTin.Hardware.Specification.Dmi/DmiConnectOptions.md)
* class [DMI](../DMI.md)
* namespace [iTin.Hardware.Specification](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.VoltageProbe/Accuracy.md
# DmiProperty.VoltageProbe.Accuracy property
Gets a value representing the key to retrieve the property value.
Accuracy for reading from this probe, in plus/minus 1/100th of a percent.
Key Composition
* Structure: VoltageProbe
* Property: Accuracy
* Unit: Percent_1_100th
Return Value
Type: UInt16
```csharp
public static IPropertyKey Accuracy { get; }
```
## See Also
* class [VoltageProbe](../DmiProperty.VoltageProbe.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/SerialNumber.md
# DmiProperty.MemoryDevice.SerialNumber property
Gets a value representing the key to retrieve the property.
String number for the serial number of this memory device.
Key Composition
* Structure: MemoryDevice
* Property: SerialNumber
* Unit: None
Return Value
Type: String
Remarks
2.3+
```csharp
public static IPropertyKey SerialNumber { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiStructureVersion.md
# DmiStructureVersion enumeration
Defines known implemented version of a DMI structure.
```csharp
public enum DmiStructureVersion
```
## Values
| name | value | description |
| --- | --- | --- |
| Latest | `-1` | Version valid without specifying its version number. |
| Unknown | `0` | Unknown version |
| v20 | `1` | Version 2.0 |
| v21 | `2` | Version 2.1 |
| v22 | `3` | Version 2.2 |
| v23 | `4` | Version 2.3 |
| v24 | `5` | Version 2.4 |
| v25 | `6` | Version 2.5 |
| v26 | `7` | Version 2.6 |
| v27 | `8` | Version 2.7 |
| v28 | `9` | Version 2.8 |
| v30 | `10` | Version 3.0 |
| v31 | `11` | Version 3.1 |
| v32 | `12` | Version 3.2 |
| v33 | `13` | Version 3.3 |
| v34 | `14` | Version 3.4 |
| v35 | `15` | Version 3.5 |
| v36 | `16` | Version 3.6 |
| v37 | `17` | Version 3.7 |
## See Also
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BaseBoard/ContainedElements.md
# DmiProperty.BaseBoard.ContainedElements property
Gets a value representing the key to retrieve the property value.
List of handles of other structures (for examples, Baseboard, Processor, Port, System Slots, Memory Device) that are contained by this baseboard.
Key Composition
* Structure: BaseBoard
* Property: ContainedObjectHandles
* Unit: None
Return Value
Type: [`BaseBoardContainedElementCollection`](../../iTin.Hardware.Specification.Dmi/BaseBoardContainedElementCollection.md)
```csharp
public static IPropertyKey ContainedElements { get; }
```
## See Also
* class [BaseBoard](../DmiProperty.BaseBoard.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType038 [IPMI Device Information].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the IPMI Device Information (Type 38) structure.<br/>
/// For more information, please see <see cref="SmbiosType038"/>.
/// </summary>
internal sealed class DmiType038 : DmiBaseType<SmbiosType038>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType038"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType038(SmbiosType038 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion < DmiStructureVersion.Latest)
{
return;
}
properties.Add(DmiProperty.IpmiDevice.InterfaceType, SmbiosStructure.GetPropertyValue(SmbiosProperty.IpmiDevice.InterfaceType));
properties.Add(DmiProperty.IpmiDevice.SpecificationRevision, SmbiosStructure.GetPropertyValue(SmbiosProperty.IpmiDevice.SpecificationRevision));
properties.Add(DmiProperty.IpmiDevice.I2CSlaveAddress, SmbiosStructure.GetPropertyValue(SmbiosProperty.IpmiDevice.I2CSlaveAddress));
properties.Add(DmiProperty.IpmiDevice.BaseAddress, SmbiosStructure.GetPropertyValue(SmbiosProperty.IpmiDevice.BaseAddress));
byte nvStorageDeviceAddress = SmbiosStructure.GetPropertyValue<byte>(SmbiosProperty.IpmiDevice.NVStorageDeviceAddress);
if (nvStorageDeviceAddress != 0xff)
{
properties.Add(DmiProperty.IpmiDevice.NVStorageDeviceAddress, nvStorageDeviceAddress);
}
if (SmbiosStructure.StructureInfo.Length >= 0x11)
{
properties.Add(DmiProperty.IpmiDevice.BaseAdressModifier.LsBit, SmbiosStructure.GetPropertyValue(SmbiosProperty.IpmiDevice.BaseAdressModifier.LsBit));
properties.Add(DmiProperty.IpmiDevice.BaseAdressModifier.RegisterSpacing, SmbiosStructure.GetPropertyValue(SmbiosProperty.IpmiDevice.BaseAdressModifier.RegisterSpacing));
properties.Add(DmiProperty.IpmiDevice.Interrupt.SpecifiedInfo, SmbiosStructure.GetPropertyValue(SmbiosProperty.IpmiDevice.Interrupt.SpecifiedInfo));
properties.Add(DmiProperty.IpmiDevice.Interrupt.Polarity, SmbiosStructure.GetPropertyValue(SmbiosProperty.IpmiDevice.Interrupt.Polarity));
properties.Add(DmiProperty.IpmiDevice.Interrupt.TriggerMode, SmbiosStructure.GetPropertyValue(SmbiosProperty.IpmiDevice.Interrupt.TriggerMode));
}
if (SmbiosStructure.StructureInfo.Length >= 0x12)
{
byte interruptNumber = SmbiosStructure.GetPropertyValue<byte>(SmbiosProperty.IpmiDevice.InterruptNumber);
if (interruptNumber != 0x00)
{
properties.Add(DmiProperty.IpmiDevice.InterruptNumber, interruptNumber);
}
}
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/IDmiType/Properties.md
# IDmiType.Properties property
Gets the properties available for this structure.
```csharp
public DmiClassPropertiesTable Properties { get; }
```
## Property Value
Availables properties.
## See Also
* class [DmiClassPropertiesTable](../DmiClassPropertiesTable.md)
* interface [IDmiType](../IDmiType.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType034 [Management Device].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 034: Management Device.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 34 Management Device indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE 0Bh Length of the structure. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies The handle, or instance number, associated with the |
// | structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Description BYTE STRING The number of the string that contains additional |
// | descriptive information about the device or its |
// | location. |
// | Note: See Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Type BYTE Varies Defines the device’s type. |
// | Note: See GetDeviceType(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h Address DWORD Varies Defines the device’s address. |
// | Note: See Address |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ah Address BYTE Varies Defines the type of addressing used to access the |
// | Type device. |
// | Note: See GetDeviceAddressType(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Management Device (Type 34) structure.
/// </summary>
internal sealed class SmbiosType034 : SmbiosBaseType
{
#region Constructor/es
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType034"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType034(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Description</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Description => GetString(0x04);
/// <summary>
/// Gets a value representing the <b>Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Type => Reader.GetByte(0x05);
/// <summary>
/// Gets a value representing the <b>Address</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Address => $"{Reader.GetWord(0x06):X}:{Reader.GetWord(0x08):X}";
/// <summary>
/// Gets a value representing the <b>Address Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte AddressType => Reader.GetByte(0x0a);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.Latest)
{
return;
}
properties.Add(SmbiosProperty.ManagementDevice.Description, Description);
properties.Add(SmbiosProperty.ManagementDevice.Type, GetDeviceType(Type));
properties.Add(SmbiosProperty.ManagementDevice.Address, Address);
properties.Add(SmbiosProperty.ManagementDevice.AddressType, GetDeviceAddressType(AddressType));
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets a string that represents the type of address.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The type of address.
/// </returns>
private static string GetDeviceAddressType(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"I/O Port",
"Memory",
"SM Bus" // 0x05
};
if (code >= 0x01 && code <= 0x05)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string representing the device type.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The device type.
/// </returns>
private static string GetDeviceType(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"National Semiconductor LM75",
"National Semiconductor LM78",
"National Semiconductor LM79",
"National Semiconductor LM80",
"National Semiconductor LM81",
"Analog Devices ADM9240",
"Dallas Semiconductor DS1780",
"Maxim 1617",
"Genesys GL518SM",
"Winbond W83781D",
"Holtek HT82H791" // 0x0D
};
if (code >= 0x01 && code <= 0x0D)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Specific/Enums/MemorySizeUnit.cs
namespace iTin.Hardware.Specification.Smbios;
/// <summary>
/// Defines the unit of measurement of the memory.
/// </summary>
public enum MemorySizeUnit
{
/// <summary>
/// Memory expressed in kilobytes
/// </summary>
KB = -1,
/// <summary>
/// Memory expressed in megabytes
/// </summary>
MB,
/// <summary>
/// Memory expressed in gigabytes
/// </summary>
GB,
/// <summary>
/// Undefined
/// </summary>
Reserved
}
<file_sep>/src/lib/net/iTin.Core/iTin.Core.Interop/iTin.Core.Interop.Windows.Smbios/Development/SystemServices/SystemInformation/Firmware/NativeMethods.cs
using System;
using System.Runtime.InteropServices;
using iTin.Core.Interop.Shared.Windows;
namespace iTin.Core.Interop.Windows.Development.SystemServices.SystemInformation.Firmware;
/// <summary>
/// Functions to handle system firmware tables.
/// </summary>
public static class NativeMethods
{
/// <summary>
/// Enumerates all system firmware tables of the specified type. For more information, see https://docs.microsoft.com/es-es/windows/desktop/api/sysinfoapi/nf-sysinfoapi-enumsystemfirmwaretables.
/// </summary>
[DllImport(ExternDll.Kernel32, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
public static extern int EnumSystemFirmwareTables(KnownProvider firmwareTableProviderSignature, IntPtr firmwareTableBuffer, int bufferSize);
/// <summary>
/// Enumerates all system firmware tables of the specified type. For more information, see https://docs.microsoft.com/es-es/windows/desktop/api/sysinfoapi/nf-sysinfoapi-enumsystemfirmwaretables.
/// </summary>
[DllImport(ExternDll.Kernel32, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
public static extern int EnumSystemFirmwareTables(uint firmwareTableProviderSignature, IntPtr firmwareTableBuffer, int bufferSize);
/// <summary>
/// Retrieves the specified firmware table from the firmware table provider. For more information, see https://docs.microsoft.com/es-es/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemfirmwaretable.
/// </summary>
[DllImport(ExternDll.Kernel32, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
public static extern int GetSystemFirmwareTable(KnownProvider firmwareTableProviderSignature, int firmwareTableId, IntPtr firmwareTableBuffer, int bufferSize);
/// <summary>
/// Retrieves the specified firmware table from the firmware table provider. For more information, see https://docs.microsoft.com/es-es/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemfirmwaretable.
/// </summary>
[DllImport(ExternDll.Kernel32, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
public static extern int GetSystemFirmwareTable(uint firmwareTableProviderSignature, int firmwareTableId, IntPtr firmwareTableBuffer, int bufferSize);
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType025 [System Power Controls].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 025: System Power Controls.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 25 System Power Controls indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE 09h Length of the structure. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies The handle, or instance number, associated with the |
// | structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Next Scheduled BYTE Varies Contains the BCD value of the month on which the next |
// | Power-on Month scheduled power-on is to occur, in the range 01h to |
// | 12h. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Next Scheduled BYTE Varies Contains the BCD value of the day-of-month on which |
// | Power-on Day-of the next scheduled power-on is to occur, in the range |
// | -month 01h to 31h. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h Next Scheduled BYTE Varies Contains the BCD value of the hour on which the next |
// | Power-on Hour scheduled power-on is to occur, in the range 00h to |
// | 23h. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h Next Scheduled BYTE Varies Contains the BCD value of the minute on which the next|
// | Power-on Minute scheduled power-on is to occur, in the range 00h to |
// | 59h. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h Next Scheduled BYTE Varies Contains the BCD value of the second on which the next|
// | Power-on Second scheduled power-on is to occur, in the range 00h to |
// | 59h. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the System Power Controls (Type 25) structure.
/// </summary>
internal sealed class SmbiosType025 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType025"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType025(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Month</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Month => Reader.GetByte(0x04);
/// <summary>
/// Gets a value representing the <b>Day</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Day => Reader.GetByte(0x05);
/// <summary>
/// Gets a value representing the <b>Hour</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Hour => Reader.GetByte(0x06);
/// <summary>
/// Gets a value representing the <b>Minute</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Minute => Reader.GetByte(0x07);
/// <summary>
/// Gets a value representing the <b>Second</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Second => Reader.GetByte(0x08);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.Latest)
{
return;
}
properties.Add(SmbiosProperty.SystemPowerControls.Month, Month);
properties.Add(SmbiosProperty.SystemPowerControls.Day, Day);
properties.Add(SmbiosProperty.SystemPowerControls.Hour, Hour);
properties.Add(SmbiosProperty.SystemPowerControls.Minute, Minute);
properties.Add(SmbiosProperty.SystemPowerControls.Second, Second);
}
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType017 [Memory Device].cs
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using iTin.Core;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 017: Memory Device.
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length deviceProperty Description |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.1+ Type BYTE 17 Memory Device type |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.1+ Length BYTE Varies Length of the structure, a minimum of 15h |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 2.1+ Handle WORD Varies The handle, or instance number, associated with the|
// | structure |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 2.1+ Physical WORD Varies The handle, or instance number, associated with the|
// | Memory Physical Memory Array to which this device belongs.|
// | Array Handle Note: See PhysicalArrayHandle |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h 2.1+ Memory WORD Varies The handle, or instance number, associated with any|
// | Error error that was previously detected for the device. |
// | Information if the system does not provide the error |
// | Handle information structure, the field contains FFFEh; |
// | otherwise, the field contains either FFFFh |
// | (if no error was detected) or the handle of the |
// | error-information structure. |
// | Note: See GetErrorHandle(int) |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h 2.1+ Total Width WORD Varies The total width, in bits, of this memory device, |
// | including any check or error-correction bits. |
// | If there are no error-correction bits, this device |
// | Property should be equal to Data Width. |
// | If the width is unknown, the field is set to FFFFh |
// | Note: See TotalWidth |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ah 2.1+ Data Width WORD Varies The data width, in bits, of this memory device. |
// | A Data Width of 0 and a Total Width of 8 indicates |
// | that the device is being used solely to provide 8 |
// | error-correction bits. |
// | If the width is unknown, the field is set to FFFFh |
// | Note: See DataWidth |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ch 2.1+ Size WORD Varies The size of the memory device. If the device |
// | Property is 0, nomemory device is installed in the |
// | socket; if the size is unknown, the field device |
// | Property is FFFFh. If the size is 32 GB-1 MB or |
// | greater, the field deviceProperty is 7FFFh and the |
// | actual size is stored in the Extended Size field. |
// | The granularity in which the deviceProperty is |
// | specified depends on the setting of the |
// | most-significant bit (bit 15). If the bit |
// | is 0, the deviceProperty is specified in megabyte |
// | units; if the bit is 1, the deviceProperty is |
// | specified in kilobyte units. |
// | For example, the deviceProperty 8100h identifies a |
// | 256 KB memory device and 0100h identifies a 256 MB |
// | memory device. |
// | Note: see MemoryDeviceSize(ushort) |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Eh 2.1+ Form Factor BYTE ENUM The implementation form factor for this memory |
// | device. |
// | Note: See GetFormFactor(byte) |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Fh 2.1+ Device Set BYTE Varies Identifies when the Memory Device is one of a set |
// | of Memory Devices that must be populated with all |
// | devices of the same type and size, and the set to |
// | which this device belongs. |
// | A deviceProperty of 0 indicates that the device is |
// | not part of a set; a deviceProperty of FFh |
// | indicates that the attribute is unknown. |
// | NOTE: A Device Set number must be unique within the|
// | context of the Memory Array containing this |
// | Memory Device. |
// | Note: See DeviceSet(byte) |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 10h 2.1+ Device BYTE STRING The string number of the string that identifies the|
// | Locator physically-labeled socket or board position where |
// | the memory device is located. |
// | EXAMPLE: “SIMM 3” |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 11h 2.1+ Bank BYTE STRING The string number of the string that identifies the|
// | Locator physically labeled bank where the memory device is |
// | located. |
// | EXAMPLE: “Bank 0” or “A” |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 12h 2.1+ Memory Type BYTE ENUM The type of memory used in this device. |
// | Note: See GetDeviceType(byte) |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 13h 2.1+ Type Detail WORD Bit Field Additional detail on the memory device type. |
// | Note: See GetDeviceTypeDetail(int) |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 15h 2.3+ Speed WORD Varies Identifies the maximum capable speed of the device,|
// | in megahertz (MHz). |
// | If the deviceProperty is 0, the speed is unknown. |
// | NOTE: n MHz = (1000 / n) nanoseconds (ns) |
// | Note: See MaximunSpeed |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 17h 2.3+ Manufacturer BYTE STRING String number for the manufacturer of this memory |
// | device. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 18h 2.3+ Serial BYTE STRING String number for the serial number of this memory |
// | Number device. |
// | This deviceProperty is set by the manufacturer and |
// | normally is not changeable. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 19h 2.3+ Asset Tag BYTE STRING String number for the asset tag of this memory |
// | device. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 1Ah 2.3+ Part Number BYTE STRING String number for the part number of this memory |
// | device. |
// | This deviceProperty is set by the manufacturer and |
// | normally is not changeable. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 1Bh 2.6+ Attributes BYTE Varies Bits 07-04: reserved |
// | Bits 03-00: rank |
// | deviceProperty=0 for unknown rank information. |
// | Note: See Rank |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 1Ch 2.7+ Extended DWORD Varies The extended size of the memory device (complements|
// | Size the Size field at offset 0Ch) |
// | deviceProperty = 0 for unknown rank information. |
// | Note: See ExtendedSize |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 20h 2.7+ Configured WORD Varies Identifies the configured clock speed to the memory|
// | Memory device, in megahertz (MHz). |
// | Clock Speed If the deviceProperty is 0, the speed is unknown. |
// | NOTE: n MHz = (1000 / n) nanoseconds (ns) |
// | Note: See CurrentSpeed |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 22h 2.8+ Minimum WORD Varies Minimum operating voltage for this device, in |
// | voltage millivolts. |
// | If the value is 0, the voltage is unknown. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 24h 2.8+ Maximum WORD Varies Maximum operating voltage for this device, in |
// | voltage millivolts. |
// | If the value is 0, the voltage is unknown. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 26h 2.8+ Configured WORD Varies Configured voltage for this device, in millivolts |
// | voltage If the value is 0, the voltage is unknown. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 28h 3.2+ Memory BYTE Varies Memory technology type for this memory device. |
// | Technology Note: See GetMemoryTechnology |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 29h 3.2+ Memory WORD Bit Field The operating modes supported by this memory |
// | Operating device. |
// | Mode |
// | Capability |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 2Bh 3.2+ Firmware BYTE String String number for the firmware version of this |
// | Version memory device. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 2Ch 3.2+ Module WORD Varies The two-byte module manufacturer ID found in the |
// | Manufacturer SPD of this memory device; LSB first |
// | ID |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 2Eh 3.2+ Module WORD Varies The two-byte module product ID found in the |
// | Product SPD of this memory device; LSB first |
// | ID |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 30h 3.2+ Memory WORD Varies The two-byte memory subsystem controller |
// | Subsystem manufacturer ID found in the SPD of this memory |
// | Controller device. LSB first. |
// | Manufacturer |
// | ID |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 32h 3.2+ Memory WORD Varies The two-byte memory subsystem controller product |
// | Subsystem ID found in the SPD of this memory device. |
// | Controller LSB first |
// | Product |
// | ID |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 34h 3.2+ Non-volatile QWORD Varies Size of the Non-volatile portion of the memory |
// | Size device in Bytes, if any. |
// | If is 0, there is no non-volatile portion. |
// | If is FFFFFFFFFFFFFFFFh, is unknown. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 3Ch 3.2+ Volatile Size QWORD Varies Size of the Volatile portion of the memory device |
// | in Bytes, if any. |
// | If is 0, there is no volatile portion. |
// | If is FFFFFFFFFFFFFFFFh, is unknown. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 44h 3.2+ Cache Size QWORD Varies Size of the cache portion of the memory device in |
// | Bytes, if any. |
// | If is 0, there is no volatile portion. |
// | If is FFFFFFFFFFFFFFFFh, is unknown. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 4Ch 3.2+ Lofical Size QWORD Varies Size of the logical memory device in Bytes. |
// | If is FFFFFFFFFFFFFFFFh, is unknown. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 54h 3.3+ Extended DWORD Varies Extended speed of the memory device |
// | Speed (complements the Speed field at offset 15h). |
// | Identifies the maximum capable speed of the |
// | device, in megatransfers per second (MT/s). |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 58h 3.3+ Extended DWORD Varies Extended configured memory speed of the memory |
// | Configured device (complements the Configured Memory |
// | Memory Speed field at offset 20h). Identifies the . |
// | Speed configured speed of the memory device, in |
// | megatransfers per second (MT/s). |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 5Ch 3.7+ PMIC0 WORD Varies The two-byte PMIC0 manufacturer ID found in the |
// | Manufacturer ID SPD of this memory device; LSB first. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 5Eh 3.7+ PMIC0 Revision WORD Varies The PMIC 0 Revision Number found in the SPD of |
// | Number this memory device. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 60h 3.7+ RCD WORD Varies The two-byte RCD manufacturer ID found in the |
// | Manufacturer ID SPD of this memory device; LSB first. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 62h 3.7+ RCD Revision WORD Varies The RCD 0 Revision Number found in the SPD of |
// | Number this memory device. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Memory Device (Type 17) structure.
/// </summary>
internal sealed class SmbiosType017 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType017"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType017(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
#region Version 2.1+ fields
/// <summary>
/// Gets a value representing the <b>Physical Array Memory Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort PhysicalArrayMemoryHandle => (ushort)Reader.GetWord(0x04);
/// <summary>
/// Gets a value representing the <b>Memory Error Information Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort MemoryErrorInformationHandle => (ushort)Reader.GetWord(0x06);
/// <summary>
/// Gets a value representing the <b>Total Width</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort TotalWidth => (ushort)Reader.GetWord(0x08);
/// <summary>
/// Gets a value representing the <b>Data Width</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort DataWidth => (ushort)Reader.GetWord(0x0a);
/// <summary>
/// Gets a value representing the <b>Size</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort Size => (ushort)Reader.GetWord(0x0c);
/// <summary>
/// Gets a value representing the <b>Form Factor</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte FormFactor => Reader.GetByte(0x0e);
/// <summary>
/// Gets a value representing the <b>Device Set</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte DeviceSet => Reader.GetByte(0x0f);
/// <summary>
/// Gets a value indicating whether this device belongs to a set of the same capacity and type.
/// </summary>
/// <value>
/// One of the values in the <see cref = "MemoryDeviceBelongsToSet"/> enumeration that indicates membership to a set.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private MemoryDeviceBelongsToSet BelongsToSet
{
get
{
if (DeviceSet == 0)
{
return MemoryDeviceBelongsToSet.No;
}
if (DeviceSet == 0xff)
{
return MemoryDeviceBelongsToSet.Unknown;
}
return MemoryDeviceBelongsToSet.Yes;
}
}
/// <summary>
/// Gets a value representing the <b>Device Locator</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string DeviceLocator => GetString(0x10);
/// <summary>
/// Gets a value representing the <b>Bank Locator</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string BankLocator => GetString(0x11);
/// <summary>
/// Gets a value representing the <b>Memory Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte MemoryType => Reader.GetByte(0x12);
/// <summary>
/// Gets a value representing the <b>Type Detail</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort TypeDetail => (ushort)Reader.GetWord(0x13);
#endregion
#region Version 2.3+ fields
/// <summary>
/// Gets a value representing the <b>Manufacturer</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Manufacturer => GetString(0x17);
/// <summary>
/// Gets a value representing the <b>Serial Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string SerialNumber => GetString(0x18);
/// <summary>
/// Gets a value representing the <b>Asset Tag</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string AssetTag => GetString(0x19);
/// <summary>
/// Gets a value representing the <b>Part Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string PartNumber => GetString(0x1a);
/// <summary>
/// Gets a value representing the <b>Speed</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort Speed => (ushort)Reader.GetWord(0x15);
#endregion
#region Version 2.6+ fields
/// <summary>
/// Gets a value representing the <b>Rank</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Rank => (byte) (Reader.GetByte(0x1b) & 0x0f);
#endregion
#region Version 2.7+ fields
/// <summary>
/// Gets a value representing the <b>Extended Size</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint ExtendedSize => (uint)Reader.GetDoubleWord(0x1c) & 0x7FFFFFFF;
/// <summary>
/// Gets a value representing the <b>Current Speed</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort CurrentSpeed => (ushort)Reader.GetWord(0x20);
#endregion
#region Version 2.8+ fields
/// <summary>
/// Gets a value representing the <b>Minimum Voltage</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort MinimumVoltage => (ushort)Reader.GetWord(0x22);
/// <summary>
/// Gets a value representing the <b>Maximum Voltage</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort MaximumVoltage => (ushort)Reader.GetWord(0x24);
/// <summary>
/// Gets a value representing the <b>Configured Voltage</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ConfiguredVoltage => (ushort)Reader.GetWord(0x26);
#endregion
#region Version 3.2+ fields
/// <summary>
/// Gets a value representing the '<b>Memory Technology</b>' field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte MemoryTechnology => Reader.GetByte(0x28);
/// <summary>
/// Gets a value representing the '<b>Memory Operating Mode Capability</b>' field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int MemoryOperatingModeCapability => Reader.GetWord(0x29);
/// <summary>
/// Gets a value representing the '<b>Firmware Version</b>' field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string FirmwareVersion => GetString(0x2b);
/// <summary>
/// Gets a value representing the '<b>Module Manufacturer Id</b>' field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ModuleManufacturerId => (ushort)Reader.GetWord(0x2c);
/// <summary>
/// Gets a value representing the '<b>Module Product Id</b>' field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ModuleProductId => (ushort)Reader.GetWord(0x2e);
/// <summary>
/// Gets a value representing the '<b>Memory Subsystem Controller Manufacturer Id</b>' field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort MemorySubsystemControllerManufacturerId => (ushort)Reader.GetWord(0x30);
/// <summary>
/// Gets a value representing the '<b>Memory Subsystem Controller Product Id</b>' field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort MemorySubsystemControllerProductId => (ushort)Reader.GetWord(0x32);
/// <summary>
/// Gets a value representing the '<b>Non Volatile Size</b>' field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ulong NonVolatileSize => (ulong)Reader.GetQuadrupleWord(0x34);
/// <summary>
/// Gets a value representing the '<b>Volatile Size</b>' field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ulong VolatileSize => (ulong)Reader.GetQuadrupleWord(0x3c);
/// <summary>
/// Gets a value representing the '<b>Cache Size</b>' field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ulong CacheSize => (ulong)Reader.GetQuadrupleWord(0x44);
/// <summary>
/// Gets a value representing the '<b>Logical Size</b>' field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ulong LogicalSize => (ulong)Reader.GetQuadrupleWord(0x4c);
#endregion
#region Version 3.3+ fields
/// <summary>
/// Gets a value representing the <b>Extended Speed</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ExtendedSpeed => (ushort)Reader.GetWord(0x54);
/// <summary>
/// Gets a value representing the <b>Extended Configured Speed</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint ExtendedConfiguredSpeed => (uint)Reader.GetDoubleWord(0x58);
#endregion
#region Version 3.7+ fields
/// <summary>
/// Gets a value representing the <b>PMIC0 Manufacturer ID</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort PMIC0ManufacturerId => (ushort)Reader.GetWord(0x5c);
/// <summary>
/// Gets a value representing the <b>PMIC0 Revision Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort PMIC0RevisionNumber => (ushort)Reader.GetWord(0x5e);
/// <summary>
/// Gets a value representing the <b>RCD Manufacturer ID</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort RCDManufacturerId => (ushort)Reader.GetWord(0x60);
/// <summary>
/// Gets a value representing the <b>RCD Revision Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort RCDRevisionNumber => (ushort)Reader.GetWord(0x62);
#endregion
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v21)
{
properties.Add(SmbiosProperty.MemoryDevice.PhysicalMemoryArrayHandle, PhysicalArrayMemoryHandle);
properties.Add(SmbiosProperty.MemoryDevice.MemoryErrorInformationHandle, MemoryErrorInformationHandle);
properties.Add(SmbiosProperty.MemoryDevice.TotalWidth, TotalWidth);
properties.Add(SmbiosProperty.MemoryDevice.DataWidth, DataWidth);
properties.Add(SmbiosProperty.MemoryDevice.Size, Size);
properties.Add(SmbiosProperty.MemoryDevice.FormFactor, GetFormFactor(FormFactor));
MemoryDeviceBelongsToSet belongsToSet = BelongsToSet;
if (belongsToSet.Equals(MemoryDeviceBelongsToSet.Yes))
{
properties.Add(SmbiosProperty.MemoryDevice.DeviceSet, DeviceSet);
}
properties.Add(SmbiosProperty.MemoryDevice.DeviceLocator, DeviceLocator);
properties.Add(SmbiosProperty.MemoryDevice.BankLocator, BankLocator);
properties.Add(SmbiosProperty.MemoryDevice.MemoryType, GetDeviceType(MemoryType));
properties.Add(SmbiosProperty.MemoryDevice.TypeDetail, GetDeviceTypeDetail(TypeDetail));
}
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v23)
{
properties.Add(SmbiosProperty.MemoryDevice.Speed, Speed);
properties.Add(SmbiosProperty.MemoryDevice.Manufacturer, Manufacturer);
properties.Add(SmbiosProperty.MemoryDevice.SerialNumber, SerialNumber);
properties.Add(SmbiosProperty.MemoryDevice.AssetTag, AssetTag);
properties.Add(SmbiosProperty.MemoryDevice.PartNumber, PartNumber);
}
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v26)
{
properties.Add(SmbiosProperty.MemoryDevice.Rank, Rank);
}
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v27)
{
properties.Add(SmbiosProperty.MemoryDevice.ExtendedSize, ExtendedSize);
properties.Add(SmbiosProperty.MemoryDevice.ConfiguredMemoryClockSpeed, CurrentSpeed);
}
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v28)
{
properties.Add(SmbiosProperty.MemoryDevice.MinimumVoltage, MinimumVoltage);
properties.Add(SmbiosProperty.MemoryDevice.MaximumVoltage, MaximumVoltage);
properties.Add(SmbiosProperty.MemoryDevice.ConfiguredVoltage, ConfiguredVoltage);
}
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v32)
{
string memoryTechnology = GetMemoryTechnology(MemoryTechnology);
properties.Add(SmbiosProperty.MemoryDevice.MemoryTechnology, memoryTechnology);
ReadOnlyCollection<string> memoryOperatingModeCapability = GetMemoryOperatingModeCapability(MemoryOperatingModeCapability);
properties.Add(SmbiosProperty.MemoryDevice.MemoryOperatingModeCapability, memoryOperatingModeCapability);
properties.Add(SmbiosProperty.MemoryDevice.FirmwareVersion, FirmwareVersion);
properties.Add(SmbiosProperty.MemoryDevice.ModuleManufacturerId, ModuleManufacturerId);
properties.Add(SmbiosProperty.MemoryDevice.ModuleProductId, ModuleProductId);
properties.Add(SmbiosProperty.MemoryDevice.MemorySubsystemControllerManufacturerId, MemorySubsystemControllerManufacturerId);
properties.Add(SmbiosProperty.MemoryDevice.MemorySubsystemControllerProductId, MemorySubsystemControllerProductId);
properties.Add(SmbiosProperty.MemoryDevice.NonVolatileSize, NonVolatileSize);
properties.Add(SmbiosProperty.MemoryDevice.VolatileSize, VolatileSize);
properties.Add(SmbiosProperty.MemoryDevice.CacheSize, CacheSize);
properties.Add(SmbiosProperty.MemoryDevice.LogicalSize, LogicalSize);
}
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v33)
{
properties.Add(SmbiosProperty.MemoryDevice.ExtendedSpeed, ExtendedSpeed);
properties.Add(SmbiosProperty.MemoryDevice.ExtendedConfiguredMemorySpeed, ExtendedConfiguredSpeed);
}
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v37)
{
properties.Add(SmbiosProperty.MemoryDevice.PMIC0ManufacturerId, PMIC0ManufacturerId);
properties.Add(SmbiosProperty.MemoryDevice.PMIC0RevisionNumber, PMIC0RevisionNumber);
properties.Add(SmbiosProperty.MemoryDevice.RCDManufacturerId, RCDManufacturerId);
properties.Add(SmbiosProperty.MemoryDevice.RCDRevisionNumber, RCDRevisionNumber);
}
}
#endregion
#region BIOS Specification 3.7.0 (23/07/2023)
/// <summary>
/// Gets a string representing the device type.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// Device type.
/// </returns>
private static string GetDeviceType(byte code)
{
string[] deviceProperty =
{
"Other", // 0x01
"Unknown",
"DRAM",
"EDRAM",
"VRAM",
"SRAM",
"RAM",
"ROM",
"FLASH",
"EEPROM",
"FEPROM",
"EPROM",
"CDRAM",
"3DRAM",
"SDRAM",
"SGRAM",
"RDRAM",
"DDR",
"DDR2",
"DDR2 FB-DIMM" // 0x14
};
string[] deviceProperty2 =
{
"DDR3", // 0x18
"FBD2",
"DDR4",
"LPDDR",
"LPDDR2",
"LPDDR3",
"LPDDR4",
"Logical non-volatile device",
"HBM",
"HBM2",
"DDR5",
"LPDDR5",
"HBM3" // 0x24
};
if (code >= 0x01 && code <= 0x14)
{
return deviceProperty[code - 0x01];
}
if (code >= 0x18 && code <= 0x24)
{
return deviceProperty2[code - 0x18];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string representing the device type detail.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// Device type detail.
/// </returns>
private static ReadOnlyCollection<string> GetDeviceTypeDetail(int code)
{
string[] deviceProperty =
{
"Other", // 0x01
"Unknown",
"Fast-paged",
"Static column",
"Pseudo-static",
"RAMBUS",
"Synchronous",
"CMOS",
"EDO",
"Window DRAM",
"Cache DRAM",
"Non-volatile",
"Registered (Buffered)",
"Unbuffered (Unregistered)",
"LRDIMM " // 0x15
};
var items = new List<string>();
for (var i = 1; i <= 15; i++)
{
var bit = (byte)(i + 1);
var addDetail = code.CheckBit(bit);
if (addDetail)
{
items.Add(deviceProperty[i]);
}
}
return items.AsReadOnly();
}
/// <summary>
/// Gets a string that represents the shape of the device.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// A string that represents the shape of the device.
/// </returns>
private static string GetFormFactor(byte code)
{
string[] deviceProperty =
{
"Other", // 0x01
"Unknown",
"SIMM",
"SIP",
"Chip",
"DIP",
"ZIP",
"Propietary Card",
"DIMM",
"TSOP",
"Row of chips",
"RIMM",
"SODIMM",
"SRIMM",
"FB-DIMM",
"Die" // 0x10
};
if (code >= 0x01 && code <= 0x10)
{
return deviceProperty[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string that represents the memory type technology.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// A string that represents the memory type technology.
/// </returns>
private static string GetMemoryTechnology(byte code)
{
string[] deviceProperty =
{
"Other", // 0x01
"Unknown",
"DRAM",
"NVDIMM-N",
"NVDIMM-F",
"NVDIMM-P",
"Intel® Optane™ persistent memory" // 0x07
};
if (code >= 0x01 && code <= 0x07)
{
return deviceProperty[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a memory operating mode capability.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// A read-only collection of supported memory operating mode capabilities.
/// </returns>
private static ReadOnlyCollection<string> GetMemoryOperatingModeCapability(int code)
{
string[] capability =
{
"Reserved", // 0x00
"Other",
"Unknown",
"Volatile memory",
"Byte-accessible persistent memory",
"Block-accessible persistent memory", // 0x05
// Bit 0x06 - 0x0f Reserved (0)
};
var items = new List<string>();
for (byte i = 1; i <= 5; i++)
{
var addType = code.CheckBit(i);
if (addType)
{
items.Add(capability[i]);
}
}
return items.AsReadOnly();
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/PhysicalMemoryArrayHandle.md
# DmiProperty.MemoryDevice.PhysicalMemoryArrayHandle property
Gets a value representing the key to retrieve the property value.
Handle, or instance number, associated with the physical memory array to which this device belongs.
Key Composition
* Structure: MemoryDevice
* Property: PhysicalMemoryArrayHandle
* Unit: None
Return Value
Type: UInt16
Remarks
2.1+
```csharp
public static IPropertyKey PhysicalMemoryArrayHandle { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemEventLog/LogHeaderStartOffset.md
# DmiProperty.SystemEventLog.LogHeaderStartOffset property
Gets a value representing the key to retrieve the property value.
Defines the starting offset (or index) within the nonvolatile storage of the event-log’s header from the Access Method Address
Key Composition
* Structure: SystemEventLog
* Property: LogHeaderStartOffset
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey LogHeaderStartOffset { get; }
```
## See Also
* class [SystemEventLog](../DmiProperty.SystemEventLog.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.AdditionalInformation.Entry/ReferencedHandle.md
# DmiProperty.AdditionalInformation.Entry.ReferencedHandle property
Gets a value representing the key to retrieve the property value.
Handle, or instance number, associated with the structure for which additional information is provided.
Key Composition
* Structure: AdditionalInformation
* Property: ReferencedHandle
* Unit: None
Return Value
Type: UInt16
```csharp
public static IPropertyKey ReferencedHandle { get; }
```
## See Also
* class [Entry](../DmiProperty.AdditionalInformation.Entry.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Base/SmbiosBaseType.cs
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using iTin.Core;
using iTin.Core.ComponentModel;
using iTin.Core.Hardware.Common;
using iTin.Core.Helpers;
namespace iTin.Hardware.Specification.Smbios;
/// <summary>
/// The <b>SmbiosBaseType</b> class provides functions to analyze the properties associated with a structure <see cref="SMBIOS"/>.
/// </summary>
public abstract class SmbiosBaseType
{
#region private members
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string[] _strings;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private SmbiosPropertiesTable _smbiosPropertiesTable;
#endregion
#region constructor/s
/// <summary>
/// Initializes a new instance of the class <see cref="SmbiosBaseType"/> by specifying the Header of the structure and current SMBIOS.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Header of the current structure.</param>
/// <param name="smbiosVersion">Current SMBIOS version.</param>
protected SmbiosBaseType(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion)
{
SmbiosVersion = smbiosVersion;
StructureInfo = smbiosStructureHeaderInfo;
}
#endregion
#region public readonly properties
/// <summary>
/// Returns a list of implemented properties for this smbios structure.
/// </summary>
/// <returns>
/// A list of implemented properties for this structure.
/// </returns>
public IEnumerable<IPropertyKey> ImplementedProperties => Properties.Keys;
/// <summary>
/// Gets the raw information from this structure.
/// </summary>
/// <value>
/// A <see cref="SmbiosStructureHeaderInfo"/> object that contains the information.
/// </value>
public SmbiosStructureHeaderInfo StructureInfo { get; }
#endregion
#region internal readonly properties
/// <summary>
/// Gets the properties available for this structure.
/// </summary>
/// <value>
/// Availables properties.
/// </value>
internal SmbiosPropertiesTable Properties
{
get
{
if (_smbiosPropertiesTable != null)
{
return _smbiosPropertiesTable;
}
_smbiosPropertiesTable = new SmbiosPropertiesTable();
Parse(_smbiosPropertiesTable);
return _smbiosPropertiesTable;
}
}
#endregion
#region protected readonly properties
/// <summary>
/// Gets a reference to byte raw data reader
/// </summary>
/// <value>
/// Byte raw data reader.
/// </value>
protected ByteReader Reader => ByteReader.FromByteArray(StructureInfo.RawData);
/// <summary>
/// Gets the current version of <see cref="SMBIOS"/>.
/// </summary>
/// <value>
/// Value representing the current version of <see cref="SMBIOS"/>.
/// </value>
protected int SmbiosVersion { get; }
/// <summary>
/// Gets the strings associated with this structure.
/// </summary>
/// <value>
/// An array that contains the strings of this structure.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
protected string[] Strings => _strings ??= SmbiosHelper.ParseStrings(StructureInfo.RawData);
#endregion
#region public methods
/// <summary>
/// Returns the value of specified property. Always returns the first appearance of the property. If it does not exist, returns <b>null</b> (<b>Nothing</b> in visual basic).
/// </summary>
/// <param name="propertyKey">Key to the property to obtain</param>
/// <returns>
/// Reference to the object that represents the value of the property. Always returns the first appearance of the property.
/// </returns>
public object GetPropertyValue(IPropertyKey propertyKey)
{
var propertyType = propertyKey.GetPropertyType();
object result = Properties[propertyKey];
if (!(result is List<PropertyItem> itemList))
{
return result;
}
bool hasItems = itemList.Any();
if (!hasItems)
{
return propertyType.GetDefaultValue();
}
bool onlyOneItem = itemList.Count == 1;
if (onlyOneItem)
{
return itemList.FirstOrDefault().Value;
}
return propertyType.GetDefaultValue();
}
/// <summary>
/// Returns the the strongly typed value of specified property. Always returns the first appearance of the property. If it does not exist, returns <b>null</b> (<b>Nothing</b> in visual basic).
/// </summary>
/// <param name="propertyKey">Key to the property to obtain</param>
/// <returns>
/// Reference to the object that represents the strongly typed value of the property. Always returns the first appearance of the property.
/// </returns>
public T GetPropertyValue<T>(IPropertyKey propertyKey) => (T)GetPropertyValue(propertyKey);
#endregion
#region public override methods
/// <summary>
/// Returns a <see cref="string"/> that represents this instance.
/// </summary>
/// <returns>
/// A <see cref="string"/> that represents this instance.
/// </returns>
/// <remarks>
/// This method returns a string that includes the property <see cref="SmbiosStructureInfo.StructureType"/>.
/// </remarks>
public override string ToString() => $"Type = {StructureInfo.StructureType}";
#endregion
#region protected methods
/// <summary>
/// Returns the stored string from the specified byte.
/// </summary>
/// <param name="target">target byte</param>
/// <returns>
/// The value stored in the indicated byte.
/// </returns>
protected string GetString(byte target)
{
try
{
return Strings[Reader.GetByte(target)];
}
catch
{
return string.Empty;
}
}
/// <summary>
/// Parse and populates the property collection for this structure.
/// </summary>
/// <param name="properties">Collection of properties of this structure.</param>
protected void Parse(SmbiosPropertiesTable properties)
{
SentinelHelper.ArgumentNull(properties, nameof(properties));
PopulateProperties(properties);
}
#endregion
#region protected virtual methods
/// <summary>
/// Populates the property collection for this structure.
/// </summary>
/// <param name="properties">Collection of properties of this structure.</param>
protected virtual void PopulateProperties(SmbiosPropertiesTable properties)
{
}
#endregion
#region private members
//#region [private] (IDeviceProperty) GetTypedProperty(PropertyKey): Returns a reference to an object that implements the interface IDeviceProperty, represents the value of the property specified by its key by the parameter propertyKey.
///// <summary>
///// Returns a reference to an object that implements the interface <see cref="IDeviceProperty"/>, represents the value of the property specified by its key by the parameter <paramref name="propertyKey"/>.
///// </summary>
///// <param name="propertyKey">Key to the property to obtain</param>
///// <returns>
///// Interface that represents the value of the property.
///// </returns>
//private IDeviceProperty GetTypedProperty(PropertyKey propertyKey)
//{
// object propertyValue = GetValueTypedProperty(propertyKey);
// IDeviceProperty newTypedProperty = DevicePropertyFactory.CreateTypedDeviceProperty(propertyKey, propertyValue);
// return newTypedProperty;
//}
//#endregion
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Specific/ManagementControllerHostInterfaceProtocolRecord.cs
using System.Collections.ObjectModel;
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 042: Management Controller Host Interface. Protocol Record Data Format
// •———————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •———————————————————————————————————————————————————————————————————————————————————•
// | 00h Protocol Type BYTE ENUM Protocol types. |
// •———————————————————————————————————————————————————————————————————————————————————•
// | 01h Protocol Type BYTE N |
// | Specific Data Lenght |
// •———————————————————————————————————————————————————————————————————————————————————•
// | 02h Protocol Type N Varies |
// | Specific Data BYTEs |
// •———————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// This class represents an element of the structure <see cref="SmbiosType042"/>.
/// </summary>
public class ManagementControllerHostInterfaceProtocolRecord : SpecificSmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initialize a new instance of the class <see cref="ManagementControllerHostInterfaceProtocolRecord"/> specifying the structure information.
/// </summary>
/// <param name="protocolRecordDataArray">Untreated information of the current structure.</param>
internal ManagementControllerHostInterfaceProtocolRecord(byte[] protocolRecordDataArray) : base(protocolRecordDataArray)
{
}
#endregion
#region private readonly properties
/// <summary>
/// Gets a value that represents the '<b>Protocol Type</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string ProtocolType => GetProtocolType(GetByte(0x00));
/// <summary>
/// Gets a value representing the <b>Protocol Type Specific Data Lenght</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ProtocolTypeSpecificDataLenght => GetByte(0x01);
/// <summary>
/// Gets a value representing the <b>Protocol Type Specific Data</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ReadOnlyCollection<byte> ProtocolTypeSpecificData => new(GetBytes(0x02, ProtocolTypeSpecificDataLenght));
#endregion
#region public override methods
/// <summary>
/// Returns a class <see cref="string"/> that represents the current object.
/// </summary>
/// <returns>
/// Object <see cref="string"/> that represents the current <see cref="ManagementControllerHostInterfaceProtocolRecord"/> class.
/// </returns>
/// <remarks>
/// This method returns a string that includes the property <see cref="ProtocolType"/>.
/// </remarks>
public override string ToString() => $"Type = {ProtocolType}";
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
properties.Add(SmbiosProperty.ManagementControllerHostInterface.Protocol.ProtocolType, ProtocolType);
properties.Add(SmbiosProperty.ManagementControllerHostInterface.Protocol.ProtocolTypeSpecificData, ProtocolTypeSpecificData);
}
#endregion
#region BIOS Specification 3.2.0 (26/04/2018)
/// <summary>
/// Gets a string that allows you to identify the type of protocol.
/// </summary>
/// <param name="code">Target byte</param>
/// <returns>
/// Tipo de placa base.
/// </returns>
private static string GetProtocolType(byte code)
{
string[] value =
{
"IPMI", // 0x02
"MCTP",
"Redfish over IP", // 0x04
};
if (code == 0xf0)
{
return "OEM-defined";
}
if (code >= 0x02 && code <= 0x04)
{
return value[code - 0x02];
}
return SmbiosHelper.Reserved;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.ManagementControllerHostInterface/Protocols.md
# DmiProperty.ManagementControllerHostInterface.Protocols property
Gets a value representing the key to retrieve the property value.
A collection of possible values for the Protocol.
Key Composition
* Structure: ManagementControllerHostInterface
* Property: Protocols
* Unit: None
Return Value
Type: [`DmiManagementControllerHostInterfaceProtocolRecordsCollection`](../../iTin.Hardware.Specification.Dmi/DmiManagementControllerHostInterfaceProtocolRecordsCollection.md)
```csharp
public static IPropertyKey Protocols { get; }
```
## See Also
* class [ManagementControllerHostInterface](../DmiProperty.ManagementControllerHostInterface.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType002 [Baseboard (or Module) Information].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Baseboard (or Module) Information (Type 2) structure.<br/>
/// For more information, please see <see cref="SmbiosType002"/>.
/// </summary>
internal sealed class DmiType002 : DmiBaseType<SmbiosType002>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType002"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType002(SmbiosType002 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
object manufacturer = SmbiosStructure.GetPropertyValue(SmbiosProperty.BaseBoard.Manufacturer);
if (manufacturer != null)
{
properties.Add(DmiProperty.BaseBoard.Manufacturer, manufacturer);
}
object product = SmbiosStructure.GetPropertyValue(SmbiosProperty.BaseBoard.Product);
if (product != null)
{
properties.Add(DmiProperty.BaseBoard.Product, product);
}
object version = SmbiosStructure.GetPropertyValue(SmbiosProperty.BaseBoard.Version);
if (version != null)
{
properties.Add(DmiProperty.BaseBoard.Version, version);
}
object serialNumber = SmbiosStructure.GetPropertyValue(SmbiosProperty.BaseBoard.SerialNumber);
if (serialNumber != null)
{
properties.Add(DmiProperty.BaseBoard.SerialNumber, serialNumber);
}
if (SmbiosStructure.StructureInfo.Length >= 0x09)
{
object assetTag = SmbiosStructure.GetPropertyValue(SmbiosProperty.BaseBoard.AssetTag);
if (assetTag != null)
{
properties.Add(DmiProperty.BaseBoard.AssetTag, assetTag);
}
}
if (SmbiosStructure.StructureInfo.Length >= 0x0a)
{
object isHotSwappable = SmbiosStructure.GetPropertyValue(SmbiosProperty.BaseBoard.Features.IsHotSwappable);
if (isHotSwappable != null)
{
properties.Add(DmiProperty.BaseBoard.Features.IsHotSwappable, isHotSwappable);
}
object isReplaceable = SmbiosStructure.GetPropertyValue(SmbiosProperty.BaseBoard.Features.IsReplaceable);
if (isReplaceable != null)
{
properties.Add(DmiProperty.BaseBoard.Features.IsReplaceable, isReplaceable);
}
object isRemovable = SmbiosStructure.GetPropertyValue(SmbiosProperty.BaseBoard.Features.IsRemovable);
if (isRemovable != null)
{
properties.Add(DmiProperty.BaseBoard.Features.IsRemovable, isRemovable);
}
object requiredDaughterBoard = SmbiosStructure.GetPropertyValue(SmbiosProperty.BaseBoard.Features.RequiredDaughterBoard);
if (requiredDaughterBoard != null)
{
properties.Add(DmiProperty.BaseBoard.Features.RequiredDaughterBoard, requiredDaughterBoard);
}
object isHostingBoard = SmbiosStructure.GetPropertyValue(SmbiosProperty.BaseBoard.Features.IsHostingBoard);
if (isHostingBoard != null)
{
properties.Add(DmiProperty.BaseBoard.Features.IsHostingBoard, isHostingBoard);
}
}
if (SmbiosStructure.StructureInfo.Length >= 0x0b)
{
object locationInChassis = SmbiosStructure.GetPropertyValue(SmbiosProperty.BaseBoard.LocationInChassis);
if (locationInChassis != null)
{
properties.Add(DmiProperty.BaseBoard.LocationInChassis, locationInChassis);
}
}
if (SmbiosStructure.StructureInfo.Length >= 0x0c)
{
object chassisHandle = SmbiosStructure.GetPropertyValue(SmbiosProperty.BaseBoard.ChassisHandle);
if (chassisHandle != null)
{
properties.Add(DmiProperty.BaseBoard.ChassisHandle, chassisHandle);
}
}
if (SmbiosStructure.StructureInfo.Length >= 0x0d)
{
object boardType = SmbiosStructure.GetPropertyValue(SmbiosProperty.BaseBoard.BoardType);
if (boardType != null)
{
properties.Add(DmiProperty.BaseBoard.BoardType, boardType);
}
}
if (SmbiosStructure.StructureInfo.Length >= 0x0e)
{
object numberOfContainedObjectHandles = SmbiosStructure.GetPropertyValue(SmbiosProperty.BaseBoard.NumberOfContainedObjectHandles);
if (numberOfContainedObjectHandles != null)
{
properties.Add(DmiProperty.BaseBoard.NumberOfContainedObjectHandles, numberOfContainedObjectHandles);
}
object containedElements = SmbiosStructure.GetPropertyValue(SmbiosProperty.BaseBoard.ContainedElements);
if (containedElements != null)
{
properties.Add(DmiProperty.BaseBoard.ContainedElements, containedElements);
}
}
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemSlots.md
# DmiProperty.SystemSlots class
Contains the key definitions available for a type 009 [SystemSlots] structure.
```csharp
public static class SystemSlots
```
## Public Members
| name | description |
| --- | --- |
| static [BusDeviceFunction](DmiProperty.SystemSlots/BusDeviceFunction.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Characteristics](DmiProperty.SystemSlots/Characteristics.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [CurrentUsage](DmiProperty.SystemSlots/CurrentUsage.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [PeerDevices](DmiProperty.SystemSlots/PeerDevices.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SegmentBusFunction](DmiProperty.SystemSlots/SegmentBusFunction.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SlotDataBusWidth](DmiProperty.SystemSlots/SlotDataBusWidth.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SlotDesignation](DmiProperty.SystemSlots/SlotDesignation.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SlotId](DmiProperty.SystemSlots/SlotId.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SlotInformation](DmiProperty.SystemSlots/SlotInformation.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SlotLength](DmiProperty.SystemSlots/SlotLength.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SlotPhysicalWidth](DmiProperty.SystemSlots/SlotPhysicalWidth.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SlotPitch](DmiProperty.SystemSlots/SlotPitch.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SlotType](DmiProperty.SystemSlots/SlotType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static class [Peers](DmiProperty.SystemSlots.Peers.md) | Contains the key definition for the Peers section. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType015 [System Event Log].cs
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using iTin.Core;
using iTin.Core.Helpers.Enumerations;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 015: System Event Log.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.0+ Type BYTE 15 Event Log Type Indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.0+ Length BYTE Varies 14h for version 2.0 |
// | 17h + (x * y) for version 2.1 and later |
// | Where: |
// | x = offset 15h |
// | y = offset 16h |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 2.0+ Handle WORD Varies The handle, or instance number, associated|
// | with the structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 2.0+ Log Area WORD Varies The length, in bytes, of the overall event|
// | Length log area, from the first byte of header |
// | to the last byte of data. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h 2.0+ Log Header WORD Varies Defines the starting offset (or index) |
// | within the nonvolatile storage of the |
// | event-log’s header, from the Access Method|
// | Address. |
// | For singlebyte indexed I/O accesses, the |
// | mostsignificant byte of the start offset |
// | is set to 00h. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h 2.0+ Log Data Start WORD Varies Defines the starting offset (or index) |
// | within the nonvolatile storage of the |
// | event-log’s first data byte, from the |
// | Access Method Address. |
// | For single-byte indexed I/O accesses, the |
// | most-significant byte of the start offset |
// | is set to 00h. |
// | NOTE: The data directly follows any header|
// | information. Therefore, the header |
// | length can be determined by |
// | subtracting the Header Start Offset |
// | from the Data Start Offset. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ah 2.0+ Access BYTE Varies Defines the Location and Method used by |
// | Method higher-level software to access the log |
// | area, one of: |
// | 00h Indexed I/O: 1 8-bit index port, |
// | 1 8-bit data port. |
// | The Access Method Address field |
// | contains the 16-bit I/O addresses for |
// | the index and data ports. |
// | |
// | 01h Indexed I/O: 2 8-bit index ports, |
// | 1 8-bit data port. |
// | The Access Method Address field |
// | contains the 16-bit I/O address for |
// | the index and data ports. |
// | |
// | 02h Indexed I/O: 1 16-bit index ports, |
// | 1 8-bit data port. |
// | The Access Method Address field |
// | contains the 16-bit I/O address for |
// | the index and data ports. |
// | |
// | 03h Memory-mapped physical 32-bit |
// | address. The Access Method Address |
// | field contains the 4-byte (Intel DWORD|
// | format) starting physical address. |
// | |
// | 04h Available through General-Purpose |
// | NonVolatile Data functions. |
// | The Access Method Address field |
// | contains the 2-byte (Intel WORD |
// | format) GPNV handle. |
// | |
// | 05h-7Fh Available for future assignment |
// | by this specification |
// | |
// | 80h-FFh BIOS Vendor/OEM-specific |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Bh 2.0+ Log Status BYTE Varies This bit-field describes the current |
// | status of the system event-log: |
// | Bits 07:02 Reserved, set to 0s |
// | Bit 01 Log area full, if 1 |
// | Bit 00 Log area valid, if 1 |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ch 2.0+ Log Change DWORD Varies Unique token that is reassigned every time|
// | Token the event log changes. Can be used to |
// | determine if additional events have |
// | occurred since the last time the log was |
// | read. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 10h 2.0+ Access DWORD Varies The address associated with the access |
// | Method method; the data present depends on the |
// | Address Access Method field value. |
// | The area’s format can be described by the |
// | following 1-bytepacked ‘C’ union: |
// | |
// | union |
// | { |
// | struct |
// | { |
// | short IndexAddr; |
// | short DataAddr; |
// | } IO; |
// | long PhysicalAddr32; |
// | short GPNVHandle; |
// | } AccessMethodAddress; |
// | |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 14h 2.1+ Log Header BYTE ENUM Identifies the format of the log header |
// | Format area. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 15h 2.1+ Number of BYTE Varies Number of supported event log type |
// | Supported descriptors that follow. If the value |
// | Log Type is 0, the list that starts at offset 17h |
// | Descriptors is not present. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 16h 2.1+ Length of BYTE 2 Identifies the number of bytes associated |
// | each Log with each type entry in the list below. |
// | Type The value is currently “hard-coded” as 2, |
// | Descriptor (y) because each entry consists of two bytes. |
// | This field’s presence allows future |
// | Software that interprets the following |
// | list should not assume a list entry’s |
// | length. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 17h to 2.1+ List of Varies Varies Contains a list of Event Log Type |
// | 17h + Supported Descriptors, as long as the value |
// | (x*y)-1 Event Log specified in offset 15h is non-zero. |
// | Type |
// | Descriptors |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the System Event Log (Type 15) structure.
/// </summary>
internal sealed class SmbiosType015 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType015"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType015(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Log Area Length</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int LogAreaLength => Reader.GetWord(0x04);
/// <summary>
/// Gets a value representing the <b>Log Header Start Offset</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int LogHeaderStartOffset => Reader.GetWord(0x06);
/// <summary>
/// Gets a value representing the <b>Data Start Offset</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int DataStartOffset => Reader.GetWord(0x08);
/// <summary>
/// Gets a value representing the <b>Access Method</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte AccessMethod => Reader.GetByte(0x10);
/// <summary>
/// Gets a value representing the <b>Log Status</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte LogStatus => Reader.GetByte(0x0b);
/// <summary>
/// Gets a value representing the <b>Access Method Address</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int AccessMethodAddress => Reader.GetDoubleWord(0x10);
/// <summary>
/// Gets a value representing the <b>Log Change Token</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int LogChangeToken => Reader.GetDoubleWord(0x0c);
/// <summary>
/// Gets a value representing the <b>Log Header Format</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte LogHeaderFormat => Reader.GetByte(0x14);
/// <summary>
/// Gets a value representing the <b>Supported Log Type Descriptors</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte SupportedLogTypeDescriptors => Reader.GetByte(0x15);
/// <summary>
/// Gets a value representing the <b>Length Type Descriptor</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte LengthTypeDescriptor => Reader.GetByte(0x16);
/// <summary>
/// Gets a value representing the <b>List Supported Event Log Type Descriptors</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ListSupportedEventLogTypeDescriptors => Reader.GetByte(0x17);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
#region 2.0+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v20)
{
properties.Add(SmbiosProperty.SystemEventLog.LogAreaLength, LogAreaLength);
properties.Add(SmbiosProperty.SystemEventLog.LogHeaderStartOffset, LogHeaderStartOffset);
properties.Add(SmbiosProperty.SystemEventLog.DataStartOffset, DataStartOffset);
properties.Add(SmbiosProperty.SystemEventLog.AccessMethod, GetAccessMethod(AccessMethod));
properties.Add(SmbiosProperty.SystemEventLog.LogStatus, GetLogStatus(LogStatus));
if (AccessMethod <= 0x04)
{
properties.Add(SmbiosProperty.SystemEventLog.AccessMethodAddress, GetAccessMethodAddress(AccessMethod, AccessMethodAddress));
}
properties.Add(SmbiosProperty.SystemEventLog.LogChangeToken, $"{LogChangeToken:X}");
}
#endregion
#region 2.1+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v21)
{
properties.Add(SmbiosProperty.SystemEventLog.LogHeaderFormat, GetLogHeaderFormat(LogHeaderFormat));
properties.Add(SmbiosProperty.SystemEventLog.SupportedLogTypeDescriptors, SupportedLogTypeDescriptors);
var n = SupportedLogTypeDescriptors * LengthTypeDescriptor;
if (StructureInfo.Length > 0x17 + n)
{
properties.Add(SmbiosProperty.SystemEventLog.ListSupportedEventLogTypeDescriptors, GetListSupportedEventLogTypeDescriptors(Reader.Data.Extract(0x17, n - 1).ToArray()));
}
}
#endregion
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
private static string GetAccessMethod(byte code)
{
string[] methods =
{
"Indexed I/O, one 8-bit index port, one 8-bit data port", // 0x00
"Indexed I/O, two 8-bit index ports, one 8-bit data port",
"Indexed I/O, one 16-bit index port, one 8-bit data port",
"Memory-mapped physical 32-bit address",
"General-purpose non-volatile data functions" // 0x04
};
if (code <= 0x04)
{
return methods[code];
}
if (code >= 0x08)
{
return "OEM-specific";
}
return SmbiosHelper.OutOfSpec;
}
private static string GetLogStatus(byte code)
{
var valid = code.CheckBit(Bits.Bit00) ? "Valid" : "Invalid";
var area = code.CheckBit(Bits.Bit01) ? "Full" : "Not Full";
return $"{valid} {area}";
}
private static string GetAccessMethodAddress(byte method, int value)
{
switch (method)
{
case 0x00:
case 0x01:
case 0x02:
{
var valueArray = value.ToArray();
var data = valueArray[0];
var index = valueArray[1];
return $"Index {index:X}, Data {data:X}";
}
case 0x03:
return $"{value:X}";
case 0x04:
{
var valueArray = value.ToArray();
var handle = valueArray[0];
return $"{handle:X}";
}
default:
return SmbiosHelper.Unknown;
}
}
private static string GetLogHeaderFormat(byte code)
{
string[] types =
{
"No Header", // 0x00
"Type 1" // 0x01
};
if (code <= 0x01)
{
return types[code];
}
if (code >= 0x80)
{
return "OEM-specific";
}
return SmbiosHelper.OutOfSpec;
}
private static SupportedEventLogTypeDescriptorsCollection GetListSupportedEventLogTypeDescriptors(byte[] data)
{
var items = new Collection<SupportedEventLogTypeDescriptorElement>();
for (var i = 0; i < data.Length; i += 2)
{
items.Add(new SupportedEventLogTypeDescriptorElement(data.Extract(i, 2).ToArray()));
}
return new SupportedEventLogTypeDescriptorsCollection(items);
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor.Voltage.md
# DmiProperty.Processor.Voltage class
Contains the key definition for the Voltage section.
```csharp
public static class Voltage
```
## Public Members
| name | description |
| --- | --- |
| static [IsLegacyMode](DmiProperty.Processor.Voltage/IsLegacyMode.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SupportedVoltages](DmiProperty.Processor.Voltage/SupportedVoltages.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [Processor](./DmiProperty.Processor.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType040 [Additional Information].cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using iTin.Core;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios
{
// Type 040: Additional Information.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 40 Additional Information type |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE Varies Length of the structure, a minimum of 0Bh |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Number of BYTE Varies The number of Additional Information Entries that |
// | Additional follow |
// | Information NOTE: See Count |
// | entries (n) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Additional Varies Varies Additional Information entries. |
// | Information |
// | entries |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Additional Information (Type 40) structure.
/// </summary>
internal sealed class SmbiosType040 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType040"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType040(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Count</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Count => Reader.GetByte(0x04);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.Latest)
{
return;
}
byte n = Count;
if (n == 0x00)
{
return;
}
byte[] containedElementsArray = StructureInfo.RawData.Extract(0x05, n * 6).ToArray();
IEnumerable<AdditionalInformationEntry> containedElements = GetContainedElements(containedElementsArray, n);
properties.Add(SmbiosProperty.AdditionalInformation.Entries, new AdditionalInformationEntryCollection(containedElements));
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets the list of additional entries.
/// </summary>
/// <param name="rawValueArray">Raw information.</param>
/// <param name="n">Number of items to be treated.</param>
/// <returns>
/// Item collection.
/// </returns>
private static IEnumerable<AdditionalInformationEntry> GetContainedElements(byte[] rawValueArray, byte n)
{
int m = rawValueArray.Length / n;
var containedElements = new Collection<AdditionalInformationEntry>();
for (int i = 0; i < rawValueArray.Length; i += m)
{
byte[] value = new byte[m];
Array.Copy(rawValueArray, i, value, 0, m);
containedElements.Add(new AdditionalInformationEntry(value));
}
return containedElements;
}
#endregion
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiStructureCollection.md
# DmiStructureCollection class
Represents a collection of [`DmiStructure`](./DmiStructure.md) objects implemented in [`DMI`](../iTin.Hardware.Specification/DMI.md).
```csharp
public sealed class DmiStructureCollection : ReadOnlyCollection<DmiStructure>
```
## Public Members
| name | description |
| --- | --- |
| [Item](DmiStructureCollection/Item.md) { get; } | Gets the element with the specified key. |
| [Contains](DmiStructureCollection/Contains.md)(…) | Determines whether the element with the specified key is in the collection. |
| [GetProperties](DmiStructureCollection/GetProperties.md)(…) | Returns a Result that contains the result of the operation. |
| [GetProperty](DmiStructureCollection/GetProperty.md)(…) | Returns a Result that contains the result of the operation. Always returns the first appearance of the property |
| [IndexOf](DmiStructureCollection/IndexOf.md)(…) | Returns the index of the object with the key specified in the collection |
## See Also
* class [DmiStructure](./DmiStructure.md)
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemSlots/Characteristics.md
# DmiProperty.SystemSlots.Characteristics property
Gets a value representing the key to retrieve the property value.
Slot characteristics.
Key Composition
* Structure: SystemSlots
* Property: SlotCharacteristics
* Unit: None
Return Value
Type: ReadOnlyCollection where T is String
Remarks
2.0+, 2.1+
```csharp
public static IPropertyKey Characteristics { get; }
```
## See Also
* class [SystemSlots](../DmiProperty.SystemSlots.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor/CoreCount2.md
# DmiProperty.Processor.CoreCount2 property
Gets a value representing the key to retrieve the property value.
Number of cores per processor socket. Supports core counts >255. If this field is present, it holds the core count for the processor socket. Core Count will also hold the core count, except for core counts that are 256 or greater. In that case, core Count shall be set to FFh and core Count 2 will hold the count.
Key Composition
* Structure: Processor
* Property: CoreCount2
* Unit: None
Return Value
Type: UInt16
Remarks
3.0+
```csharp
public static IPropertyKey CoreCount2 { get; }
```
## See Also
* class [Processor](../DmiProperty.Processor.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType040 [Additional Information].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Additional Information (Type 40) structure.<br/>
/// For more information, please see <see cref="SmbiosType040"/>.
/// </summary>
internal sealed class DmiType040: DmiBaseType<SmbiosType040>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType040"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType040(SmbiosType040 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion < DmiStructureVersion.Latest)
{
return;
}
properties.Add(DmiProperty.AdditionalInformation.Entries, new DmiAdditionalInformationEntryCollection((AdditionalInformationEntryCollection)SmbiosStructure.GetPropertyValue(SmbiosProperty.AdditionalInformation.Entries)));
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType024 [Hardware Security].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Hardware Security (Type 24) structure.<br/>
/// For more information, please see <see cref="SmbiosType024"/>.
/// </summary>
internal sealed class DmiType024 : DmiBaseType<SmbiosType024>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType024"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType024(SmbiosType024 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion < DmiStructureVersion.Latest)
{
return;
}
properties.Add(DmiProperty.HardwareSecurity.HardwareSecuritySettings.FrontPanelResetStatus, SmbiosStructure.GetPropertyValue(SmbiosProperty.HardwareSecurity.HardwareSecuritySettings.FrontPanelResetStatus));
properties.Add(DmiProperty.HardwareSecurity.HardwareSecuritySettings.AdministratorPasswordStatus, SmbiosStructure.GetPropertyValue(SmbiosProperty.HardwareSecurity.HardwareSecuritySettings.AdministratorPasswordStatus));
properties.Add(DmiProperty.HardwareSecurity.HardwareSecuritySettings.KeyboardPasswordStatus, SmbiosStructure.GetPropertyValue(SmbiosProperty.HardwareSecurity.HardwareSecuritySettings.KeyboardPasswordStatus));
properties.Add(DmiProperty.HardwareSecurity.HardwareSecuritySettings.PowerOnPasswordStatus, SmbiosStructure.GetPropertyValue(SmbiosProperty.HardwareSecurity.HardwareSecuritySettings.PowerOnPasswordStatus));
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType012 [System Configuration Options].cs
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 012: System Configuration Options.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 12 Configuration Information Indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE 05h |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Count BYTE Varies Strings number |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the System Configuration Options (Type 12) structure.
/// </summary>
internal sealed class SmbiosType012 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType012"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType012(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Count</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int Count => Reader.GetByte(0x04);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
int count = Count;
if (count != 0)
{
properties.Add(SmbiosProperty.SystemConfigurationOptions.Values, GetValues(count));
}
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets a collection with system information.
/// </summary>
/// <param name="count">Counter.</param>
/// <returns>
/// A collection with system information.
/// </returns>
private ReadOnlyCollection<string> GetValues(int count)
{
List<string> items = new List<string>();
for (int i = 1; i <= count; i++)
{
items.Add(Strings[i]);
}
return items.AsReadOnly();
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/TotalWidth.md
# DmiProperty.MemoryDevice.TotalWidth property
Gets a value representing the key to retrieve the property.
Total width, in bits, of this memory device, including any check or error-correction bits.
Key Composition
* Structure: MemoryDevice
* Property: TotalWidth
* Unit: Bits
Return Value
Type: UInt16
Remarks
2.1+
```csharp
public static IPropertyKey TotalWidth { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BootIntegrityServicesEntryPoint/Checksum.md
# DmiProperty.BootIntegrityServicesEntryPoint.Checksum property
Gets a value representing the key to retrieve the property value.
Checksum.
Key Composition
* Structure: BootIntegrityServicesEntryPoint
* Property: Checksum
* Unit: None
Return Value
Type: Byte
```csharp
public static IPropertyKey Checksum { get; }
```
## See Also
* class [BootIntegrityServicesEntryPoint](../DmiProperty.BootIntegrityServicesEntryPoint.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BootIntegrityServicesEntryPoint/BisEntryPointAddress16.md
# DmiProperty.BootIntegrityServicesEntryPoint.BisEntryPointAddress16 property
Gets a value representing the key to retrieve the property value.
Entry point address bis 16bits.
Key Composition
* Structure: BootIntegrityServicesEntryPoint
* Property: BisEntryPointAddress16
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey BisEntryPointAddress16 { get; }
```
## See Also
* class [BootIntegrityServicesEntryPoint](../DmiProperty.BootIntegrityServicesEntryPoint.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiGroupAssociationElementCollection.md
# DmiGroupAssociationElementCollection class
Represents a collection of [`DmiGroupAssociationElement`](./DmiGroupAssociationElement.md).
```csharp
public sealed class DmiGroupAssociationElementCollection :
ReadOnlyCollection<DmiGroupAssociationElement>
```
## Public Members
| name | description |
| --- | --- |
| [DmiGroupAssociationElementCollection](DmiGroupAssociationElementCollection/DmiGroupAssociationElementCollection.md)(…) | Initialize a new instance of the class [`DmiGroupAssociationElementCollection`](./DmiGroupAssociationElementCollection.md). |
| override [ToString](DmiGroupAssociationElementCollection/ToString.md)() | Returns a class String that represents the current object. |
## See Also
* class [DmiGroupAssociationElement](./DmiGroupAssociationElement.md)
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor/MaximumSpeed.md
# DmiProperty.Processor.MaximumSpeed property
Gets a value representing the key to retrieve the property value.
Maximum processor speed (in MHz) supported by the system for this processor socket 0E9h is for a 233 MHz processor. If the value is unknown, the field is set to 0.
Key Composition
* Structure: Processor
* Property: MaximumSpeed
* Unit: MHz
Return Value
Type: UInt16
Remarks
2.0+
```csharp
public static IPropertyKey MaximumSpeed { get; }
```
## See Also
* class [Processor](../DmiProperty.Processor.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.TemperatureProbe/Tolerance.md
# DmiProperty.TemperatureProbe.Tolerance property
Gets a value representing the key to retrieve the property value.
Tolerance for reading from this probe, in plus/minus 1/10th ºC.
Key Composition
* Structure: TemperatureProbe
* Property: Tolerance
* Unit: DegreeCentigrade
Return Value
Type: UInt16
```csharp
public static IPropertyKey Tolerance { get; }
```
## See Also
* class [TemperatureProbe](../DmiProperty.TemperatureProbe.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/ConfiguredMemoryClockSpeed.md
# DmiProperty.MemoryDevice.ConfiguredMemoryClockSpeed property
Gets a value representing the key to retrieve the property.
Memory speed is expressed in megatransfers per second (MT/s). Previous revisions (3.0.0 and earlier) of this specification used MHz to indicate clock speed.With double data rate memory, clock speed is distinct from transfer rate, since data is transferred on both the rising and the falling edges of the clock signal. This maintains backward compatibility with observed DDR implementations prior to this revision, which already reported transfer rate instead of clock speed, e.g., DDR4-2133 (PC4-17000) memory was reported as 2133 instead of 1066.
Key Composition
* Structure: MemoryDevice
* Property: ConfiguredMemoryClockSpeed
* Unit: Variable
Return Value
Type: UInt16
Remarks
2.7+
```csharp
public static IPropertyKey ConfiguredMemoryClockSpeed { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.OutOfBandRemote.md
# DmiProperty.OutOfBandRemote class
Contains the key definitions available for a type 030 [OutOfBandRemote] structure.
```csharp
public static class OutOfBandRemote
```
## Public Members
| name | description |
| --- | --- |
| static [Manufacturer](DmiProperty.OutOfBandRemote/Manufacturer.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static class [Connections](DmiProperty.OutOfBandRemote.Connections.md) | Contains the key definition for the Connections And Status section. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS.cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using iTin.Core;
using iTin.Core.Hardware.Abstractions.Specification.Smbios;
using iTin.Core.Helpers;
using iTin.Hardware.Abstractions.Specification.Smbios;
using iTin.Hardware.Specification.Smbios;
namespace iTin.Hardware.Specification;
/// <summary>
/// System Management BIOS (SMBIOS).<br/>
/// Standard format of the data collected by the BIOS. SMBIOS defines this information in a series of data tables,<br/>
/// where information about system components such as memory, peripheral devices, expansion cards, inventory label<br/>
/// and operating system is collected.
/// </summary>
public sealed class SMBIOS
{
#region private readonly members
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly byte _majorVersion;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly byte _minorVersion;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly ISmbiosConnectOptions _options;
#endregion
#region private members
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private IEnumerable<byte[]> _rawTables;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ReadOnlyCollection<SmbiosStructure> _implementedStructures;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private Dictionary<SmbiosStructure, ICollection<byte[]>> _rawStructures;
#endregion
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SMBIOS"/> class.
/// </summary>
/// <remarks>
/// Retrieves the <b>SMBIOS</b> information by <b>WMI</b> or native call.
/// </remarks>
private SMBIOS() : this(null)
{
}
/// <summary>
/// Prevents a default instance of the <see cref="SMBIOS"/> class from being created. Retrieves the <see cref="SMBIOS"/> information by WMI.
/// </summary>
private SMBIOS(ISmbiosConnectOptions options)
{
_options = options;
var rawSmbiosTable = SmbiosOperations.Instance.GetSmbiosDataArray(options);
if (rawSmbiosTable.Length > 0)
{
_majorVersion = rawSmbiosTable[0x01];
_minorVersion = rawSmbiosTable[0x02];
Lenght = rawSmbiosTable.Length - 0x08;
byte[] smbiosData = rawSmbiosTable.Extract(0x08, Lenght).ToArray();
ToRawTables(smbiosData);
}
}
#endregion
#region public static readonly properties
/// <summary>
/// Gets a instance of this class.
/// </summary>
/// <value>
/// A <see cref="SMBIOS"/> reference instance.
/// </value>
[Obsolete("please use the SMBIOS.CreateInstance() method instead of SMBIOS.Instance for local SMBIOS instance. For remote instance use SMBIOS.CreateInstance(SmbiosConnectOptions)")]
public static readonly SMBIOS Instance = new SMBIOS();
#endregion
#region public readonly properties
/// <summary>
/// Gets the list of implemented structures.
/// </summary>
public ReadOnlyCollection<SmbiosStructure> ImplementedStructures
{
get
{
_implementedStructures = GetImplementedStructureKeys();
return _implementedStructures;
}
internal set => _implementedStructures = value;
}
/// <summary>
/// Gets a value that contains the length of all <b>SMBIOS</b> tables.
/// </summary>
/// <value>
/// Length of all <b>SMBIOS</b> tables
/// </value>
public int Lenght { get; }
/// <summary>
/// Gets a value that contains the version of <b>SMBIOS</b>.
/// </summary>
/// <value>
/// Version of <b>SMBIOS</b> in decimal notation.
/// </value>
public int Version => LogicHelper.Word(_minorVersion, _majorVersion);
#endregion
#region private readonly properties
/// <summary>
/// Gets the structures grouped by raw type.
/// </summary>
/// <value>>
/// Dictionary with unprocessed structures grouped by type.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private Dictionary<SmbiosStructure, ICollection<byte[]>> RawStructures => _rawStructures ??= new Dictionary<SmbiosStructure, ICollection<byte[]>>();
#endregion
#region public methods
/// <summary>
/// Gets the data of the specified structure.
/// </summary>
/// <param name="structure">Structure to be recovered.</param>
/// <returns>
/// Collection of structures.
/// </returns>
public SmbiosStructureCollection Get(SmbiosStructure structure)
{
var implementedStructure = ImplementedStructures.Contains(structure);
if (!implementedStructure)
{
return null;
}
var cache = SmbiosStructuresCache.Cache;
var structureInfo = new SmbiosStructureInfo(this, structure);
return cache.Get(structureInfo);
}
#endregion
#region internal methods
/// <summary>
/// Returns the list of structure(s) of the specified type.
/// </summary>
/// <param name="structure">Reference structure.</param>
/// <returns>
/// An enumerator, which supports a simple iteration in the collection.
/// </returns>
internal IEnumerable<byte[]> GetAllRawTablesFrom(SmbiosStructure structure)
{
ReadOnlyCollection<SmbiosStructure> implementedStructures = GetImplementedStructureKeys();
var ok = implementedStructures.Contains(structure);
return !ok
? null
: RawStructures[structure];
}
#endregion
#region public static methods
/// <summary>
/// Gets a unique instance of this class for remote machine.<br/>
/// If <paramref name="options"/> is <b>null</b> (<b>Nothing</b> in Visual Basic) always returns an instance for this machine.
/// </summary>
/// <value>
/// A unique <see cref="SMBIOS"/> reference that contains <b>DMI</b> information.
/// </value>
public static SMBIOS CreateInstance(ISmbiosConnectOptions options = null) => options == null ? new SMBIOS() : new SMBIOS(options);
#endregion
#region public override methods
/// <summary>
/// Returns a <see cref="string"/> that represents this instance.
/// </summary>
/// <returns>A <see cref="string"/> that represents this instance.</returns>
/// <remarks>
/// The <see cref="ToString()"/> method returns a string that includes the version expresed in hexadecimal format,
/// the number of available structures, and the total length occupied by all structures.
/// </remarks>
public override string ToString()
{
if (_options == null)
{
return $"Version={Version:X}, Structures={ImplementedStructures.Count}, Lenght={Lenght}";
}
if (Version == 0 && ImplementedStructures.Count == 0 && Lenght == 0)
{
return $"Unable connect to remote machine '{_options.MachineNameOrIpAddress}'";
}
return $"Version={Version:X}, Structures={ImplementedStructures.Count}, Lenght={Lenght}";
}
#endregion
#region private methods
/// <summary>
/// Returns the list with the keys of implemented structures.
/// </summary>
/// <value>
/// List of structures implemented.
/// </value>
private ReadOnlyCollection<SmbiosStructure> GetImplementedStructureKeys()
{
return
RawStructures
.OrderBy(structure => structure.Key)
.Select(rawStructure => rawStructure.Key)
.ToList()
.AsReadOnly();
}
/// <summary>
/// Returns the structures grouped by unprocessed type.
/// </summary>
/// <param name="data">Structures not processed without grouping.</param>
private void ToRawStructures(IEnumerable<byte[]> data)
{
if (RawStructures.Count != 0)
{
RawStructures.Clear();
}
foreach (var rawTable in data)
{
if(rawTable.Length<3)
{
continue;
}
var structureType = (SmbiosStructure)rawTable[0];
if (RawStructures.TryGetValue(structureType, out var structure))
{
structure.Add(rawTable);
}
else
{
RawStructures.Add(structureType, new List<byte[]> { rawTable });
}
}
}
/// <summary>
/// Returns all the SMBIOS tables unprocessed.
/// </summary>
/// <param name="rawSmbiosTable">Array with raw <b>SMBIOS</b> data.</param>
private void ToRawTables(byte[] rawSmbiosTable)
{
var i = 0;
var exit = false;
var smbiosTables = new Collection<byte[]>();
while (!exit)
{
var firstByte = i;
for (i = firstByte + rawSmbiosTable[i + 1]; i < rawSmbiosTable.Length; i++)
{
if (rawSmbiosTable[i] != 0x00 || rawSmbiosTable[i + 1] != 0x00)
{
continue;
}
i += 2;
var lastByte = i;
if (rawSmbiosTable[firstByte] <= 0x7F)
{
var aTable = new byte[lastByte - firstByte];
Array.Copy(rawSmbiosTable, firstByte, aTable, 0, lastByte - firstByte);
smbiosTables.Add(aTable);
}
break;
}
if (i == rawSmbiosTable.Length)
{
exit = true;
}
}
//RawData = rawSmbiosTable;
_rawTables = smbiosTables;
ToRawStructures(_rawTables);
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.md
# DmiProperty class
Defines available keys for the available devices of a system.
```csharp
public static class DmiProperty
```
## Public Members
| name | description |
| --- | --- |
| static class [AdditionalInformation](DmiProperty.AdditionalInformation.md) | Contains the key definitions available for a type 040 [AdditionalInformation] structure. |
| static class [BaseBoard](DmiProperty.BaseBoard.md) | Contains the key definitions available for a type 002 [BaseBoard (or Module) Information] structure. |
| static class [Bios](DmiProperty.Bios.md) | Contains the key definitions available for a type 000 [Bios Information] structure. |
| static class [BiosLanguage](DmiProperty.BiosLanguage.md) | Contains the key definitions available for a type 013 [BiosLanguage Information] structure. |
| static class [BitMemoryError32](DmiProperty.BitMemoryError32.md) | Contains the key definitions available for a type 018 [BitMemoryError32 Information] structure. |
| static class [BitMemoryError64](DmiProperty.BitMemoryError64.md) | Contains the key definitions available for a type 033 [BitMemoryError64] structure. |
| static class [BootIntegrityServicesEntryPoint](DmiProperty.BootIntegrityServicesEntryPoint.md) | Contains the key definitions available for a type 031 [BootIntegrityServicesEntryPoint] structure. |
| static class [BuiltInPointingDevice](DmiProperty.BuiltInPointingDevice.md) | Contains the key definitions available for a type 021 [BuiltInPointingDevice] structure. |
| static class [Cache](DmiProperty.Cache.md) | Contains the key definitions available for a type 007 [Cache Information] structure. |
| static class [Chassis](DmiProperty.Chassis.md) | Contains the key definitions available for a type 003 [SystemEnclosure Information] structure. |
| static class [CoolingDevice](DmiProperty.CoolingDevice.md) | Contains the key definitions available for a type 027 [CoolingDevice] structure. |
| static class [ElectricalCurrentProbe](DmiProperty.ElectricalCurrentProbe.md) | Contains the key definitions available for a type 029 [ElectricalCurrentProbe] structure. |
| static class [EndOfTable](DmiProperty.EndOfTable.md) | Contains the key definitions available for a type 127 [EndOfTable] structure. |
| static class [FirmwareInventoryInformation](DmiProperty.FirmwareInventoryInformation.md) | Contains the key definitions available for a type 045 [FirmwareInventoryInformation] structure. |
| static class [GroupAssociations](DmiProperty.GroupAssociations.md) | Contains the key definitions available for a type 014 [GroupAssociations] structure. |
| static class [HardwareSecurity](DmiProperty.HardwareSecurity.md) | Contains the key definitions available for a type 024 [HardwareSecurity] structure. |
| static class [Inactive](DmiProperty.Inactive.md) | Contains the key definitions available for a type 126 [Inactive] structure. |
| static class [IpmiDevice](DmiProperty.IpmiDevice.md) | Contains the key definitions available for a type 038 [IpmiDevice Information] structure. |
| static class [ManagementControllerHostInterface](DmiProperty.ManagementControllerHostInterface.md) | Contains the key definitions available for a type 042 [ManagementControllerHostInterface] structure. |
| static class [ManagementDevice](DmiProperty.ManagementDevice.md) | Contains the key definitions available for a type 034 [ManagementDevice] structure. |
| static class [ManagementDeviceComponent](DmiProperty.ManagementDeviceComponent.md) | Contains the key definitions available for a type 035 [ManagementDeviceComponent] structure. |
| static class [ManagementDeviceThresholdData](DmiProperty.ManagementDeviceThresholdData.md) | Contains the key definitions available for a type 036 [ManagementDeviceThresholdData] structure. |
| static class [MemoryArrayMappedAddress](DmiProperty.MemoryArrayMappedAddress.md) | Contains the key definitions available for a type 019 [MemoryArrayMappedAddress] structure. |
| static class [MemoryChannel](DmiProperty.MemoryChannel.md) | Contains the key definitions available for a type 037 [MemoryChannel] structure. |
| static class [MemoryController](DmiProperty.MemoryController.md) | Contains the key definitions available for a type 005, obsolete [MemoryController Information] structure. |
| static class [MemoryDevice](DmiProperty.MemoryDevice.md) | Contains the key definitions available for a type 017 [MemoryDevice] structure. |
| static class [MemoryDeviceMappedAddress](DmiProperty.MemoryDeviceMappedAddress.md) | Contains the key definitions available for a type 020 [MemoryDeviceMappedAddress] structure. |
| static class [MemoryModule](DmiProperty.MemoryModule.md) | Contains the key definitions available for a type 006, obsolete [MemoryModule Information] structure. |
| static class [OemStrings](DmiProperty.OemStrings.md) | Contains the key definitions available for a type 011 [OemStrings] structure. |
| static class [OnBoardDevices](DmiProperty.OnBoardDevices.md) | Contains the key definitions available for a type 010, obsolete [OnBoardDevices Information] structure. |
| static class [OnBoardDevicesExtended](DmiProperty.OnBoardDevicesExtended.md) | Contains the key definitions available for a type 041 [OnBoardDevicesExtended Information] structure. |
| static class [OutOfBandRemote](DmiProperty.OutOfBandRemote.md) | Contains the key definitions available for a type 030 [OutOfBandRemote] structure. |
| static class [PhysicalMemoryArray](DmiProperty.PhysicalMemoryArray.md) | Contains the key definitions available for a type 016 [PhysicalMemoryArray] structure. |
| static class [PortableBattery](DmiProperty.PortableBattery.md) | Contains the key definitions available for a type 022 [PortableBattery] structure. |
| static class [PortConnector](DmiProperty.PortConnector.md) | Contains the key definitions available for a type 008 [PortConnector Information] structure. |
| static class [Processor](DmiProperty.Processor.md) | Contains the key definitions available for a type 004 [Processor Information] structure. |
| static class [ProcessorAdditionalInformation](DmiProperty.ProcessorAdditionalInformation.md) | Contains the key definitions available for a type 044 [ProcessorAdditionalInformation] structure. |
| static class [StringProperty](DmiProperty.StringProperty.md) | Contains the key definitions available for a type 046 [StringProperty] structure. |
| static class [System](DmiProperty.System.md) | Contains the key definitions available for a type 001 [System Information] structure. |
| static class [SystemBoot](DmiProperty.SystemBoot.md) | Contains the key definitions available for a type 032 [SystemBoot Information] structure. |
| static class [SystemConfigurationOptions](DmiProperty.SystemConfigurationOptions.md) | Contains the key definitions available for a type 012 [SystemConfigurationOptions] structure. |
| static class [SystemEventLog](DmiProperty.SystemEventLog.md) | Contains the key definitions available for a type 015 [SystemEventLog] structure. |
| static class [SystemPowerControls](DmiProperty.SystemPowerControls.md) | Contains the key definitions available for a type 025 [SystemPowerControls] structure. |
| static class [SystemPowerSupply](DmiProperty.SystemPowerSupply.md) | Contains the key definitions available for a type 039 [SystemPowerSupply Information] structure. |
| static class [SystemReset](DmiProperty.SystemReset.md) | Contains the key definitions available for a type 023 [SystemReset] structure. |
| static class [SystemSlots](DmiProperty.SystemSlots.md) | Contains the key definitions available for a type 009 [SystemSlots] structure. |
| static class [TemperatureProbe](DmiProperty.TemperatureProbe.md) | Contains the key definitions available for a type 028 [TemperatureProbe] structure. |
| static class [TpmDevice](DmiProperty.TpmDevice.md) | Contains the key definitions available for a type 043 [TpmDevice] structure. |
| static class [VoltageProbe](DmiProperty.VoltageProbe.md) | Contains the key definitions available for a type 026 [VoltageProbe] structure. |
## See Also
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiAdditionalInformationEntryCollection.md
# DmiAdditionalInformationEntryCollection class
Represents a collection of objects [`DmiAdditionalInformationEntry`](./DmiAdditionalInformationEntry.md).
```csharp
public sealed class DmiAdditionalInformationEntryCollection :
ReadOnlyCollection<DmiAdditionalInformationEntry>
```
## Public Members
| name | description |
| --- | --- |
| override [ToString](DmiAdditionalInformationEntryCollection/ToString.md)() | Returns a class String that represents the current object. |
## See Also
* class [DmiAdditionalInformationEntry](./DmiAdditionalInformationEntry.md)
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType032 [System Boot Information].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 032: System Boot Information.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 32 System Boot Information structure identifier |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE Varies Length of the structure, at least 14h |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies The handle, or instance number, associated with the |
// | structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Reserved 6 BYTEs 00h Reserved for future assignment by this specification; |
// | all bytes are set to 00h. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ah Boot Status 10 BYTEs Varies The Status and Additional Data fields that identify |
// | boot status. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the System Boot Information (Type 32) structure.
/// </summary>
internal sealed class SmbiosType032 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType032"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType032(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Boot Status</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte BootStatus => Reader.GetByte(0x0a);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.Latest)
{
return;
}
properties.Add(SmbiosProperty.SystemBoot.BootStatus, GetBootStatus(BootStatus));
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
private static string GetBootStatus(byte code)
{
string[] value =
{
"No errors detected", // 0
"No bootable media",
"Operating system failed to load",
"Firmware-detected hardware failure",
"Operating system-detected hardware failure",
"User-requested boot",
"System security violation",
"Previously-requested image",
"System watchdog timer expired" // 8
};
if (code <= 8)
{
return value[code];
}
if (code >= 128 && code <= 191)
{
return "OEM-specific";
}
if (code >= 192)
{
return "Product-specific";
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType021 [Built-in Pointing Device].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 021: Built-in Pointing Device.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.1+ Type BYTE 21 Built-in Pointing Device indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.1+ Length BYTE 07h Length of the structure. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 2.1+ Handle WORD Varies The handle, or instance number, associated|
// | with the structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 2.1+ Type BYTE ENUM The type of pointing device. |
// | Note: See DeviceType(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h 2.1+ Interface BYTE ENUM The interface type for the pointing device|
// | Note: See DeviceInterface(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h 2.1+ Number of BYTE Varies The number of buttons on the pointing |
// | Buttons device. |
// | If the device has three buttons, the |
// | field value is 03h. |
// | Note: See NumberOfButtons |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Built-in Pointing Device (Type 21) structure.
/// </summary>
internal sealed class SmbiosType021 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Inicializa una nueva instancia de la clase <see cref="SmbiosType021"/> especificando la información de la estructura y la versión de SMBIOS.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Información sin tratar de la estructura actual.</param>
/// <param name="smbiosVersion">Versión actual de SMBIOS.</param>
public SmbiosType021(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
#region Version 2.1+ fields
/// <summary>
/// Gets a value representing the <b>Device Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte DeviceType => Reader.GetByte(0x04);
/// <summary>
/// Gets a value representing the <b>Interface</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Interface => Reader.GetByte(0x05);
/// <summary>
/// Gets a value representing the <b>Number Of Buttons</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte NumberOfButtons => Reader.GetByte(0x06);
#endregion
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.v21)
{
return;
}
properties.Add(SmbiosProperty.BuiltInPointingDevice.NumberOfButtons, NumberOfButtons);
properties.Add(SmbiosProperty.BuiltInPointingDevice.Type, GetDeviceType(DeviceType));
properties.Add(SmbiosProperty.BuiltInPointingDevice.Interface, GetDeviceInterface(Interface));
}
#endregion
#region BIOS Specification 3.5.0 (15/09/2021)
/// <summary>
/// Gets a string representing the interface of the device.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// Device interface.
/// </returns>
private static string GetDeviceInterface(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"Serial",
"PS/2",
"Infrared",
"HP-HIL",
"Bus mouse",
"ADB (Apple Desktop Bus)" // 0x08
};
string[] value1 =
{
"Bus mouse DB-9", // 0xA0
"Bus mouse micro-DIN",
"USB",
"I2C",
"SPI" // 0xA4
};
if (code >= 0x01 && code <= 0x08)
{
return value[code - 0x01];
}
if (code >= 0xA0 && code <= 0xA4)
{
return value1[code - 0xA0];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string representing the device type.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// Bus type.
/// </returns>
private static string GetDeviceType(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"Mouse",
"Track Ball",
"Track Point",
"Glide Point",
"Touch Pad",
"Touch Screen",
"Optical Sensor" // 0x09
};
if (code >= 0x01 && code <= 0x09)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemSlots.Peers/SegmentGroupNumber.md
# DmiProperty.SystemSlots.Peers.SegmentGroupNumber property
Gets a value representing the key to retrieve the property value.
Segment Group Number is defined in the PCI Firmware Specification. The value is 0 for a single-segment topology.
For PCI Express slots, Bus Number and Device/Function Number refer to the endpoint in the slot, not the upstream switch.
Key Composition
* Structure: SystemSlots
* Property: SegmentGroupNumber
* Unit: None
Return Value
Type: UInt16
Remarks
3.2
```csharp
public static IPropertyKey SegmentGroupNumber { get; }
```
## See Also
* class [Peers](../DmiProperty.SystemSlots.Peers.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiStructure/FriendlyClassName.md
# DmiStructure.FriendlyClassName property
Gets a value that represents the structure friendly name.
```csharp
public string FriendlyClassName { get; }
```
## Return Value
The structure friendly name
## See Also
* class [DmiStructure](../DmiStructure.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType038 [IPMI Device Information].cs
using System.Diagnostics;
using System.Globalization;
using iTin.Core;
using iTin.Core.Helpers.Enumerations;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 038: IPMI Device Information.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 38 IPMI Device Information |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE Varies Length of the structure, a minimum of 10h |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Interface Type BYTE ENUM Baseboard Management Controller (BMC) interface type. |
// | NOTE: Ver GetInterfaceType(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h IPMI BYTE Varies Identifies the IPMI Specification Revision, in BCD |
// | Specification format, to which the BMC was designed. |
// | Revision Bits 07:04 - Hold the most significant digit of the |
// | revision |
// | Bits 03:00 - Hold the least significant bits. |
// | |
// | EXAMPLE: A value of 10h indicates revision 1.0. |
// | NOTE: Ver SpecificationRevision |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h I2C Slave BYTE Varies The slave address on the I2C bus of this BMC. |
// | Address |
// | NOTE: Ver I2CSlaveAddress |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h NV Storage BYTE Varies Bus ID of the NV storage device. If no storage device |
// | Device Address exists for this BMC, the field is set to 0FFh. |
// | NOTE: Ver BusId |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h Base Address QWORD Varies Identifies the base address (either memory-mapped or |
// | I/O) of the BMC. If the least-significant bit of the |
// | field is a 1, the address is in I/O space; otherwise, |
// | the address is memorymapped. |
// | Refer to the IPMI Interface Specification for usage |
// | details |
// | NOTE: Ver BaseAddress |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 10h Base Address BYTE Varies Base Address Modifier (This field is unused and set |
// | Modifier / to 00h for SSIF.) |
// | Interrupt Info |
// | Bits 07:06 – Register spacing |
// | 00b - Interface registers are on |
// | successive byte boundaries. |
// | 01b - Interface registers are on 32-bit |
// | boundaries. |
// | 10b - Interface registers are on 16-byte |
// | boundaries. |
// | 11b - Reserved. |
// | Note: Ver GetRegisterSpacing(byte) |
// | |
// | Bit 05 – Reserved. Return as 0b. |
// | |
// | Bit 04 – LS-bit for addresses: |
// | 0b = Address bit 0 = 0b |
// | 1b = Address bit 0 = 1b |
// | Note: Ver LsBit |
// | |
// | Interrupt Info |
// | Identifies the type and polarity of the interrupt |
// | associated with the IPMI system interface, if any: |
// | Bit 03 – Interrupt Info |
// | 1b - Interrupt information specified |
// | 0b - Interrupt information not specified |
// | Note: Ver SpecifiedInfo |
// | |
// | Bit 02 – Reserved. Return as 0b |
// | |
// | Bit 01 – Interrupt Polarity |
// | 1b - active high |
// | 0b - active low |
// | Note: Ver Polarity |
// | |
// | Bit 00 – Interrupt Trigger Mode |
// | 1b - level |
// | 0b - edge |
// | Note: Ver TriggerMode |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 11h Interrupt BYTE Varies Interrupt number for IPMI System Interface. |
// | Number 00h = unspecified/unsupported |
// | Note: Ver InterruptNumber |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the IPMI Device Information (Type 38) structure.
/// </summary>
internal sealed class SmbiosType038 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType038"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType038(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Interface Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte InterfaceType => Reader.GetByte(0x04);
/// <summary>
/// Gets a value representing the <b>Specification Revision</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string SpecificationRevision
{
get
{
byte hi = (byte)((Reader.GetByte(0x05) >> 4) & 0x0f);
byte lo = (byte)(Reader.GetByte(0x05) & 0x0f);
string hiString = hi.ToString(CultureInfo.InvariantCulture);
string loString = lo.ToString(CultureInfo.InvariantCulture);
return $"{hiString}.{loString}";
}
}
/// <summary>
/// Gets a value representing the <b>I2C Slave Address</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string I2CSlaveAddress => Reader.GetByte(0x06).ToString("X", CultureInfo.InvariantCulture);
/// <summary>
/// Gets a value representing the <b>NV Storage Device Address</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte NVStorageDeviceAddress => Reader.GetByte(0x07);
/// <summary>
/// Gets a value representing the <b>Base Address</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ulong BaseAddress => (ulong)Reader.GetQuadrupleWord(0x08);
/// <summary>
/// Gets a value representing the <b>Base Address Modifier</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte BaseAddressModifier => Reader.GetByte(0x10);
/// <summary>
/// Gets a value representing the <b>Trigger Mode</b> feature of the <b>Base Address Modifier</b> field
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string TriggerMode => BaseAddressModifier.CheckBit(Bits.Bit00) ? "Level" : "Edge";
/// <summary>
/// Gets a value representing the <b>Polarity</b> feature of the <b>Base Address Modifier</b> field
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Polarity => BaseAddressModifier.CheckBit(Bits.Bit01) ? "Active High" : "Active Low";
/// <summary>
/// Gets a value representing the <b>Specified Info</b> feature of the <b>Base Address Modifier</b> field
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool SpecifiedInfo => BaseAddressModifier.CheckBit(Bits.Bit03);
/// <summary>
/// Gets a value representing the <b>LsBit</b> feature of the <b>Base Address Modifier</b> field
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte LsBit => (byte) (BaseAddressModifier & 0x01);
/// <summary>
/// Gets a value representing the <b>Register Spacing</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte RegisterSpacing => (byte)((BaseAddressModifier >> 6) & 0x03);
/// <summary>
/// Gets a value representing the <b>Interrup tNumber</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte InterruptNumber => Reader.GetByte(0x11);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.Latest)
{
return;
}
properties.Add(SmbiosProperty.IpmiDevice.InterfaceType, GetInterfaceType(InterfaceType));
properties.Add(SmbiosProperty.IpmiDevice.SpecificationRevision, SpecificationRevision);
properties.Add(SmbiosProperty.IpmiDevice.I2CSlaveAddress, I2CSlaveAddress);
properties.Add(SmbiosProperty.IpmiDevice.NVStorageDeviceAddress, NVStorageDeviceAddress);
properties.Add(SmbiosProperty.IpmiDevice.BaseAddress, BaseAddress);
if (StructureInfo.Length >= 0x11)
{
if (BaseAddressModifier != 0x00)
{
properties.Add(SmbiosProperty.IpmiDevice.BaseAdressModifier.RegisterSpacing, GetRegisterSpacing(RegisterSpacing));
properties.Add(SmbiosProperty.IpmiDevice.BaseAdressModifier.LsBit, LsBit);
properties.Add(SmbiosProperty.IpmiDevice.Interrupt.SpecifiedInfo, SpecifiedInfo);
properties.Add(SmbiosProperty.IpmiDevice.Interrupt.Polarity, Polarity);
properties.Add(SmbiosProperty.IpmiDevice.Interrupt.TriggerMode, TriggerMode);
}
}
if (StructureInfo.Length >= 0x12)
{
properties.Add(SmbiosProperty.IpmiDevice.InterruptNumber, InterruptNumber);
}
}
#endregion
#region BIOS Specification 3.2.0 (26/04/2018)
/// <summary>
/// Gets a string representing interface type.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The interface type.
/// </returns>
private static string GetInterfaceType(byte code)
{
string[] value =
{
"Unknown", // 0x00
"KCS: Keyboard Controller Style",
"SMIC: Server Management Interface Chip",
"BT: Block Transfer",
"SSIF: SMBus System Interface" // 0x04
};
if (code <= 0x04)
{
return value[code];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string representing record type.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The record type.
/// </returns>
private static string GetRegisterSpacing(byte code)
{
string[] value =
{
"Interface registers are on successive byte boundaries", // 0x00
"Interface registers are on 32-bit boundaries",
"Interface registers are on 16-byte boundaries",
"Reserved" // 0x03
};
return value[code];
}
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/AssemblyInfo.cs
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("iTin.Hardware.Specification.Dmi, PublicKey=0024000004800000940000000602000000240000525341310004000001000100e<KEY>ff122a0d076a14ff78b7a3a660e12311ed6d56962534d07772882f6151e897b8530601a55e33e<KEY>0042557ec0cad9f1e3211ff02397651699bbc9a1d3a0c0")]
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/DmiClass.cs
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using iTin.Core.Hardware.Common;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Represents a <b>DMI</b> class.
/// </summary>
public sealed class DmiClass
{
#region private readonly members
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly IDmiType _dmiType;
#endregion
#region constructor/s
/// <summary>
/// Initialize a new instance of the <see cref="DmiClass"/> class.
/// </summary>
/// <param name="dmiType">Table <see cref="DMI"/> that contains the data of the structure.</param>
internal DmiClass(IDmiType dmiType)
{
_dmiType = dmiType;
}
#endregion
#region public properties
/// <summary>
/// Returns a list of implemented properties for this structure
/// </summary>
/// <returns>
/// A list of implemented properties for this structure.
/// </returns>
public IEnumerable<IPropertyKey> ImplementedProperties => _dmiType.ImplementedProperties;
/// <summary>
/// Returns a value that indicates the implemented version of this <see cref="DMI"/> structure.
/// </summary>
/// <returns>
/// One of the values of the <see cref="DmiStructureVersion"/> enumeration.
/// </returns>
public DmiStructureVersion ImplementedVersion => _dmiType.ImplementedVersion;
#endregion
#region internal properties
/// <summary>
/// Gets a value that represents the available properties.
/// </summary>
/// <value>
/// Available properties.
/// </value>
internal DmiClassPropertiesTable Properties => _dmiType.Properties;
#endregion
#region public methods
/// <summary>
/// Returns the value of specified property. Always returns the first appearance of the property.
/// </summary>
/// <param name="propertyKey">Key to the property to obtain</param>
/// <returns>
/// <para>
/// A <see cref="QueryPropertyResult"/> reference that contains the result of the operation, to check if the operation is correct, the <b>Success</b>
/// property will be <b>true</b> and the <b>Value</b> property will contain the value; Otherwise, the the <b>Success</b> property
/// will be false and the <b>Errors</b> property will contain the errors associated with the operation, if they have been filled in.
/// </para>
/// <para>
/// The type of the <b>Value</b> property is <see cref="PropertyItem"/>. Contains the result of the operation.
/// </para>
/// <para>
/// </para>
/// </returns>
public QueryPropertyResult GetProperty(IPropertyKey propertyKey)
{
object result = Properties[propertyKey];
if (!(result is List<PropertyItem> itemList))
{
return QueryPropertyResult.CreateErroResult("Can not found specified property key");
}
bool hasItems = itemList.Any();
if (!hasItems)
{
return QueryPropertyResult.CreateErroResult("Can not found specified property key");
}
bool onlyOneItem = itemList.Count == 1;
if (onlyOneItem)
{
return QueryPropertyResult.CreateSuccessResult(itemList.FirstOrDefault());
}
return QueryPropertyResult.CreateErroResult("Can not found specified property key");
}
#endregion
#region public override methods
/// <summary>
/// Returns a <see cref="string"/> that represents this instance.
/// </summary>
/// <returns>
/// A <see cref="string"/> that represents this instance.
/// </returns>
/// <remarks>
/// This method returns a string that includes the available properties.
/// </remarks>
public override string ToString() => $"Properties = {Properties.Count}";
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.VoltageProbe/Tolerance.md
# DmiProperty.VoltageProbe.Tolerance property
Gets a value representing the key to retrieve the property value.
Tolerance for reading from this probe, in plus/minus millivolts.
Key Composition
* Structure: VoltageProbe
* Property: Tolerance
* Unit: mV
Return Value
Type: UInt16
```csharp
public static IPropertyKey Tolerance { get; }
```
## See Also
* class [VoltageProbe](../DmiProperty.VoltageProbe.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemEventLog/AccessMethod.md
# DmiProperty.SystemEventLog.AccessMethod property
Gets a value representing the key to retrieve the property value.
Defines the Location and Method used by higher-level software to access the log area
Key Composition
* Structure: SystemEventLog
* Property: AccessMethod
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey AccessMethod { get; }
```
## See Also
* class [SystemEventLog](../DmiProperty.SystemEventLog.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Specific/MemoryChannelElement.cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 037: Memory Channel. Contained Devices.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Memory BYTE Varies The channel load provided by the first Memory Device |
// | Device associated with this channel. |
// | Load Note: Ver Load |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Memory WORD Varies The structure handle that identifies the first Memory |
// | Device Device associated with this channel. |
// | Handle Note: Ver Handle |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// This class represents an element of the structure <see cref="SmbiosType037"/>.
/// </summary>
public class MemoryChannelElement : SpecificSmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="MemoryChannelElement"/> class specifying the structure information.
/// </summary>
/// <param name="memoryContainedElementsArray">Untreated information of the current structure.</param>
internal MemoryChannelElement(byte[] memoryContainedElementsArray) : base(memoryContainedElementsArray)
{
}
#endregion
#region private readonly properties
/// <summary>
/// Gets a value that represents the '<b>Load</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Load => GetByte(0x00);
/// <summary>
/// Gets a value that represents the '<b>Handle</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort Handle => (ushort)GetWord(0x01);
#endregion
#region public override methods
/// <summary>
/// Returns a class <see cref="string"/> that represents the current object.
/// </summary>
/// <returns>
/// Object <see cref="string"/> that represents the current <see cref="MemoryChannelElement"/> class.
/// </returns>
/// <remarks>
/// This method returns a string that includes the property <see cref="Load"/> and <see cref="Handle"/>.
/// </remarks>
public override string ToString() => $"Load = {Load}, Handle = {Handle}";
#endregion
#region protected methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
properties.Add(SmbiosProperty.MemoryChannel.MemoryDevices.Load, Load);
properties.Add(SmbiosProperty.MemoryChannel.MemoryDevices.Handle, Handle);
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemReset.Capabilities/BootOptionOnLimit.md
# DmiProperty.SystemReset.Capabilities.BootOptionOnLimit property
Gets a value representing the key to retrieve the property value.
Returns to the action that will be taken when the restart limit is reached.
Key Composition
* Structure: SystemReset
* Property: BootOptionOnLimit
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey BootOptionOnLimit { get; }
```
## See Also
* class [Capabilities](../DmiProperty.SystemReset.Capabilities.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor.Characteristics/MultiCore.md
# DmiProperty.Processor.Characteristics.MultiCore property
Gets a value representing the key to retrieve the property value.
Indicates the processor has more than one core. Does not indicate the number of cores (Core Count) enabled by hardware or the number of cores (Core Enabled) enabled by BIOS.
Key Composition
* Structure: Processor
* Property: MultiCore
* Unit: None
Return Value
Type: Boolean
Remarks
2.5+
```csharp
public static IPropertyKey MultiCore { get; }
```
## See Also
* class [Characteristics](../DmiProperty.Processor.Characteristics.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.OutOfBandRemote/Manufacturer.md
# DmiProperty.OutOfBandRemote.Manufacturer property
Gets a value representing the key to retrieve the property value.
Contains the manufacturer of the out-of-band access facility.
Key Composition
* Structure: OutOfBandRemote
* Property: ManufacturerName
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey Manufacturer { get; }
```
## See Also
* class [OutOfBandRemote](../DmiProperty.OutOfBandRemote.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PortConnector/PortType.md
# DmiProperty.PortConnector.PortType property
Gets a value representing the key to retrieve the property value.
Describes the function of the port.
Key Composition
* Structure: PortConnector
* Property: PortType
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey PortType { get; }
```
## See Also
* class [PortConnector](../DmiProperty.PortConnector.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType020 [Memory Device Mapped Address].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Memory Device Mapped Address (Type 20) structure.<br/>
/// For more information, please see <see cref="SmbiosType020"/>.
/// </summary>
internal sealed class DmiType020 : DmiBaseType<SmbiosType020>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType020"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType020(SmbiosType020 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion < DmiStructureVersion.v21)
{
return;
}
properties.Add(DmiProperty.MemoryDeviceMappedAddress.MemoryDeviceHandle, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDeviceMappedAddress.MemoryDeviceHandle));
properties.Add(DmiProperty.MemoryDeviceMappedAddress.MemoryArrayMappedAddressHandle, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDeviceMappedAddress.MemoryArrayMappedAddressHandle));
properties.Add(DmiProperty.MemoryDeviceMappedAddress.PartitionRowPosition, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDeviceMappedAddress.PartitionRowPosition));
properties.Add(DmiProperty.MemoryDeviceMappedAddress.InterleavePosition, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDeviceMappedAddress.InterleavePosition));
properties.Add(DmiProperty.MemoryDeviceMappedAddress.InterleavedDataDepth, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDeviceMappedAddress.InterleavedDataDepth));
uint startingAddress = SmbiosStructure.GetPropertyValue<uint>(SmbiosProperty.MemoryDeviceMappedAddress.StartingAddress);
if (startingAddress == 0xffffffff)
{
if (ImplementedVersion >= DmiStructureVersion.v27)
{
object extendedStartingAddress = SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDeviceMappedAddress.ExtendedStartingAddress);
properties.Add(DmiProperty.MemoryDeviceMappedAddress.StartingAddress, extendedStartingAddress);
}
}
else
{
properties.Add(DmiProperty.MemoryDeviceMappedAddress.StartingAddress, (ulong)startingAddress * (ulong)1024);
}
uint endingAddress = SmbiosStructure.GetPropertyValue<uint>(SmbiosProperty.MemoryDeviceMappedAddress.EndingAddress);
if (endingAddress == 0xffffffff)
{
if (ImplementedVersion >= DmiStructureVersion.v27)
{
object extendedEndingAddress = SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryDeviceMappedAddress.ExtendedEndingAddress);
properties.Add(DmiProperty.MemoryDeviceMappedAddress.EndingAddress, extendedEndingAddress);
}
}
else
{
properties.Add(DmiProperty.MemoryDeviceMappedAddress.EndingAddress, (ulong)endingAddress * (ulong)1024);
}
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.ProcessorAdditionalInformation/ProcessorSpecificBlock.md
# DmiProperty.ProcessorAdditionalInformation.ProcessorSpecificBlock property
Gets a value representing the key to retrieve the property value.
Processor-specific block.
The format of processor-specific data varies between different processor architecture.
Key Composition
* Structure: ProcessorAdditionalInformation
* Property: ProcessorSpecificBlock
* Unit: None
Return Value
Type: ProcessorSpecificInformationBlock
Remarks
3.3+
```csharp
public static IPropertyKey ProcessorSpecificBlock { get; }
```
## See Also
* class [ProcessorAdditionalInformation](../DmiProperty.ProcessorAdditionalInformation.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/MemoryOperatingModeCapability.md
# DmiProperty.MemoryDevice.MemoryOperatingModeCapability property
Gets a value representing the key to retrieve the property value.
The operating modes supported by this memory device.
Key Composition
* Structure: MemoryDevice
* Property: MemoryOperatingModeCapability
* Unit: None
Return Value
Type: ReadOnlyCollection where T is String
Remarks
3.2+
```csharp
public static IPropertyKey MemoryOperatingModeCapability { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BaseBoard/ChassisHandle.md
# DmiProperty.BaseBoard.ChassisHandle property
Gets a value representing the key to retrieve the property value.
Handle, or instance number, associated with the chassis in which this board resides.
Key Composition
* Structure: BaseBoard
* Property: ChassisHandle
* Unit: None
Return Value
Type: Nullable where T is Int32
```csharp
public static IPropertyKey ChassisHandle { get; }
```
## See Also
* class [BaseBoard](../DmiProperty.BaseBoard.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType035 [Management Device Component].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 035: Management Device Component.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 35 Management Device Component indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE 0Bh Length of the structure. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies The handle, or instance number, associated with the |
// | structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Description BYTE STRING The number of the string that contains additional |
// | descriptive information about the component. |
// | Note: Ver Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Management WORD Varies The handle, or instance number, of the Management |
// | Device Handle Device. |
// | Note: Ver DeviceHandle |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h Component WORD Varies The handle, or instance number, of the probe or |
// | Handle cooling device that defines this component. |
// | Note: Ver ProbeHandle |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 09h Threshold WORD Varies The handle, or instance number, associated with the |
// | Handle device thresholds. |
// | |
// | A value of 0FFFFh indicates that no Threshold Data |
// | structure is associated with this component. |
// | Note: Ver ThresholdHandle |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Management Device Component (Type 35) structure.
/// </summary>
internal sealed class SmbiosType035 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType035"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType035(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Description</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Description => GetString(0x04);
/// <summary>
/// Gets a value representing the <b>Management Device Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ManagementDeviceHandle => (ushort)Reader.GetWord(0x05);
/// <summary>
/// Gets a value representing the <b>Component Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ComponentHandle => (ushort)Reader.GetWord(0x07);
/// <summary>
/// Gets a value representing the <b>Threshold Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ThresholdHandle => (ushort)Reader.GetWord(0x09);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.Latest)
{
return;
}
properties.Add(SmbiosProperty.ManagementDeviceComponent.Description, Description);
properties.Add(SmbiosProperty.ManagementDeviceComponent.ComponentHandle, ComponentHandle);
properties.Add(SmbiosProperty.ManagementDeviceComponent.ThresholdHandle, ThresholdHandle);
properties.Add(SmbiosProperty.ManagementDeviceComponent.ManagementDeviceHandle, ManagementDeviceHandle);
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiClass.md
# DmiClass class
Represents a DMI class.
```csharp
public sealed class DmiClass
```
## Public Members
| name | description |
| --- | --- |
| [ImplementedProperties](DmiClass/ImplementedProperties.md) { get; } | Returns a list of implemented properties for this structure |
| [ImplementedVersion](DmiClass/ImplementedVersion.md) { get; } | Returns a value that indicates the implemented version of this [`DMI`](../iTin.Hardware.Specification/DMI.md) structure. |
| [GetProperty](DmiClass/GetProperty.md)(…) | Returns the value of specified property. Always returns the first appearance of the property. |
| override [ToString](DmiClass/ToString.md)() | Returns a String that represents this instance. |
## See Also
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Specific/Enums/ChassisContainedElementType.cs
namespace iTin.Hardware.Specification.Smbios;
/// <summary>
/// Defines the <b>SMBIOS</b> structures associated with the chassis.
/// </summary>
internal enum ChassisContainedElementType
{
/// <summary>
/// SystemEnclosure structure
/// </summary>
BaseBoardEnumeration = 0x00,
/// <summary>
/// <b>SMBIOS</b> structure
/// </summary>
SmbiosStructure = 0x01
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiStructureCollection/IndexOf.md
# DmiStructureCollection.IndexOf method
Returns the index of the object with the key specified in the collection
```csharp
public int IndexOf(DmiStructureClass ResultKey)
```
| parameter | description |
| --- | --- |
| ResultKey | One of the Results of SmbiosStructure that represents the key of the object to be searched in the collection. |
## Return Value
Zero-base index of the first appearance of the item in the collection, if found; otherwise, -1.
## Exceptions
| exception | condition |
| --- | --- |
| InvalidEnumArgumentException | |
## See Also
* enum [DmiStructureClass](../DmiStructureClass.md)
* class [DmiStructureCollection](../DmiStructureCollection.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/SpecificDmiBaseType/GetPropertyValue.md
# SpecificDmiBaseType.GetPropertyValue method (1 of 2)
Returns the value of specified property. Always returns the first appearance of the property. If it does not exist, returns null (Nothing in visual basic).
```csharp
public object GetPropertyValue(IPropertyKey propertyKey)
```
| parameter | description |
| --- | --- |
| propertyKey | Key to the property to obtain |
## Return Value
Reference to the object that represents the value of the property. Always returns the first appearance of the property.
## See Also
* class [SpecificDmiBaseType](../SpecificDmiBaseType.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
---
# SpecificDmiBaseType.GetPropertyValue<T> method (2 of 2)
Returns the the strongly typed value of specified property. Always returns the first appearance of the property. If it does not exist, returns null (Nothing in visual basic).
```csharp
public T GetPropertyValue<T>(IPropertyKey propertyKey)
```
| parameter | description |
| --- | --- |
| propertyKey | Key to the property to obtain |
## Return Value
Reference to the object that represents the strongly typed value of the property. Always returns the first appearance of the property.
## See Also
* class [SpecificDmiBaseType](../SpecificDmiBaseType.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor/ThreadCount2.md
# DmiProperty.Processor.ThreadCount2 property
Gets a value representing the key to retrieve the property value.
Number of threads per processor socket. Supports thread counts >255 If this field is present, it holds the thread count for the processor socket. Thread Count will also hold the thread count, except for thread counts that are 256 or greater. In that case, thread count shall be set to FFh and thread count 2 will hold the count.
Key Composition
* Structure: Processor
* Property: ThreadCount2
* Unit: None
Return Value
Type: UInt16
Remarks
3.0+
```csharp
public static IPropertyKey ThreadCount2 { get; }
```
## See Also
* class [Processor](../DmiProperty.Processor.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemBoot/BootStatus.md
# DmiProperty.SystemBoot.BootStatus property
Gets a value representing the key to retrieve the property value.
Status and additional data fields that identify the boot status.
Key Composition
* Structure: SystemBoot
* Property: BootStatus
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey BootStatus { get; }
```
## See Also
* class [SystemBoot](../DmiProperty.SystemBoot.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiBaseType-1/SmbiosVersion.md
# DmiBaseType<TSmbios>.SmbiosVersion property
Gets the current version of SMBIOS.
```csharp
protected int SmbiosVersion { get; }
```
## Property Value
Value representing the current version of SMBIOS.
## See Also
* class [DmiBaseType<TSmbios>](../DmiBaseType-1.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryArrayMappedAddress/MemoryArrayHandle.md
# DmiProperty.MemoryArrayMappedAddress.MemoryArrayHandle property
Gets a value representing the key to retrieve the property value.
Handle, or instance number, associated with the physical memory array to which this address range is mapped multiple address ranges can be mapped to a single physical memory array.
Key Composition
* Structure: MemoryArrayMappedAddress
* Property: MemoryArrayHandle
* Unit: None
Return Value
Type: UInt16
Remarks
2.1+
```csharp
public static IPropertyKey MemoryArrayHandle { get; }
```
## See Also
* class [MemoryArrayMappedAddress](../DmiProperty.MemoryArrayMappedAddress.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Cache/MaximumCacheSize.md
# DmiProperty.Cache.MaximumCacheSize property
Gets a value representing the key to retrieve the property value.
Maximum size that can be installed.
Key Composition
* Structure: Cache
* Property: MaximumCacheSize
* Unit: KB
Return Value
Type: Int32
Remarks
2.0+
```csharp
public static IPropertyKey MaximumCacheSize { get; }
```
## See Also
* class [Cache](../DmiProperty.Cache.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/PMIC0RevisionNumber.md
# DmiProperty.MemoryDevice.PMIC0RevisionNumber property
Gets a value representing the key to retrieve the property.
The PMIC0 Revision Number indicates the revision of the PMIC0 on memory device. This field shall be set to the value of the SPD PMIC 0 Revision Number. A value of FF00h indicates the PMIC0 Revision Number is unknown.
Key Composition
* Structure: MemoryDevice
* Property: PMIC0RevisionNumber
* Unit: None
Return Value
Type: UInt16
Remarks
3.7+
```csharp
public static IPropertyKey PMIC0RevisionNumber { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType007 [Cache Information].cs
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using iTin.Core;
using iTin.Core.Helpers;
using iTin.Core.Helpers.Enumerations;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 007: Cache Information.
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length deviceProperty Description |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.0+ Type BYTE 7 Cache Information Indicator |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.0+ Length BYTE Varies 0Fh for version 2.0 |
// | 13h for version 2.1 |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 2.0+ Handle WORD Varies |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 2.0+ Socket BYTE STRING String number for reference designation. |
// | Designation EXAMPLE: “CACHE1”, 0 |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h 2.0+ Cache WORD Varies Bits 15:10 - Reserved, must be zero |
// | Configuration |
// | Bits 09:08 - Operational Mode |
// | 00b - Write Through |
// | 01b - Write Back |
// | 10b - Varies with Memory |
// | Address |
// | 11b - Unknown |
// | Note: For more information, please see |
// | GetOperationalMode(byte) function. |
// | |
// | Bit 07 - Enabled/Disabled |
// | (at boot time) |
// | 1b - Enabled |
// | 0b - Disabled |
// | Note: For more information, please see |
// | State(byte) function. |
// | |
// | Bits 06:05 - Location, en relación con la |
// | CPU: |
// | 00b - Internal |
// | 01b - External |
// | 10b - Reserved |
// | 11b - Unknown |
// | Note: For more information, please see |
// | GetLocation(byte) function. |
// | |
// | Bit 04 - Reserved, must be zero |
// | |
// | Bit 03 - Cache Socketed |
// | 1b - Socketed |
// | 0b - Disabled |
// | Note: For more information, please see |
// | Socketed(byte) function. |
// | |
// | Bits 02:00 - Cache Level (1 - 8) |
// | Example: |
// | - L1 cache would use value 000b |
// | - L3 cache would use value 010b |
// | Note: For more information, please see |
// | Level(byte) function. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h 2.0+ Maximum Cache WORD Varies Maximum size that can be installed. |
// | Size Bit 15 - Granularity |
// | 0b - 1K granularity |
// | 1b - 64K granularity |
// | |
// | Bits 14:00 - Max size in given granularity |
// | |
// | Note: For more information, please see |
// | GetSize(int) function. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 09h 2.0+ Installed Size WORD Varies Same format as Max Cache Size field. |
// | Type The value 0x00 indicates no cache is |
// | installed. |
// | |
// | Note: For more information, please see |
// | GetSize(int) function. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Bh 2.0+ Supported SRAM WORD Bit Field Note: For more information, please see |
// | Type GetTypes(int) function. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Dh 2.0+ Current SRAM Type WORD Bit Field Note: For more information, please see |
// | GetTypes(int) function. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Fh 2.1+ Cache Speed BYTE Varies Cache module speed, in nanoseconds. |
// | Type The value is 0 if the speed is unknown. |
// | |
// | Note: For more information, please see |
// | Speed(byte) function. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 10h 2.1+ Error Correction BYTE ENUM Error-correction scheme supported by this |
// | Type cache component |
// | |
// | Note: For more information, please see |
// | GetErrorCorrection(byte) function |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 11h 2.1+ System Cache Type BYTE ENUM Logical type of cache |
// | |
// | Note: For more information, please see |
// | GetSystemCacheType(byte) function. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 12h 2.1+ Associativity BYTE ENUM Associativity of the cache. |
// | |
// | Note: For more information, please see |
// | GetAssociativity(byte) function. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 13h 3.1+ Maximum Cache DWORD Bit Field If this field is present, for cache sizes of |
// | Size 2 2047 MB or smaller the value in the Max size |
// | in given granularity portion of the field |
// | equals the size given in the corresponding |
// | portion of the Maximum Cache Size field, |
// | and the Granularity bit matches the value of |
// | the Granularity bit in the Maximum Cache |
// | Size field. |
// | For Cache sizes greater than 2047 MB, the |
// | Maximum Cache Size field is set to 0xFFFF |
// | and the Maximum Cache Size 2 field is |
// | present, the Granularity bit is set to 1b, |
// | and the size set as required; see 7.8.1. |
// | |
// | Bit 31 Granularity |
// | 0 – 1K granularity |
// | 1 – 64K granularity(always 1b |
// | for cache sizes >2047 MB) |
// | |
// | Bits 30:0 Max size in given granularity |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 17h 3.1+ Installed Cache DWORD Bit Field Same format as Maximum Cache Size 2 field; |
// | Size 2 Absent or set to 0 if no cache is installed. |
// | See 7.8.1. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Cache Information (Type 7) structure.
/// </summary>
internal sealed class SmbiosType007 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType007"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType007(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
#region Version 2.0+ fields
/// <summary>
/// Gets a value representing the <b>Socket Designation</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string SocketDesignation => GetString(0x04);
/// <summary>
/// Gets a value representing the <b>Cache Configuration</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort CacheConfiguration => (ushort)Reader.GetWord(0x05);
/// <summary>
/// Gets a value that represents the <b>bcOperational Mode</b> feature of the <b>Cache Configuration</b> field.
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte OperationalMode => (byte) ((CacheConfiguration >> 0x08) & 0x0003);
/// <summary>
/// Gets a value that represents the <b>Enabled</b> feature of the <b>Cache Configuration</b> field.
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool Enabled => CacheConfiguration.CheckBit(Bits.Bit07);
/// <summary>
/// Gets a value that represents the <b>Location</b> feature of the <b>Cache Configuration</b> field.
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Location => (byte) ((CacheConfiguration >> 0x05) & 0x0003);
/// <summary>
/// Gets a value that represents the <b>Cache Socketed</b> feature of the <b>Cache Configuration</b> field.
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool CacheSocketed => CacheConfiguration.CheckBit(Bits.Bit03);
/// <summary>
/// Gets a value that represents the <b>Cache Level</b> feature of the <b>Cache Configuration</b> field.
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte CacheLevel
{
get
{
byte level = (byte)(CacheConfiguration & 0x0007);
level++;
return level;
}
}
/// <summary>
/// Gets a value representing the <b>Maximum Cache Size</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort MaximumCacheSize => (ushort)Reader.GetWord(0x07);
/// <summary>
/// Gets a value representing the <b>Installed Size</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort InstalledSize => (ushort)Reader.GetWord(0x09);
/// <summary>
/// Gets a value representing the <b>Supported SRAM Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort SupportedSramType => (ushort)Reader.GetWord(0x0b);
/// <summary>
/// Gets a value representing the <b>Current SRAM Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort CurrentSramType => (ushort)Reader.GetWord(0x0d);
#endregion
#region Version 2.1+ fields
/// <summary>
/// Gets a value representing the <b>Cache Speed</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte CacheSpeed => Reader.GetByte(0x0f);
/// <summary>
/// Gets a value representing the <b>Error Connection Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ErrorCorrectionType => Reader.GetByte(0x10);
/// <summary>
/// Gets a value representing the <b>System Cache Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte SystemCacheType => Reader.GetByte(0x11);
/// <summary>
/// Gets a value representing the <b>Associativity</b>' field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Associativity => Reader.GetByte(0x12);
#endregion
#region Version 3.1.0+ fields
/// <summary>
/// Gets a value representing the <b>Maximum Cache Size 2</b> field.
/// </summary>
/// <value>
/// Valor de la propiedad.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint MaximumCacheSize2 => (uint)Reader.GetDoubleWord(0x13);
/// <summary>
/// Gets a value representing the <b>Installed Cache Size 2</b> field.
/// </summary>
/// <value>
/// Valor de la propiedad.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint InstalledCacheSize2 => (uint)Reader.GetDoubleWord(0x13);
#endregion
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
#region 2.0+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v20)
{
properties.Add(SmbiosProperty.Cache.SocketDesignation, SocketDesignation);
properties.Add(SmbiosProperty.Cache.CacheConfiguration.OperationalMode, GetOperationalMode(OperationalMode));
properties.Add(SmbiosProperty.Cache.CacheConfiguration.CacheEnabled, Enabled);
properties.Add(SmbiosProperty.Cache.CacheConfiguration.Location, GetLocation(Location));
properties.Add(SmbiosProperty.Cache.CacheConfiguration.CacheSocketed, CacheSocketed);
properties.Add(SmbiosProperty.Cache.CacheConfiguration.Level, CacheLevel);
properties.Add(SmbiosProperty.Cache.MaximumCacheSize, GetSize(MaximumCacheSize));
properties.Add(SmbiosProperty.Cache.InstalledCacheSize, GetSize(InstalledSize));
properties.Add(SmbiosProperty.Cache.SupportedSramTypes, GetTypes(SupportedSramType));
ReadOnlyCollection<string> types = GetTypes(CurrentSramType);
string currentType = types[0];
properties.Add(SmbiosProperty.Cache.CurrentSramType, currentType);
}
#endregion
#region 2.1+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v21)
{
properties.Add(SmbiosProperty.Cache.CacheSpeed, CacheSpeed);
properties.Add(SmbiosProperty.Cache.ErrorCorrectionType, GetErrorCorrection(ErrorCorrectionType));
properties.Add(SmbiosProperty.Cache.SystemCacheType, GetSystemCacheType(SystemCacheType));
properties.Add(SmbiosProperty.Cache.Associativity, GetAssociativity(Associativity));
}
#endregion
#region 3.1+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v31)
{
properties.Add(SmbiosProperty.Cache.MaximumCacheSize2, GetSize(MaximumCacheSize2));
properties.Add(SmbiosProperty.Cache.InstalledCacheSize2, GetSize(InstalledCacheSize2));
}
#endregion
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets a <see cref="string"/> indicating the association mode of this cache.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>The association mode of this cache.</returns>
private static string GetAssociativity(byte code)
{
string[] deviceProperty =
{
"Other", // 0x01
"Unknown",
"Direct Mapped",
"2-way Set-Associative",
"4-way Set-Associative",
"Fully Associative",
"8-way Set-Associative",
"16-way Set-Associative",
"12-way Set-Associative",
"24-way Set-Associative",
"32-way Set-Associative",
"48-way Set-Associative",
"64-way Set-Associative",
"20-way Set-Associative" // 0x0E
};
if (code >= 0x01 && code <= 0x0E)
{
return deviceProperty[code - 1];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a <see cref="string"/> indicating the method of error correction.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>Method used for error correction.</returns>
private static string GetErrorCorrection(byte code)
{
string[] deviceProperty =
{
"Other", // 0x01
"Unknown",
"None",
"Parity",
"Single-bit ECC",
"Multi-bit ECC" // 0x06
};
if (code >= 0x01 && code <= 0x06)
{
return deviceProperty[code - 1];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a <see cref="string"/> indicating the location of this cache against the processor.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>The location of this cache against the processor.</returns>
private static string GetLocation(byte code)
{
string[] deviceProperty =
{
"Internal", // 0x00
"External",
"Reserved",
"Unknown" // 0x03
};
return deviceProperty[code];
}
/// <summary>
/// Gets a <see cref="string"/> representing the operational mode.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>The operational mode.</returns>
private static string GetOperationalMode(byte code)
{
string[] deviceProperty =
{
"Write Through", // 0x00
"Write Back",
"Varies With Memory Address",
"Unknown" // 0x03
};
return deviceProperty[code];
}
/// <summary>
/// Gets a <see cref="string"/> that represents the cache size in Kb.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The cache size in Kb.
/// </returns>
private static int GetSize(int code)
{
int size = code & 0x7fff;
bool granularity64Kb = code.CheckBit(Bits.Bit15);
if (granularity64Kb)
{
return size << 6;
}
return size;
}
/// <summary>
/// Gets a <see cref="string"/> that represents the cache size in Kb.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>The cache size in Kb.</returns>
private static uint GetSize(uint code)
{
uint size = code & 0x7ffff;
bool granularity64Kb = LogicHelper.CheckBit(code, Bits.Bit31);
if (granularity64Kb)
{
return size << 6;
}
return size;
}
/// <summary>
/// Gets a <see cref="string"/> representing the logical type of this cache.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>The logical type of this cache.</returns>
private static string GetSystemCacheType(byte code)
{
string[] deviceProperty =
{
"Other", // 0x01
"Unknown",
"Instruction",
"Data",
"Unified" // 0x05
};
if (code >= 0x01 && code <= 0x05)
{
return deviceProperty[code - 1];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a read-only collection of supported memory types.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>A read-only collection of supported memory types.</returns>
private static ReadOnlyCollection<string> GetTypes(int code)
{
string[] deviceProperty =
{
"Other", // 0x00
"Unknown",
"Non-burst",
"Burst",
"Pipeline Burst",
"Synchronous",
"Asynchronous" // 0x06
};
List<string> items = new List<string>();
for (byte i = 0; i <= 6; i++)
{
bool addType = code.CheckBit(i);
if (addType)
{
items.Add(deviceProperty[i]);
}
}
return items.AsReadOnly();
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.StringProperty.md
# DmiProperty.StringProperty class
Contains the key definitions available for a type 046 [StringProperty] structure.
```csharp
public static class StringProperty
```
## Public Members
| name | description |
| --- | --- |
| static [ParentHandle](DmiProperty.StringProperty/ParentHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [PropertyId](DmiProperty.StringProperty/PropertyId.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [PropertyValue](DmiProperty.StringProperty/PropertyValue.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType008 [Port Connector Information].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Port Connector Information (Type 8) structure.<br/>
/// For more information, please see <see cref="SmbiosType008"/>.
/// </summary>
internal sealed class DmiType008 : DmiBaseType<SmbiosType008>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType008"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType008(SmbiosType008 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
properties.Add(DmiProperty.PortConnector.InternalReferenceDesignator, SmbiosStructure.GetPropertyValue(SmbiosProperty.PortConnector.InternalReferenceDesignator));
properties.Add(DmiProperty.PortConnector.InternalConnectorType, SmbiosStructure.GetPropertyValue(SmbiosProperty.PortConnector.InternalConnectorType));
properties.Add(DmiProperty.PortConnector.ExternalReferenceDesignator, SmbiosStructure.GetPropertyValue(SmbiosProperty.PortConnector.ExternalReferenceDesignator));
properties.Add(DmiProperty.PortConnector.ExternalConnectorType, SmbiosStructure.GetPropertyValue(SmbiosProperty.PortConnector.ExternalConnectorType));
properties.Add(DmiProperty.PortConnector.PortType, SmbiosStructure.GetPropertyValue(SmbiosProperty.PortConnector.PortType));
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/SmbiosPropertyEnum.cs
using System.Collections.ObjectModel;
using iTin.Core.Hardware.Common;
using iTin.Hardware.Specification.Tpm;
namespace iTin.Hardware.Specification.Smbios;
#region [internal] (emun) SmbiosType000Property: Defines the properties available for the structure type 000 [BIOS Information]
/// <summary>
/// Defines the properties available for the structure type 000 [BIOS Information].
/// </summary>
internal enum SmbiosType000Property
{
#region version 2.0+
[PropertyName("BIOS Vendor")]
[PropertyDescription("BIOS Vendor's name")]
[PropertyType(typeof(string))]
Vendor,
[PropertyName("BIOS Version")]
[PropertyDescription("BIOS Version")]
[PropertyType(typeof(string))]
BiosVersion,
[PropertyName("BIOS Start Segment")]
[PropertyDescription("Segment location of BIOS starting address")]
[PropertyType(typeof(string))]
BiosStartSegment,
[PropertyName("BIOS Release Date")]
[PropertyDescription("BIOS Release Date")]
[PropertyType(typeof(string))]
BiosReleaseDate,
[PropertyName("BIOS Size")]
[PropertyDescription("Size of the physical device containing the BIOS")]
[PropertyType(typeof(byte))]
BiosRomSize,
[PropertyName("BIOS Characteristics")]
[PropertyDescription("Defines which functions the BIOS supports: PCI, PCMCIA, Flash, etc...")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
Characteristics,
#endregion
#region version 2.4+
[PropertyName("BIOS Characteristics Extension Byte 1")]
[PropertyDescription("Collection of functions compatible with this bios")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
CharacteristicsExtensionByte1,
[PropertyName("BIOS Characteristics Extension Byte 2")]
[PropertyDescription("Collection of functions compatible with this bios")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
CharacteristicsExtensionByte2,
[PropertyName("System BIOS Major Release")]
[PropertyDescription("Major release of the System BIOS")]
[PropertyType(typeof(byte))]
SystemBiosMajorRelease,
[PropertyName("System BIOS Minor Release")]
[PropertyDescription("Minor release of the System BIOS")]
[PropertyType(typeof(byte))]
SystemBiosMinorRelease,
[PropertyName("Embedded Controller Firmware Major Version")]
[PropertyDescription("Identifies the major release of the embedded controller firmware")]
[PropertyType(typeof(byte))]
FirmwareMajorRelease,
[PropertyName("Embedded Controller Firmware Minor Version")]
[PropertyDescription("Identifies the minor release of the embedded controller firmware")]
[PropertyType(typeof(byte))]
FirmwareMinorRelease,
#endregion
#region version 3.1+
[PropertyName("BIOS Size")]
[PropertyDescription("Extended size of the physical device(s) containing the BIOS")]
[PropertyType(typeof(uint))]
ExtendedBiosRomSize,
[PropertyName("BIOS ROM Size Units")]
[PropertyDescription("Size of the physical device(s) containing the BIOS")]
[PropertyType(typeof(MemorySizeUnit))]
BiosRomSizeUnit,
#endregion
}
#endregion
#region [internal] (emun) SmbiosType001Property: Defines the properties available for the structure type 001 [System Information]
/// <summary>
/// Defines the properties available for the structure type 001 [System Information].
/// </summary>
internal enum SmbiosType001Property
{
#region version 2.0+
[PropertyName("System Manufacturer")]
[PropertyDescription("System Manufacturer")]
[PropertyType(typeof(string))]
Manufacturer,
[PropertyName("Product Name")]
[PropertyDescription("Product Name")]
[PropertyType(typeof(string))]
ProductName,
[PropertyName("Product Version")]
[PropertyDescription("Product Version")]
[PropertyType(typeof(string))]
Version,
[PropertyName("Product Serial Number")]
[PropertyDescription("Product Serial Number")]
[PropertyType(typeof(string))]
SerialNumber,
#endregion
#region version 2.1+
[PropertyName("UUID")]
[PropertyDescription("Universal unique ID number (UUID)")]
[PropertyType(typeof(string))]
UUID,
[PropertyName("Wake Up Type")]
[PropertyDescription("Identifies the event that caused the system to power up")]
[PropertyType(typeof(string))]
WakeUpType,
#endregion
#region version 2.4+
[PropertyName("SKU Number")]
[PropertyDescription("This text string identifies a particular computer configuration for sale")]
[PropertyType(typeof(string))]
SkuNumber,
[PropertyName("Family")]
[PropertyDescription("This text string identifies the family to which a particular computer belongs")]
[PropertyType(typeof(string))]
Family,
#endregion
}
#endregion
#region [internal] (emun) SmbiosType002Property: Defines the properties available for the structure type 002 [Baseboard (or Module) Information]
/// <summary>
/// Defines the properties available for the structure type 002 [Baseboard (or Module) Information].
/// </summary>
internal enum SmbiosType002Property
{
[PropertyName("Mainboard Manufacturer")]
[PropertyDescription("Mainboard Manufacturer")]
[PropertyType(typeof(string))]
Manufacturer,
[PropertyName("Mainboard Name")]
[PropertyDescription("Mainboard Name")]
[PropertyType(typeof(string))]
Product,
[PropertyName("Mainboard Version")]
[PropertyDescription("Mainboard version")]
[PropertyType(typeof(string))]
Version,
[PropertyName("Mainboard Serial Number")]
[PropertyDescription("Mainboard Serial Number")]
[PropertyType(typeof(string))]
SerialNumber,
[PropertyName("Asset Tag")]
[PropertyDescription("Asset Tag")]
[PropertyType(typeof(string))]
AssetTag,
[PropertyName("Hot Swappable")]
[PropertyDescription("The mainboard is hot swappable")]
[PropertyType(typeof(bool))]
HotSwappable,
[PropertyName("Replaceable")]
[PropertyDescription("The mainboard is replaceable")]
[PropertyType(typeof(bool))]
IsReplaceable,
[PropertyName("Removable")]
[PropertyDescription("The mainboard is removable")]
[PropertyType(typeof(bool))]
IsRemovable,
[PropertyName("Required Daughter Board")]
[PropertyDescription("The mainboard required daughter board")]
[PropertyType(typeof(bool))]
RequiredDaughterBoard,
[PropertyName("Hosting Board")]
[PropertyDescription("Determines if is hosting board")]
[PropertyType(typeof(bool))]
IsHostingBoard,
[PropertyName("Location In Chassis")]
[PropertyDescription("String that describes this board's location")]
[PropertyType(typeof(string))]
LocationInChassis,
[PropertyName("Chassis Handle")]
[PropertyDescription("Handle, or instance number, associated with the chassis in which this board resides")]
[PropertyType(typeof(ushort))]
ChassisHandle,
[PropertyName("Mainboard Type")]
[PropertyDescription("Type of board")]
[PropertyType(typeof(string))]
BoardType,
[PropertyName("Mainboard Number Of Contained Object Handles")]
[PropertyDescription("Number (0 to 255) of contained Object Handles that follow")]
[PropertyType(typeof(byte))]
NumberOfContainedObjectHandles,
[PropertyName("Mainboard Contained Object Handles")]
[PropertyDescription("List of handles of other structures (for examples, Baseboard, Processor, Port, System Slots, Memory Device) that are contained by this baseboard")]
[PropertyType(typeof(BaseBoardContainedElementCollection))]
ContainedObjectHandles,
}
#endregion
#region [internal] (emun) SmbiosType003Property: Defines the properties available for the structure type 003 [System Enclosure or Chassis]
/// <summary>
/// Defines the properties available for the structure type 003 [System Enclosure or Chassis].
/// </summary>
internal enum SmbiosType003Property
{
[PropertyName("Manufacturer")]
[PropertyDescription("Manufacturer")]
[PropertyType(typeof(string))]
Manufacturer,
[PropertyName("Chassis Type")]
[PropertyDescription("Chassis Type")]
[PropertyType(typeof(string))]
ChassisType,
[PropertyName("Locked")]
[PropertyDescription("Indicates if chassis lock is present")]
[PropertyType(typeof(string))]
Locked,
[PropertyName("Version")]
[PropertyDescription("Version")]
[PropertyType(typeof(string))]
Version,
[PropertyName("Serial Number")]
[PropertyDescription("Serial Number")]
[PropertyType(typeof(string))]
SerialNumber,
[PropertyName("Asset Tag Number")]
[PropertyDescription("Asset Tag Number")]
[PropertyType(typeof(string))]
AssetTagNumber,
[PropertyName("Boot Up State")]
[PropertyDescription("State of the enclosure when it was last booted")]
[PropertyType(typeof(string))]
BootUpState,
[PropertyName("Power Supply State")]
[PropertyDescription("State of the enclosure’s power supply (or supplies) when last booted")]
[PropertyType(typeof(string))]
PowerSupplyState,
[PropertyName("Thermal State")]
[PropertyDescription("Thermal state of the enclosure when last booted")]
[PropertyType(typeof(string))]
ThermalState,
[PropertyName("Security State")]
[PropertyDescription("Physical security status of the enclosure when last booted")]
[PropertyType(typeof(string))]
SecurityStatus,
[PropertyName("OEM Information")]
[PropertyDescription("OEM or BIOS vendor-specific information")]
[PropertyType(typeof(uint))]
OemDefined,
[PropertyName("Height")]
[PropertyDescription("Height of the enclosure, in 'U's A U is a standard unit of measure for the height of a rack or rack-mountable component")]
[PropertyType(typeof(byte))]
Height,
[PropertyName("Number Of Power Cords")]
[PropertyDescription("Number of power cords associated with the enclosure or chassis")]
[PropertyType(typeof(byte))]
NumberOfPowerCords,
[PropertyName("Contained Elements")]
[PropertyDescription("Number of contained Element records that follow, in the range 0 to 255")]
[PropertyType(typeof(ChassisContainedElementCollection))]
ContainedElements,
[PropertyName("SKU Number")]
[PropertyDescription("String describing the chassis or enclosure SKU number")]
[PropertyType(typeof(string))]
SkuNumber,
[PropertyName("Contained Type")]
[PropertyDescription("Type of element associated")]
[PropertyType(typeof(string))]
ContainedType,
[PropertyName("Contained Type Select")]
[PropertyDescription("Type of selected element associated")]
[PropertyType(typeof(ChassisContainedElementType))]
ContainedTypeSelect,
[PropertyName("Contained Element Maximum")]
[PropertyDescription("Specifies the maximum number of the element type that can be installed in the chassis, in the range 1 to 255")]
[PropertyType(typeof(byte))]
ContainedElementMaximum,
[PropertyName("Contained Type Select")]
[PropertyDescription("Specifies the minimum number of the element type that can be installed in the chassis for the chassis to properly operate, in the range 0 to 254")]
[PropertyType(typeof(byte))]
ContainedElementMinimum
}
#endregion
#region [internal] (emun) SmbiosType004Property: Defines the properties available for the structure type 004 [Processor Information]
/// <summary>
/// Defines the properties available for the structure type 004 [Processor Information].
/// </summary>
internal enum SmbiosType004Property
{
#region version 2.0+
[PropertyName("Socket Designation")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
SocketDesignation,
[PropertyDescription("")]
[PropertyType(typeof(string))]
ProcessorType,
[PropertyDescription("")]
[PropertyType(typeof(string))]
ProcessorFamily,
[PropertyDescription("")]
[PropertyType(typeof(string))]
ProcessorManufacturer,
[PropertyDescription("")]
[PropertyType(typeof(string))]
ProcessorId,
[PropertyDescription("")]
[PropertyType(typeof(string))]
ProcessorVersion,
[PropertyDescription("")]
[PropertyType(typeof(bool))]
IsLegacyMode,
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
VoltageCapability,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
ExternalClock,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
MaximumSpeed,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
CurrentSpeed,
[PropertyDescription("")]
[PropertyType(typeof(bool))]
SocketPopulated,
[PropertyDescription("")]
[PropertyType(typeof(string))]
CpuStatus,
[PropertyDescription("")]
[PropertyType(typeof(string))]
ProcessorUpgrade,
#endregion
#region version 2.1+
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
L1CacheHandle,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
L2CacheHandle,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
L3CacheHandle,
#endregion
#region version 2.3+
[PropertyType(typeof(string))]
SerialNumber,
[PropertyDescription("")]
[PropertyType(typeof(string))]
AssetTag,
[PropertyDescription("")]
[PropertyType(typeof(string))]
PartNumber,
#endregion
#region version 2.6+
[PropertyDescription("")]
[PropertyType(typeof(byte))]
CoreCount,
[PropertyDescription("")]
[PropertyType(typeof(byte))]
CoreEnabled,
[PropertyDescription("")]
[PropertyType(typeof(byte))]
ThreadCount,
[PropertyDescription("")]
[PropertyType(typeof(bool))]
Capable64Bits,
[PropertyDescription("")]
[PropertyType(typeof(bool))]
Capable128Bits,
[PropertyDescription("")]
[PropertyType(typeof(bool))]
Arm64SocIdSupported,
[PropertyDescription("")]
[PropertyType(typeof(bool))]
MultiCore,
[PropertyDescription("")]
[PropertyType(typeof(bool))]
HardwareThreadPerCore,
[PropertyDescription("")]
[PropertyType(typeof(bool))]
ExecuteProtectionSupport,
[PropertyDescription("")]
[PropertyType(typeof(bool))]
EnhancedVirtualizationInstructions,
[PropertyDescription("")]
[PropertyType(typeof(bool))]
PowerPerformanceControlSupport,
#endregion
#region version 3.0+
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
CoreCount2,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
CoreEnabled2,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
ThreadCount2,
#endregion
#region version 3.6+
[PropertyDescription("Number of enabled threads per processor")]
[PropertyType(typeof(ushort))]
ThreadEnabled
#endregion
}
#endregion
#region [internal] (emun) SmbiosType005Property: Defines the properties available for the structure type 005, obsolete [Memory Controller Information]
/// <summary>
/// Defines the properties available for the structure type 005, obsolete [Memory Controller Information].
/// </summary>
internal enum SmbiosType005Property
{
#region version 2.0+
[PropertyName("Error Detecting Method")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
ErrorDetectingMethod,
[PropertyName("Error Correcting Capabilitiesn")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
ErrorCorrectingCapabilities,
[PropertyName("Supported Interleave")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
SupportedInterleave,
[PropertyName("Current Interleave")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
CurrentInterleave,
[PropertyName("Maximum Memory Module Size")]
[PropertyDescription("")]
[PropertyType(typeof(int))]
MaximumMemoryModuleSize,
[PropertyName("Supported Speeds")]
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
SupportedSpeeds,
[PropertyName("Supported Memory Types")]
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
SupportedMemoryTypes,
[PropertyName("Memory Module Voltages")]
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
MemoryModuleVoltages,
[PropertyName("Number Memory Slots")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
NumberMemorySlots,
[PropertyName("Contained Memory Modules")]
[PropertyDescription("")]
[PropertyType(typeof(MemoryControllerContainedElementCollection))]
ContainedMemoryModules,
#endregion
#region version 2.1+
[PropertyName("Enabled Error Correcting Capabilities")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
EnabledErrorCorrectingCapabilities,
#endregion
}
#endregion
#region [internal] (emun) SmbiosType006Property: Defines the properties available for the structure type 006, obsolete [Memory Module Information]
/// <summary>
/// Defines the properties available for the structure type 006, obsolete [Memory Module Information].
/// </summary>
internal enum SmbiosType006Property
{
[PropertyDescription("")]
[PropertyType(typeof(string))]
SocketDesignation,
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
BankConnections,
[PropertyDescription("")]
[PropertyType(typeof(byte))]
CurrentSpeed,
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
CurrentMemoryType,
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
InstalledSize,
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
EnabledSize,
[PropertyDescription("")]
[PropertyType(typeof(string))]
ErrorStatus,
}
#endregion
#region [internal] (emun) SmbiosType007Property: Defines the properties available for the structure type 007 [Cache Information]
/// <summary>
/// Defines the properties available for the structure type 007 [Cache Information].
/// </summary>
internal enum SmbiosType007Property
{
#region version 2.0+
[PropertyDescription("")]
[PropertyType(typeof(string))]
SocketDesignation,
[PropertyDescription("")]
[PropertyType(typeof(string))]
OperationalMode,
[PropertyDescription("")]
[PropertyType(typeof(bool?))]
CacheEnabled,
[PropertyDescription("")]
[PropertyType(typeof(string))]
CacheLocation,
[PropertyDescription("")]
[PropertyType(typeof(bool?))]
CacheSocketed,
[PropertyDescription("")]
[PropertyType(typeof(byte?))]
CacheLevel,
[PropertyDescription("")]
[PropertyType(typeof(int?))]
MaximumCacheSize,
[PropertyDescription("")]
[PropertyType(typeof(int?))]
InstalledCacheSize,
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
SupportedSramTypes,
#endregion
#region version 2.1+
[PropertyDescription("")]
[PropertyType(typeof(string))]
CurrentSramType,
[PropertyDescription("")]
[PropertyType(typeof(byte?))]
CacheSpeed,
[PropertyDescription("")]
[PropertyType(typeof(string))]
ErrorCorrectionType,
[PropertyDescription("")]
[PropertyType(typeof(string))]
SystemCacheType,
[PropertyDescription("")]
[PropertyType(typeof(string))]
Associativity,
#endregion
#region version 3.1+
[PropertyDescription("")]
[PropertyType(typeof(uint?))]
MaximumCacheSize2,
[PropertyDescription("")]
[PropertyType(typeof(uint?))]
InstalledCacheSize2,
#endregion
}
#endregion
#region [internal] (emun) SmbiosType008Property: Defines the properties available for the structure type 008 [Port Connector Information]
/// <summary>
/// Defines the properties available for the structure type 008 [Port Connector Information].
/// </summary>
internal enum SmbiosType008Property
{
[PropertyDescription("")]
[PropertyType(typeof(string))]
InternalReferenceDesignator,
[PropertyDescription("")]
[PropertyType(typeof(string))]
InternalConnectorType,
[PropertyDescription("")]
[PropertyType(typeof(string))]
ExternalReferenceDesignator,
[PropertyDescription("")]
[PropertyType(typeof(string))]
ExternalConnectorType,
[PropertyDescription("")]
[PropertyType(typeof(string))]
PortType,
}
#endregion
#region [internal] (emun) SmbiosType009Property: Defines the properties available for the structure type 009 [System Slots]
/// <summary>
/// Defines the properties available for the structure type 009 [System Slots].
/// </summary>
internal enum SmbiosType009Property
{
#region version 2.0+
[PropertyName("Slot Designation")]
[PropertyDescription("String number for reference designation")]
[PropertyType(typeof(string))]
SlotDesignation,
[PropertyName("Slot Type")]
[PropertyDescription("Slot Type")]
[PropertyType(typeof(string))]
SlotType,
[PropertyName("Slot Data Bus Width")]
[PropertyDescription("Slot Data Bus Width")]
[PropertyType(typeof(string))]
SlotDataBusWidth,
[PropertyName("Current Usage")]
[PropertyDescription("Slot Current Usage")]
[PropertyType(typeof(string))]
CurrentUsage,
[PropertyName("Slot Length")]
[PropertyDescription("Slot Length")]
[PropertyType(typeof(string))]
SlotLength,
[PropertyName("Slot Id")]
[PropertyDescription("Slot Identifier")]
[PropertyType(typeof(string))]
SlotId,
#endregion
#region version 2.0+ - 2.1+
[PropertyName("Slot Characteristics")]
[PropertyDescription("Slot Characteristics")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
SlotCharacteristics,
#endregion
#region version 2.6+
[PropertyName("Segment Bus Function")]
[PropertyDescription("Segment Bus Function")]
[PropertyType(typeof(string))]
SegmentBusFunction,
[PropertyName("Bus Device Function")]
[PropertyDescription("Bus Device Function")]
[PropertyType(typeof(string))]
BusDeviceFunction,
#endregion
#region version 3.2
[PropertyName("Peers Devices")]
[PropertyDescription("Peers Devices")]
[PropertyType(typeof(PeerDevicesCollection))]
PeerDevices,
[PropertyName("Segment Group Number")]
[PropertyDescription("Defined in the PCI Firmware Specification")]
[PropertyType(typeof(ushort))]
SegmentGroupNumber,
[PropertyName("Bus Device Function")]
[PropertyDescription("Bus Device Function (Peer)")]
[PropertyType(typeof(string))]
BusDeviceFunctionPeer,
[PropertyName("Data Bus Width")]
[PropertyDescription("Data Bus Width (Peer)")]
[PropertyType(typeof(byte))]
DataBusWidth,
#endregion
#region version 3.4
[PropertyName("Slot Information")]
[PropertyDescription("The PCI Express Generation")]
[PropertyType(typeof(string))]
SlotInformation,
[PropertyName("Slot Physical Width")]
[PropertyDescription("Indicates the physical width of the slot")]
[PropertyType(typeof(string))]
SlotPhysicalWidth,
[PropertyName("Slot Pitch")]
[PropertyDescription("Indicates the pitch of the slot in units of 1/100 millimeter")]
[PropertyType(typeof(int))]
SlotPitch,
#endregion
#region version 3.5
[PropertyName("Slot Height")]
[PropertyDescription("Indicates the maximum supported card height for the slot")]
[PropertyType(typeof(byte))]
SlotHeight
#endregion
}
#endregion
#region [internal] (emun) SmbiosType010Property: Defines the properties available for the structure type 010, obsolete [On Board Devices Information]
/// <summary>
/// Defines the properties available for the structure type 010, obsolete [On Board Devices Information].
/// </summary>
internal enum SmbiosType010Property
{
[PropertyDescription("")]
[PropertyType(typeof(bool))]
Enabled,
[PropertyDescription("")]
[PropertyType(typeof(string))]
DeviceType,
[PropertyDescription("")]
[PropertyType(typeof(string))]
Description,
}
#endregion
#region [internal] (emun) SmbiosType011Property: Defines the properties available for the structure type 011 [OEM strings]
/// <summary>
/// Defines the properties available for the structure type 011 [OEM strings].
/// </summary>
internal enum SmbiosType011Property
{
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
Values,
}
#endregion
#region [internal] (emun) SmbiosType012Property: Defines the properties available for the structure type 012 [System Configuration Options]
/// <summary>
/// Defines the properties available for the structure type 012 [System Configuration Options].
/// </summary>
internal enum SmbiosType012Property
{
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
Values,
}
#endregion
#region [internal] (emun) SmbiosType013Property: Defines the properties available for the structure type 013 [BIOS Language Information]
/// <summary>
/// Defines the properties available for the structure type 013 [BIOS Language Information].
/// </summary>
internal enum SmbiosType013Property
{
#region version 2.0+
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
InstallableLanguages,
[PropertyDescription("")]
[PropertyType(typeof(bool))]
IsCurrentAbbreviated,
[PropertyDescription("")]
[PropertyType(typeof(string))]
Current,
#endregion
}
#endregion
#region [internal] (emun) SmbiosType014Property: Defines the properties available for the structure type 014 [Group Associations]
/// <summary>
/// Defines the properties available for the structure type 014 [Group Associations].
/// </summary>
internal enum SmbiosType014Property
{
[PropertyDescription("")]
[PropertyType(typeof(string))]
GroupName,
[PropertyDescription("")]
[PropertyType(typeof(GroupAssociationElementCollection))]
ContainedElements,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
Handle,
[PropertyDescription("")]
[PropertyType(typeof(SmbiosStructure))]
Structure,
}
#endregion
#region [internal] (emun) SmbiosType015Property: Defines the properties available for the structure type 015 [System Event Log]
/// <summary>
/// Defines the properties available for the structure type 015 [System Event Log].
/// </summary>
internal enum SmbiosType015Property
{
[PropertyName("Log Area Length")]
[PropertyDescription("The length, in bytes, of the overall event log area")]
[PropertyType(typeof(int))]
LogAreaLength,
[PropertyName("Log Header")]
[PropertyDescription("Defines the starting offset (or index) within the nonvolatile storage of the event-log’s header from the Access Method Address")]
[PropertyType(typeof(string))]
LogHeaderStartOffset,
[PropertyName("Data Start Offset")]
[PropertyDescription("Defines the starting offset (or index) within the nonvolatile storage of the event-log’s first data byte, from the Access Method Address")]
[PropertyType(typeof(int))]
DataStartOffset,
[PropertyName("Access Method")]
[PropertyDescription("Defines the Location and Method used by higher-level software to access the log area")]
[PropertyType(typeof(string))]
AccessMethod,
[PropertyName("Log Status")]
[PropertyDescription("Current status of the system event-log")]
[PropertyType(typeof(string))]
LogStatus,
[PropertyName("Access Method Address")]
[PropertyDescription("Access Method Address")]
[PropertyType(typeof(string))]
AccessMethodAddress,
[PropertyName("Log Change Token")]
[PropertyDescription("Unique token that is reassigned every time the event log changes")]
[PropertyType(typeof(string))]
LogChangeToken,
[PropertyName("Log Header Format")]
[PropertyDescription("Format of the log header area")]
[PropertyType(typeof(string))]
LogHeaderFormat,
[PropertyName("Supported Log Type Descriptors")]
[PropertyDescription("Number of supported event log type descriptors")]
[PropertyType(typeof(byte))]
SupportedLogTypeDescriptors,
[PropertyName("List Supported Event Log Type Descriptors")]
[PropertyDescription("List of Event Log Type Descriptors")]
[PropertyType(typeof(SupportedEventLogTypeDescriptorsCollection))]
ListSupportedEventLogTypeDescriptors,
}
#endregion
#region [internal] (emun) SmbiosType016Property: Defines the properties available for the structure type 016 [Physical Memory Array]
/// <summary>
/// Defines the properties available for the structure type 016 [Physical Memory Array].
/// </summary>
internal enum SmbiosType016Property
{
#region version 2.1+
[PropertyDescription("")]
[PropertyType(typeof(string))]
Location,
[PropertyDescription("")]
[PropertyType(typeof(string))]
Use,
[PropertyDescription("")]
[PropertyType(typeof(string))]
MemoryErrorCorrection,
[PropertyDescription("")]
[PropertyType(typeof(uint))]
MaximumCapacity,
[PropertyDescription("")]
[PropertyType(typeof(string))]
MemoryErrorInformationHandle,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
NumberOfMemoryDevices,
#endregion
#region version 2.7+
[PropertyDescription("")]
[PropertyType(typeof(ulong))]
ExtendedMaximumCapacity,
#endregion
}
#endregion
#region [internal] (emun) SmbiosType017Property: Defines the properties available for the structure type 017 [Memory Device]
/// <summary>
/// Defines the properties available for the structure type 017 [Memory Device].
/// </summary>
internal enum SmbiosType017Property
{
#region version 2.1+
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
PhysicalMemoryArrayHandle,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
MemoryErrorInformationHandle,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
TotalWidth,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
DataWidth,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
Size,
[PropertyDescription("")]
[PropertyType(typeof(string))]
FormFactor,
[PropertyDescription("")]
[PropertyType(typeof(byte))]
DeviceSet,
[PropertyDescription("")]
[PropertyType(typeof(string))]
DeviceLocator,
[PropertyDescription("")]
[PropertyType(typeof(string))]
MemoryType,
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
TypeDetail,
#endregion
#region version 2.3+
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
Speed,
[PropertyDescription("")]
[PropertyType(typeof(string))]
Manufacturer,
[PropertyDescription("")]
[PropertyType(typeof(string))]
SerialNumber,
[PropertyDescription("")]
[PropertyType(typeof(string))]
AssetTag,
[PropertyDescription("")]
[PropertyType(typeof(string))]
PartNumber,
[PropertyDescription("")]
[PropertyType(typeof(byte))]
Rank,
#endregion
#region version 2.7+
[PropertyDescription("")]
[PropertyType(typeof(uint))]
ExtendedSize,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
ConfiguredMemoryClockSpeed,
[PropertyDescription("")]
[PropertyType(typeof(string))]
BankLocator,
#endregion
#region version 2.8+
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
MinimumVoltage,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
MaximumVoltage,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
ConfiguredVoltage,
#endregion
#region version 3.2+
[PropertyDescription("")]
[PropertyType(typeof(string))]
MemoryTechnology,
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
MemoryOperatingModeCapability,
[PropertyDescription("")]
[PropertyType(typeof(string))]
FirmwareVersion,
[PropertyDescription("")]
[PropertyType(typeof(string))]
ModuleManufacturerId,
[PropertyDescription("")]
[PropertyType(typeof(string))]
ModuleProductId,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
MemorySubSystemControllerManufacturerId,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
MemorySubSystemControllerProductId,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
NonVolatileSize,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
VolatileSize,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
CacheSize,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
LogicalSize,
#endregion
#region version 3.3+
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
ExtendedSpeed,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
ExtendedConfiguredMemorySpeed,
#endregion
#region version 3.7+
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
PMIC0ManufacturerId,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
PMIC0RevisionNumber,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
RCDManufacturerId,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
RCDRevisionNumber
#endregion
}
#endregion
#region [internal] (emun) SmbiosType018Property: Defines the properties available for the structure type 018 [32-Bit Memory Error Information]
/// <summary>
/// Defines the properties available for the structure type 018 [32-Bit Memory Error Information].
/// </summary>
internal enum SmbiosType018Property
{
#region version 2.1+
[PropertyDescription("")]
[PropertyType(typeof(string))]
ErrorType,
[PropertyDescription("")]
[PropertyType(typeof(string))]
ErrorGranularity,
[PropertyDescription("")]
[PropertyType(typeof(string))]
ErrorOperation,
[PropertyDescription("")]
[PropertyType(typeof(uint))]
VendorSyndrome,
[PropertyDescription("")]
[PropertyType(typeof(uint))]
MemoryArrayErrorAddress,
[PropertyDescription("")]
[PropertyType(typeof(uint))]
DeviceErrorAddress,
[PropertyDescription("")]
[PropertyType(typeof(uint))]
ErrorResolution
#endregion
}
#endregion
#region [internal] (emun) SmbiosType019Property: Defines the properties available for the structure type 019 [Memory Array Mapped Address]
/// <summary>
/// Defines the properties available for the structure type 019 [Memory Array Mapped Address].
/// </summary>
internal enum SmbiosType019Property
{
#region version 2.1+
[PropertyDescription("")]
[PropertyType(typeof(uint))]
StartingAddress,
[PropertyDescription("")]
[PropertyType(typeof(uint))]
EndingAddress,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
MemoryArrayHandle,
[PropertyDescription("")]
[PropertyType(typeof(byte))]
PartitionWidth,
#endregion
#region version 2.7+
[PropertyDescription("")]
[PropertyType(typeof(ulong))]
ExtendedStartingAddress,
[PropertyDescription("")]
[PropertyType(typeof(ulong))]
ExtendedEndingAddress,
#endregion
}
#endregion
#region [internal] (emun) SmbiosType020Property: Defines the properties available for the structure type 020 [Memory Device Mapped Address]
/// <summary>
/// Defines the properties available for the structure type 020 [Memory Device Mapped Address].
/// </summary>
internal enum SmbiosType020Property
{
#region version 2.1+
[PropertyDescription("")]
[PropertyType(typeof(uint))]
StartingAddress,
[PropertyDescription("")]
[PropertyType(typeof(uint))]
EndingAddress,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
MemoryDeviceHandle,
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
MemoryArrayMappedAddressHandle,
[PropertyDescription("")]
[PropertyType(typeof(byte))]
PartitionRowPosition,
[PropertyDescription("")]
[PropertyType(typeof(MemoryDeviceMappedAddressInterleavedPosition))]
InterleavePosition,
[PropertyDescription("")]
[PropertyType(typeof(byte))]
InterleavedDataDepth,
#endregion
#region version 2.7+
[PropertyDescription("")]
[PropertyType(typeof(ulong))]
ExtendedStartingAddress,
[PropertyDescription("")]
[PropertyType(typeof(ulong))]
ExtendedEndingAddress
#endregion
}
#endregion
#region [internal] (emun) SmbiosType021Property: Defines the properties available for the structure type 021 [Built-in Pointing Device]
/// <summary>
/// Defines the properties available for the structure type 021 [Built-in Pointing Device].
/// </summary>
internal enum SmbiosType021Property
{
#region version 2.1+
[PropertyName("Type")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Type,
[PropertyName("Interface")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Interface,
[PropertyName("Number Of Buttons")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
NumberOfButtons,
#endregion
}
#endregion
#region [internal] (emun) SmbiosType022Property: Defines the properties available for the structure type 022 [Portable Battery]
/// <summary>
/// Defines the properties available for the structure type 022 [Built-in Pointing Device].
/// </summary>
internal enum SmbiosType022Property
{
#region version 2.1+
[PropertyName("Location")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Location,
[PropertyName("Manufacturer")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Manufacturer,
[PropertyName("Manufacture Date")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
ManufactureDate,
[PropertyName("Serial Number")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
SerialNumber,
[PropertyName("Device Name")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
DeviceName,
[PropertyName("Device Chemistry")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
DeviceChemistry,
[PropertyName("Design Capacity")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
DesignCapacity,
[PropertyName("Design Voltage")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
DesignVoltage,
[PropertyName("SBDS Version Number")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
SbdsVersionNumber,
[PropertyName("Maximun Error In Battery Data")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
MaximunErrorInBatteryData,
#endregion
#region version 2.2+
[PropertyName("SBDS Serial Number")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
SbdsSerialNumber,
[PropertyName("SBDS Manufacture Date")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
SbdsManufactureDate,
[PropertyName("SBDS Device Chemistry")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
SbdsDeviceChemistry,
[PropertyName("Design Capacity Multiplier")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
DesignCapacityMultiplier,
[PropertyName("OEM Specific")]
[PropertyDescription("")]
[PropertyType(typeof(uint))]
OemSpecific,
#endregion
}
#endregion
#region [internal] (emun) SmbiosType023Property: Defines the properties available for the structure type 023 [System Reset]
/// <summary>
/// Defines the properties available for the structure type 023 [System Reset].
/// </summary>
internal enum SmbiosType023Property
{
[PropertyName("Boot Option")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
BootOption,
[PropertyName("Boot Option On Limit")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
BootOptionOnLimit,
[PropertyName("Status")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Status,
[PropertyName("Watchdog Timer")]
[PropertyDescription("")]
[PropertyType(typeof(bool))]
WatchdogTimer,
[PropertyName("Reset Count")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
ResetCount,
[PropertyName("Reset Limit")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
ResetLimit,
[PropertyName("Timer Interval")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
TimerInterval,
[PropertyName("Timeout")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
Timeout,
}
#endregion
#region [internal] (emun) SmbiosType024Property: Defines the properties available for the structure type 024 [Hardware Security]
/// <summary>
/// Defines the properties available for the structure type 024 [Hardware Security].
/// </summary>
internal enum SmbiosType024Property
{
[PropertyName("Front Panel Reset Status")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
FrontPanelResetStatus,
[PropertyName("Administrator Password Status")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
AdministratorPasswordStatus,
[PropertyName("Keyboard Password Status")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
KeyboardPasswordStatus,
[PropertyName("Power-On Password Status")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
PowerOnPasswordStatus
}
#endregion
#region [internal] (emun) SmbiosType025Property: Defines the properties available for the structure type 025 [System Power Controls]
/// <summary>
/// Defines the properties available for the structure type 025 [System Power Controls].
/// </summary>
internal enum SmbiosType025Property
{
[PropertyName("Month")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
Month,
[PropertyName("Day")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
Day,
[PropertyName("Hour")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
Hour,
[PropertyName("Minute")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
Minute,
[PropertyName("Second")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
Second,
}
#endregion
#region [internal] (emun) SmbiosType026Property: Defines the properties available for the structure type 026 [Voltage Probe]
/// <summary>
/// Defines the properties available for the structure type 026 [Voltage Probe].
/// </summary>
internal enum SmbiosType026Property
{
[PropertyName("Description")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Description,
[PropertyName("Location")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Location,
[PropertyName("Status")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Status,
[PropertyName("Maximum Value")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
MaximumValue,
[PropertyName("Minimum Value")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
MinimumValue,
[PropertyName("Resolution")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
Resolution,
[PropertyName("Tolerance")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
Tolerance,
[PropertyName("Accuracy")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
Accuracy,
[PropertyName("OEM Defined")]
[PropertyDescription("")]
[PropertyType(typeof(uint))]
OemDefined,
[PropertyName("Nominal Value")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
NominalValue,
}
#endregion
#region [internal] (emun) SmbiosType027Property: Defines the properties available for the structure type 027 [Cooling Device]
/// <summary>
/// Defines the properties available for the structure type 027 [Cooling Device].
/// </summary>
internal enum SmbiosType027Property
{
#region version 2.2+
[PropertyName("Temperature Probe Handle")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
TemperatureProbeHandle,
[PropertyName("Device Type")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
DeviceType,
[PropertyName("Status")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Status,
[PropertyName("Cooling Unit Group")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
CoolingUnitGroup,
[PropertyName("OEM Defined")]
[PropertyDescription("")]
[PropertyType(typeof(uint))]
OemDefined,
[PropertyName("Nominal Speed")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
NominalSpeed,
#endregion
#region version 2.7+
[PropertyName("Description")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Description,
#endregion
}
#endregion
#region [internal] (emun) SmbiosType028Property: Defines the properties available for the structure type 028 [Temperature Probe]
/// <summary>
/// Defines the properties available for the structure type 028 [Temperature Probe].
/// </summary>
internal enum SmbiosType028Property
{
[PropertyName("Description")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Description,
[PropertyName("Location")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Location,
[PropertyName("Status")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Status,
[PropertyName("Maximum Value")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
MaximumValue,
[PropertyName("Minimum Value")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
MinimumValue,
[PropertyName("Resolution")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
Resolution,
[PropertyName("Tolerance")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
Tolerance,
[PropertyName("Accuracy")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
Accuracy,
[PropertyName("OEM Defined")]
[PropertyDescription("")]
[PropertyType(typeof(uint))]
OemDefined,
[PropertyName("Nominal Value")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
NominalValue
}
#endregion
#region [internal] (emun) SmbiosType029Property: Defines the properties available for the structure type 029 [Electrical Current Probe]
/// <summary>
/// Defines the properties available for the structure type 029 [Electrical Current Probe].
/// </summary>
internal enum SmbiosType029Property
{
[PropertyName("Description")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Description,
[PropertyName("Location")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Location,
[PropertyName("Status")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Status,
[PropertyName("Maximum Value")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
MaximumValue,
[PropertyName("Minimum Value")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
MinimumValue,
[PropertyName("Resolution")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
Resolution,
[PropertyName("Tolerance")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
Tolerance,
[PropertyName("Accuracy")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
Accuracy,
[PropertyName("OEM Defined")]
[PropertyDescription("")]
[PropertyType(typeof(uint))]
OemDefined,
[PropertyName("Nominal Value")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
NominalValue
}
#endregion
#region [internal] (emun) SmbiosType030Property: Defines the properties available for the structure type 030 [Out-of-Band Remote Access]
/// <summary>
/// Defines the properties available for the structure type 030 [Out-of-Band Remote Access].
/// </summary>
internal enum SmbiosType030Property
{
[PropertyName("Manufacturer Name")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
ManufacturerName,
[PropertyName("OutBound Connection")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
OutBoundConnection,
[PropertyName("InBound Connection")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
InBoundConnection
}
#endregion
#region [internal] (emun) SmbiosType031Property: Defines the properties available for the structure type 031 [Boot Integrity Services (BIS) Entry Point]
/// <summary>
/// Defines the properties available for the structure type 031 [Boot Integrity Services (BIS) Entry Point].
/// </summary>
internal enum SmbiosType031Property
{
[PropertyName("Checksum")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
Checksum,
[PropertyName("16-Bis Entry Point Address")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
BisEntryPointAddress16,
[PropertyName("32-Bis Entry Point Address")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
BisEntryPointAddress32
}
#endregion
#region [internal] (emun) SmbiosType032Property: Defines the properties available for the structure type 032 [System Boot Information]
/// <summary>
/// Defines the properties available for the structure type 032 [System Boot Information].
/// </summary>
internal enum SmbiosType032Property
{
[PropertyName("Reserved")]
[PropertyDescription("Reserved for future assignment by this specification; all bytes are set to 00h")]
[PropertyType(typeof(int))]
Reserved,
[PropertyName("Boot Status")]
[PropertyDescription("Status and Additional Data fields that identify the boot status")]
[PropertyType(typeof(string))]
BootStatus
}
#endregion
#region [internal] (emun) SmbiosType033Property: Defines the properties available for the structure type 033 [64-Bit Memory Error Information]
/// <summary>
/// Defines the properties available for the structure type 033 [64-Bit Memory Error Information].
/// </summary>
internal enum SmbiosType033Property
{
[PropertyName("Error Type")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
ErrorType,
[PropertyName("Error Granularity")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
ErrorGranularity,
[PropertyName("Error Operation")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
ErrorOperation,
[PropertyName("Vendor Syndrome")]
[PropertyDescription("")]
[PropertyType(typeof(uint))]
VendorSyndrome,
[PropertyName("Memory Array Error Address")]
[PropertyDescription("")]
[PropertyType(typeof(ulong))]
MemoryArrayErrorAddress,
[PropertyName("Device Error Address")]
[PropertyDescription("")]
[PropertyType(typeof(ulong))]
DeviceErrorAddress,
[PropertyName("Error Resolution")]
[PropertyDescription("")]
[PropertyType(typeof(uint))]
ErrorResolution
}
#endregion
#region [internal] (emun) SmbiosType034Property: Defines the properties available for the structure type 034 [Management Device]
/// <summary>
/// Defines the properties available for the structure type 034 [Management Device].
/// </summary>
internal enum SmbiosType034Property
{
[PropertyName("Description")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Description,
[PropertyName("Type")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Type,
[PropertyName("Address")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Address,
[PropertyName("Address Type")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
AddressType
}
#endregion
#region [internal] (emun) SmbiosType035Property: Defines the properties available for the structure type 035 [Management Device Component]
/// <summary>
/// Defines the properties available for the structure type 035 [Management Device Component].
/// </summary>
internal enum SmbiosType035Property
{
[PropertyName("Description")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Description,
[PropertyName("Management Device Handle")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
ManagementDeviceHandle,
[PropertyName("Component Handle")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
ComponentHandle,
[PropertyName("Threshold Handle")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
ThresholdHandle
}
#endregion
#region [internal] (emun) SmbiosType036Property: Defines the properties available for the structure type 036 [Management Device Threshold Data]
/// <summary>
/// Defines the properties available for the structure type 036 [Management Device Threshold Data].
/// </summary>
internal enum SmbiosType036Property
{
[PropertyName("Lower Non Critical")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
LowerNonCritical,
[PropertyName("Upper Non Critical")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
UpperNonCritical,
[PropertyName("Lower Critical")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
LowerCritical,
[PropertyName("Upper Critical")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
UpperCritical,
[PropertyName("Lower Non Recoverable")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
LowerNonRecoverable,
[PropertyName("Upper Non Recoverable")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
UpperNonRecoverable
}
#endregion
#region [internal] (emun) SmbiosType037Property: Defines the properties available for the structure type 037 [Memory Channel]
/// <summary>
/// Defines the properties available for the structure type 037 [Memory Channel].
/// </summary>
internal enum SmbiosType037Property
{
[PropertyName("Channel Type")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
ChannelType,
[PropertyName("Maximum Channel Load")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
MaximumChannelLoad,
[PropertyName("Devices")]
[PropertyDescription("")]
[PropertyType(typeof(MemoryChannelElementCollection))]
Devices,
[PropertyName("Load")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
Load,
[PropertyName("Handle")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
Handle
}
#endregion
#region [internal] (emun) SmbiosType038Property: Defines the properties available for the structure type 038 [IPMI Device Information]
/// <summary>
/// Defines the properties available for the structure type 038 [IPMI Device Information].
/// </summary>
internal enum SmbiosType038Property
{
[PropertyName("Interface Type")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
InterfaceType,
[PropertyName("Specification Revision")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
SpecificationRevision,
[PropertyName("I2C Slave Address")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
I2CSlaveAddress,
[PropertyName("NV Storage Device Address")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
NvStorageDeviceAddress,
[PropertyName("Base Address")]
[PropertyDescription("")]
[PropertyType(typeof(ulong))]
BaseAddress,
[PropertyName("Register Spacing")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
RegisterSpacing,
[PropertyName("LS-Bit")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
LsBit,
[PropertyName("Specified Info")]
[PropertyDescription("")]
[PropertyType(typeof(bool))]
SpecifiedInfo,
[PropertyName("Polarity")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Polarity,
[PropertyName("Trigger Mode")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
TriggerMode,
[PropertyName("Interrupt Number")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
InterruptNumber
}
#endregion
#region [internal] (emun) SmbiosType039Property: Defines the properties available for the structure type 039 [System Power Supply]
/// <summary>
/// Defines the properties available for the structure type 039 [System Power Supply].
/// </summary>
internal enum SmbiosType039Property
{
[PropertyName("Is Redundant")]
[PropertyDescription("")]
[PropertyType(typeof(bool))]
IsRedundant,
[PropertyName("Location")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Location,
[PropertyName("Device Name")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
DeviceName,
[PropertyName("Manufacturer")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Manufacturer,
[PropertyName("Serial Number")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
SerialNumber,
[PropertyName("Asset Tag Number")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
AssetTagNumber,
[PropertyName("Model Part Number")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
ModelPartNumber,
[PropertyName("Revision Level")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
RevisionLevel,
[PropertyName("Max Power Capacity")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
MaxPowerCapacity,
[PropertyName("Supply Type")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
SupplyType,
[PropertyName("Status")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Status,
[PropertyName("Input Voltage Range")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
InputVoltageRange,
[PropertyName("Is Plugged")]
[PropertyDescription("")]
[PropertyType(typeof(bool))]
IsPlugged,
[PropertyName("Entry Length")]
[PropertyDescription("")]
[PropertyType(typeof(bool))]
IsPresent,
[PropertyName("Is Hot Replaceable")]
[PropertyDescription("")]
[PropertyType(typeof(bool))]
IsHotReplaceable,
[PropertyName("Input Voltage Probe Handle")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
InputVoltageProbeHandle,
[PropertyName("Cooling Device Handle")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
CoolingDeviceHandle,
[PropertyName("Input Current Probe Handle")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
InputCurrentProbeHandle
}
#endregion
#region [internal] (emun) SmbiosType040Property: Defines the properties available for the structure type 040 [Additional Information]
/// <summary>
/// Defines the properties available for the structure type 040 [Additional Information].
/// </summary>
internal enum SmbiosType040Property
{
[PropertyName("Entry Length")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
EntryLength,
[PropertyName("Referenced Handle")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
ReferencedHandle,
[PropertyName("Referenced Offset")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
ReferencedOffset,
[PropertyName("String Value")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
StringValue,
[PropertyName("Value")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
Value,
[PropertyName("Entries")]
[PropertyDescription("")]
[PropertyType(typeof(AdditionalInformationEntryCollection))]
Entries
}
#endregion
#region [internal] (emun) SmbiosType041Property: Defines the properties available for the structure type 041 [Onboard Devices Extended Information]
/// <summary>
/// Defines the properties available for the structure type 041 [Onboard Devices Extended Information].
/// </summary>
internal enum SmbiosType041Property
{
[PropertyName("Reference Designation")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
ReferenceDesignation,
[PropertyName("Device Status")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
DeviceStatus,
[PropertyName("Device Type")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
DeviceType
}
#endregion
#region [internal] (emun) SmbiosType042Property: Defines the properties available for the structure type 042 [Management Controller Host Interface]
/// <summary>
/// Defines the properties available for the structure type 042 [Management Controller Host Interface].
/// </summary>
internal enum SmbiosType042Property
{
[PropertyName("Interface Type")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
InterfaceType,
[PropertyName("Interface Type Specific Data")]
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<byte>))]
InterfaceTypeSpecificData,
[PropertyName("Protocols")]
[PropertyDescription("")]
[PropertyType(typeof(ManagementControllerHostInterfaceProtocolRecordsCollection))]
Protocols,
[PropertyName("Protocol Type")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
ProtocolType,
[PropertyName("Protocol Type Specific Data")]
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<byte>))]
ProtocolTypeSpecificData
}
#endregion
#region [internal] (emun) SmbiosType043Property: Defines the properties available for the structure type 043 [TPM Device]
/// <summary>
/// Defines the properties available for the structure type 043 [TPM Device].
/// </summary>
internal enum SmbiosType043Property
{
#region Version 3.1+
[PropertyName("Vendor Id")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
VendorId,
[PropertyName("Vendor Id Description")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
VendorIdDescription,
[PropertyName("Major Spec Version")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
MajorSpecVersion,
[PropertyName("Minor Spec Version")]
[PropertyDescription("")]
[PropertyType(typeof(byte))]
MinorSpecVersion,
[PropertyName("Firmware Version")]
[PropertyDescription("")]
[PropertyType(typeof(TpmFirmwareVersion))]
FirmwareVersion,
[PropertyName("Description")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Description,
[PropertyName("Description")]
[PropertyDescription("")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
Characteristics,
[PropertyName("OEM Defined")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
OemDefined,
#endregion
}
#endregion
#region [internal] (emun) SmbiosType044Property: Defines the properties available for the structure type 044 [Processor Additional Information]
/// <summary>
/// Defines the properties available for the structure type 044 [Processor Additional Information].
/// </summary>
internal enum SmbiosType044Property
{
#region Version 3.3+
[PropertyName("Referenced Handle")]
[PropertyDescription("")]
[PropertyType(typeof(ushort))]
ReferencedHandle,
[PropertyName("Processor Specific Block")]
[PropertyDescription("")]
[PropertyType(typeof(ProcessorSpecificInformationBlock))]
ProcessorSpecificBlock
#endregion
}
#endregion
#region [internal] (emun) SmbiosType045Property: Defines the properties available for the structure type 045 [Firmware Inventory Information]
/// <summary>
/// Defines the properties available for the structure type 045 [Firmware Inventory Information].
/// </summary>
internal enum SmbiosType045Property
{
#region Version 3.5+
[PropertyName("Firmware Component Name")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
FirmwareComponentName,
[PropertyName("Firmware Version")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
FirmwareVersion,
[PropertyName("Firmware Version Format")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
FirmwareVersionFormat,
[PropertyName("Firmware ID")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
FirmwareId,
[PropertyName("Firmware ID Format")]
[PropertyDescription("Describes the format of the Firmware ID")]
[PropertyType(typeof(string))]
FirmwareIdFormat,
[PropertyName("Firmware Release Date")]
[PropertyDescription("String number of the firmware release date")]
[PropertyType(typeof(string))]
FirmwareReleaseDate,
[PropertyName("Firmware Manufacturer")]
[PropertyDescription("String number of the manufacturer or producer of this firmware")]
[PropertyType(typeof(string))]
FirmwareManufacturer,
[PropertyName("Lowest Supported Firmware Version")]
[PropertyDescription("String number of the manufacturer or producer of this firmware")]
[PropertyType(typeof(string))]
LowestSupportedFirmwareVersion,
[PropertyName("Firmware Image Size")]
[PropertyDescription("Size of the firmware image that is currently programmed in the device, in bytes")]
[PropertyType(typeof(ulong))]
FirmwareImageSize,
[PropertyName("Firmware Characteristics")]
[PropertyDescription("Firmware characteristics information")]
[PropertyType(typeof(ReadOnlyCollection<string>))]
FirmwareCharacteristics,
[PropertyName("Firmware State")]
[PropertyDescription("Firmware state information")]
[PropertyType(typeof(string))]
FirmwareState,
[PropertyName("Number Of Associated Components")]
[PropertyDescription("Defines how many Associated Component Handles are associated with this firmware")]
[PropertyType(typeof(byte))]
NumberOfAssociatedComponents,
[PropertyName("Associated Component Handles")]
[PropertyDescription("Lists the SMBIOS structure handles that are associated with this firmware")]
[PropertyType(typeof(ReadOnlyCollection<uint>))]
AssociatedComponentHandles
#endregion
}
#endregion
#region [internal] (emun) SmbiosType046Property: Defines the properties available for the structure type 044 [Processor Additional Information]
/// <summary>
/// Defines the properties available for the structure type 044 [Processor Additional Information].
/// </summary>
internal enum SmbiosType046Property
{
#region Version 3.5+
[PropertyName("String Property ID")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
PropertyId,
[PropertyName("String Property Value")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
PropertyValue,
[PropertyName("Parent Handle")]
[PropertyDescription("")]
[PropertyType(typeof(int))]
ParentHandle
#endregion
}
#endregion
#region [internal] (emun) SmbiosType126Property: Defines the properties available for the structure type 126 [Inactive]
/// <summary>
/// Defines the properties available for the structure type 126 [Inactive].
/// </summary>
internal enum SmbiosType126Property
{
[PropertyName("Description")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Description,
}
#endregion
#region [internal] (emun) SmbiosType127Property: Defines the properties available for the structure type 127 [End-of-Table]
/// <summary>
/// Defines the properties available for the structure type 127 [End-of-Table].
/// </summary>
internal enum SmbiosType127Property
{
[PropertyName("Status")]
[PropertyDescription("")]
[PropertyType(typeof(string))]
Status,
}
#endregion
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BaseBoard.md
# DmiProperty.BaseBoard class
Contains the key definitions available for a type 002 [BaseBoard (or Module) Information] structure.
```csharp
public static class BaseBoard
```
## Public Members
| name | description |
| --- | --- |
| static [AssetTag](DmiProperty.BaseBoard/AssetTag.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [BoardType](DmiProperty.BaseBoard/BoardType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ChassisHandle](DmiProperty.BaseBoard/ChassisHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ContainedElements](DmiProperty.BaseBoard/ContainedElements.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [LocationInChassis](DmiProperty.BaseBoard/LocationInChassis.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Manufacturer](DmiProperty.BaseBoard/Manufacturer.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [NumberOfContainedObjectHandles](DmiProperty.BaseBoard/NumberOfContainedObjectHandles.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Product](DmiProperty.BaseBoard/Product.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SerialNumber](DmiProperty.BaseBoard/SerialNumber.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Version](DmiProperty.BaseBoard/Version.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static class [Features](DmiProperty.BaseBoard.Features.md) | Contains the key definition for the Features section. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemEventLog/AccessMethodAddress.md
# DmiProperty.SystemEventLog.AccessMethodAddress property
Gets a value representing the key to retrieve the property value.
Access Method Address
Key Composition
* Structure: SystemEventLog
* Property: AccessMethodAddress
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey AccessMethodAddress { get; }
```
## See Also
* class [SystemEventLog](../DmiProperty.SystemEventLog.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PortableBattery/DesignVoltage.md
# DmiProperty.PortableBattery.DesignVoltage property
Gets a value representing the key to retrieve the property value.
Design voltage of the battery in mVolts.
Key Composition
* Structure: PortableBattery
* Property: DesignVoltage
* Unit: mV
Return Value
Type: UInt16
Remarks
2.1+
```csharp
public static IPropertyKey DesignVoltage { get; }
```
## See Also
* class [PortableBattery](../DmiProperty.PortableBattery.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemSlots/SlotPitch.md
# DmiProperty.SystemSlots.SlotPitch property
Gets a value representing the key to retrieve the property value.
Indicates the pitch of the slot in millimeters. The pitch is defined by each slot/card specification, but typically describes add-in card to add-in card pitch.
A value of 0 implies that the slot pitch is not given or is unknown.
Key Composition
* Structure: SystemSlots
* Property: SlotPitch
* Unit: mm
Return Value
Type: UInt16
Remarks
3.4
```csharp
public static IPropertyKey SlotPitch { get; }
```
## See Also
* class [SystemSlots](../DmiProperty.SystemSlots.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/ExtendedConfiguredMemorySpeed.md
# DmiProperty.MemoryDevice.ExtendedConfiguredMemorySpeed property
Gets a value representing the key to retrieve the property.
Extended configured memory speed of the memory device. Identifies the configured speed of the memory device, in megatransfers per second (MT/s).
Key Composition
* Structure: MemoryDevice
* Property: ExtendedConfiguredMemorySpeed
* Unit: MTs
Return Value
Type: UInt16
Remarks
3.3+
```csharp
public static IPropertyKey ExtendedConfiguredMemorySpeed { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification/DMI.md
# DMI class
The Desktop Management Interface (DMI) or the desktop management interface, standard framework for management and component tracking on a desktop, laptop or server.
```csharp
public sealed class DMI
```
## Public Members
| name | description |
| --- | --- |
| static [CreateInstance](DMI/CreateInstance.md)(…) | Gets an instance of this class for remote machine. If *options* is null (Nothing in Visual Basic) always returns an instance for this machine. |
| [SmbiosVersion](DMI/SmbiosVersion.md) { get; } | Gets the SMBIOS version. |
| [Structures](DMI/Structures.md) { get; } | Gets the collection of available structures. |
| override [ToString](DMI/ToString.md)() | Returns a String that represents this instance. |
| static [AccessType](DMI/AccessType.md) { get; } | Gets a String that represents the type of access. |
| static [Identificationmethod](DMI/Identificationmethod.md) { get; } | Gets a String that represents access mode. |
## See Also
* namespace [iTin.Hardware.Specification](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification/DMI/Structures.md
# DMI.Structures property
Gets the collection of available structures.
```csharp
public DmiStructureCollection Structures { get; }
```
## Property Value
Object [`DmiStructureCollection`](../../iTin.Hardware.Specification.Dmi/DmiStructureCollection.md) that contains the collection of available [`DmiStructure`](../../iTin.Hardware.Specification.Dmi/DmiStructure.md) objects. If there is no object [`DmiStructure`](../../iTin.Hardware.Specification.Dmi/DmiStructure.md), null is returned.
## See Also
* class [DmiStructureCollection](../../iTin.Hardware.Specification.Dmi/DmiStructureCollection.md)
* class [DMI](../DMI.md)
* namespace [iTin.Hardware.Specification](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor.Characteristics/HardwareThreadPerCore.md
# DmiProperty.Processor.Characteristics.HardwareThreadPerCore property
Gets a value representing the key to retrieve the property value.
Indicates that the processor supports multiple hardware threads per core. Does not indicate the state or number of threads.
Key Composition
* Structure: Processor
* Property: HardwareThreadPerCore
* Unit: None
Return Value
Type: Boolean
Remarks
2.5+
```csharp
public static IPropertyKey HardwareThreadPerCore { get; }
```
## See Also
* class [Characteristics](../DmiProperty.Processor.Characteristics.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.ManagementDeviceThresholdData.md
# DmiProperty.ManagementDeviceThresholdData class
Contains the key definitions available for a type 036 [ManagementDeviceThresholdData] structure.
```csharp
public static class ManagementDeviceThresholdData
```
## Public Members
| name | description |
| --- | --- |
| static [LowerCritical](DmiProperty.ManagementDeviceThresholdData/LowerCritical.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [LowerNonCritical](DmiProperty.ManagementDeviceThresholdData/LowerNonCritical.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [LowerNonRecoverable](DmiProperty.ManagementDeviceThresholdData/LowerNonRecoverable.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [UpperCritical](DmiProperty.ManagementDeviceThresholdData/UpperCritical.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [UpperNonCritical](DmiProperty.ManagementDeviceThresholdData/UpperNonCritical.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [UpperNonRecoverable](DmiProperty.ManagementDeviceThresholdData/UpperNonRecoverable.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType000 [BIOS Information].cs
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using iTin.Core;
using iTin.Core.Helpers.Enumerations;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 000: BIOS Information
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length Value Description |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.0+ Type BYTE 0 BIOS Information Indicator |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.0+ Length BYTE Varies 12h + number of BIOS Characteristics Extension |
// | Bytes. If no Extension Bytes are used the Length is |
// | 12h. For version 2.1 and 2.2 implementations, the |
// | length is 13h because one extension byte is defined. |
// | For version 2.3 and later implementations, the length |
// | is at least 14h because two extension bytes are |
// | defined. For version 2.4 and later implementations, |
// | the length is at least 18h because bytes 14-17h are |
// | For version 3.1 and later implementations, the length |
// | is at least 1Ah because bytes 14-19h are defined. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 2.0+ Handle WORD Varies |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 2.0+ Vendor BYTE STRING String number of the BIOS Vendor’s Name |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h 2.0+ BIOS Version BYTE STRING String number of the BIOS Version. This value is a |
// | free-form string that may contain Core and OEM version |
// | information. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h 2.0+ BIOS Starting WORD Varies Segment location of BIOS starting address (for |
// | Address Segment example, 0E800h). When not applicable, such as on |
// | UEFI-based systems, this value is set to 0000h. |
// | |
// | NOTE: The size of the runtime BIOS image can be |
// | computed by subtracting the Starting Address Segment |
// | from 10000h and multiplying the result by 16. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h 2.0+ BIOS Release BYTE STRING String number of the BIOS release date. The date |
// | Date string, if supplied, is in either mm/dd/yy or |
// | mm/dd/yyyy format. If the year portion of the string |
// | is two digits, the year is assumed to be 19yy. |
// | |
// | NOTE: The mm/dd/yyyy format is required for SMBIOS |
// | version 2.3 and later. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 09h 2.0+ BIOS ROM Size BYTE Varies(n) Size(n) where 64K * (n+1) is the size of the physical |
// | device containing the BIOS, in bytes |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ah 2.0+ BIOS QWORD Bit Field Defines which functions the BIOS supports: PCI, |
// | Characteristics PCMCIA, Flash, etc. (see 7.1.1). |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 12h 2.4+ BIOS Zero or Bit Field Optional space reserved for future supported |
// | Characteristics more BYTEs functions. The number of Extension Bytes that are |
// | Extension Bytes present is indicated by the Length in offset 1 minus |
// | 12h. See 7.1.2 for extensions defined for version 2.1 |
// | and later implementations. For version 2.4 and later |
// | implementations, two BIOS Characteristics |
// | Extension Bytes are defined (12-13h) and bytes 14- |
// | 17h are also defined. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 14h 2.4+ System BIOS BYTE Varies Identifies the major release of the System BIOS; for |
// | Major Release example, the deviceProperty is 0Ah for revision 10.22 |
// | and 02h for revision 2.1. |
// | This field and/or the System BIOS Minor Release |
// | field is updated each time a System BIOS update for |
// | a given system is released. |
// | If the system does not support the use of this field, |
// | the deviceProperty is 0FFh for both this field and |
// | the System BIOS Minor Release field. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 15h 2.4+ System BIOS BYTE Varies Identifies the minor release of the System BIOS; for |
// | Minor Release example, the deviceProperty is 16h for revision 10.22 |
// | and 01h for revision 2.1. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 16h 2.4+ Embedded BYTE Varies Identifies the major release of the embedded |
// | Controller controller firmware; for example, the deviceProperty |
// | Firmware Major would be 0Ah for revision 10.22 and 02h for revision |
// | Release 2.1. This field and/or the Embedded Controller |
// | Firmware Minor Release field is updated each time an |
// | embedded controller firmware update for a given |
// | system is released. |
// | |
// | If the system does not have field upgradeable embedded |
// | controller firmware, the device Property is 0FFh. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 17h 2.4+ Embedded BYTE Varies Identifies the minor release of the embedded |
// | Controller controller firmware; for example, the device Property |
// | Firmware Minor is 16h for revision 10.22 and 01h for revision 2.1. |
// | Release |
// | If the system does not have field upgradeable embedded |
// | controller firmware, the deviceProperty is 0FFh. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 18h 3.1+ Extended BIOS WORD Bit Field Extended size of the physical device(s) |
// | ROM Size containing the BIOS, rounded up if needed. |
// | |
// | Bits 15:14 Unit |
// | 00b - megabytes |
// | 01b - gigabytes |
// | 10b - reserved |
// | 11b - reserved |
// | |
// | Bits 13:0 Size |
// | |
// | Examples: a 16 MB device would be represented as |
// | 0010h. A 48 GB device set would be represented as |
// | 0100 0000 0011 0000b or 4030h. |
// •———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Bios Information (Type 0) structure.
/// </summary>
internal sealed class SmbiosType000 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType000"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType000(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private readonly properties
/// <summary>
/// Gets a value representing the <b>Characteristics</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ulong Characteristics => (ulong)Reader.GetQuadrupleWord(0x0a);
/// <summary>
/// Gets a value representing the <b>Extension byte 1</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ExtensionByte1 => Reader.GetByte(0x12);
/// <summary>
/// Gets a value representing the <b>Extension byte 2</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ExtensionByte2 => Reader.GetByte(0x13);
/// <summary>
/// Gets a value representing the <b>Firmware major release</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte FirmwareMajorRelease => Reader.GetByte(0x16);
/// <summary>
/// Gets a value representing the <b>Firmware minor release</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte FirmwareMinorRelease => Reader.GetByte(0x17);
/// <summary>
/// Gets a value representing the <b>Bios release date</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string BiosReleaseDate => GetString(0x08);
/// <summary>
/// Gets a value representing the <b>Rom size</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte RomSize => (byte)((Reader.GetByte(0x09) + 1) << 6);
/// <summary>
/// Gets a value representing the <b>Bios starting address segment</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string BiosStartSegment => $"{Reader.GetWord(0x06):X}";
/// <summary>
/// Gets a value representing the <b>System bios major release</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte SystemBiosMajorRelease => Reader.GetByte(0x14);
/// <summary>
/// Gets a value representing the <b>System bios minor release</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte SystemBiosMinorRelease => Reader.GetByte(0x15);
/// <summary>
/// Gets a value representing the <b>Vendor</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Vendor => GetString(0x04);
/// <summary>
/// Gets a value representing the <b>Bios version</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string BiosVersion => GetString(0x05);
/// <summary>
/// Gets a value representing the <b>Extended bios rom size raw info</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ExtendedBiosRomSizeRawInfo => (ushort)Reader.GetWord(0x18);
/// <summary>
/// Gets a value representing the <b>Extended bios rom size</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ExtendedBiosRomSize => (ushort)(ExtendedBiosRomSizeRawInfo & 0x3fff);
/// <summary>
/// Gets a value representing the <b>Extended bios rom size units</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private MemorySizeUnit ExtendedBiosRomSizeUnits
{
get
{
var value = (ushort)(ExtendedBiosRomSizeRawInfo & 0xc000);
var unit = (byte)(value.GetByte(Bytes.Byte03) >> 2);
return
unit >= 2
? MemorySizeUnit.Reserved
: (MemorySizeUnit)unit;
}
}
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
#region 2.0+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v20)
{
properties.Add(SmbiosProperty.Bios.Vendor, Vendor);
properties.Add(SmbiosProperty.Bios.BiosVersion, BiosVersion);
properties.Add(SmbiosProperty.Bios.BiosStartSegment, BiosStartSegment);
properties.Add(SmbiosProperty.Bios.BiosReleaseDate, BiosReleaseDate);
properties.Add(SmbiosProperty.Bios.BiosRomSize, RomSize);
properties.Add(SmbiosProperty.Bios.Characteristics, GetCharacteristics(Characteristics));
}
#endregion
#region 2.4+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v24)
{
properties.Add(SmbiosProperty.Bios.CharacteristicsExtensionByte1, GetExtensionByte1(ExtensionByte1));
properties.Add(SmbiosProperty.Bios.CharacteristicsExtensionByte2, GetExtensionByte2(ExtensionByte2));
properties.Add(SmbiosProperty.Bios.SystemBiosMajorRelease, SystemBiosMajorRelease);
properties.Add(SmbiosProperty.Bios.SystemBiosMinorRelease, SystemBiosMinorRelease);
properties.Add(SmbiosProperty.Bios.FirmwareMajorRelease, FirmwareMajorRelease);
properties.Add(SmbiosProperty.Bios.FirmwareMinorRelease, FirmwareMinorRelease);
}
#endregion
#region 3.1+
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v31)
{
properties.Add(SmbiosProperty.Bios.ExtendedBiosRomSize, ExtendedBiosRomSize);
properties.Add(SmbiosProperty.Bios.BiosRomSizeUnit, ExtendedBiosRomSizeUnits);
}
#endregion
}
#endregion
#region BIOS Specification 3.5.0 (15/09/2021)
/// <summary>
/// Define which functions supports the BIOS: PCI, PCMCIA, Flash, etc.
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// A read-only collection containing the characteristics.
/// </returns>
private static ReadOnlyCollection<string> GetCharacteristics(ulong code)
{
string[] deviceProperty =
{
"BIOS characteristics not supported", // 3
"ISA is supported",
"MCA is supported",
"EISA is supported",
"PCI is supported",
"PC Card (PCMCIA) is supported",
"PNP is supported",
"APM is supported",
"BIOS is upgradeable",
"BIOS shadowing is allowed",
"VLB is supported",
"ESCD support is available",
"Boot from CD is supported",
"Selectable boot is supported",
"BIOS ROM is socketed",
"Boot from PC Card (PCMCIA) is supported",
"EDD is supported",
"Japanese floppy for NEC 9800 1.2 MB is supported (int 13h)",
"Japanese floppy for Toshiba 1.2 MB is supported (int 13h)",
"5.25\"/360 kB floppy services are supported (int 13h)",
"5.25\"/1.2 MB floppy services are supported (int 13h)",
"3.5\"/720 kB floppy services are supported (int 13h)",
"3.5\"/2.88 MB floppy services are supported (int 13h)",
"Print screen service is supported (int 5h)",
"8042 keyboard services are supported (int 9h)",
"Serial services are supported (int 14h)",
"Printer services are supported (int 17h)",
"CGA/mono video services are supported (int 10h)",
"NEC PC-98" // 31
};
var items = new List<string>();
if ((code & (1 << 3)) == 1 << 3)
{
items.Add(deviceProperty[0]);
}
for (var i = 4; i <= 31; i++)
{
if ((code & (ulong) (1 << i)) == (ulong) (1 << i))
{
items.Add(deviceProperty[i - 3]);
}
}
return items.AsReadOnly();
}
/// <summary>
/// space reserved for future BIOS functions (byte 01).
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// A read-only collection containing the future BIOS functions (byte 01)
/// </returns>
private static ReadOnlyCollection<string> GetExtensionByte1(byte code)
{
string[] deviceProperty =
{
"ACPI is supported",
"USB legacy is supported",
"AGP is supported",
"I2O boot is supported",
"LS-120 boot is supported",
"ATAPI Zip drive boot is supported",
"IEEE 1394 boot is supported",
"Smart battery is supported"
};
var items = new List<string>();
for (byte i = 0; i <= 7; i++)
{
var addItem = code.CheckBit(i);
if (addItem)
{
items.Add(deviceProperty[i]);
}
}
return items.AsReadOnly();
}
/// <summary>
/// space reserved for future BIOS functions (byte 01).
/// </summary>
/// <param name="code">Value to analyze</param>
/// <returns>
/// A read-only collection containing the future BIOS functions (byte 02)
/// </returns>
private static ReadOnlyCollection<string> GetExtensionByte2(byte code)
{
string[] deviceProperty =
{
"BIOS boot specification is supported",
"Function key-initiated network boot is supported",
"Targeted content distribution is supported",
"UEFI Specification is supported",
"Virtual machine",
"Manufacturing mode is supported",
"Manufacturing mode is enabled",
"Reserved"
};
var items = new List<string>();
for (byte i = 0; i <= 7; i++)
{
var addItem = code.CheckBit(i);
if (addItem)
{
items.Add(deviceProperty[i]);
}
}
return items.AsReadOnly();
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/DeviceSet.md
# DmiProperty.MemoryDevice.DeviceSet property
Gets a value representing the key to retrieve the property.
Identifies when the Memory Device is one of a set of Memory Devices that must be populated with all devices of the same type and size, and the set to which this device belongs.
Key Composition
* Structure: MemoryDevice
* Property: DeviceSet
* Unit: None
Return Value
Type: Byte
Remarks
2.1+
```csharp
public static IPropertyKey DeviceSet { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.CoolingDevice/Description.md
# DmiProperty.CoolingDevice.Description property
Gets a value representing the key to retrieve the property value.
Contains additional descriptive information about the cooling device or its location.
Key Composition
* Structure: CoolingDevice
* Property: Description
* Unit: None
Return Value
Type: String
Remarks
2.7+
```csharp
public static IPropertyKey Description { get; }
```
## See Also
* class [CoolingDevice](../DmiProperty.CoolingDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemPowerControls/Second.md
# DmiProperty.SystemPowerControls.Second property
Gets a value representing the key to retrieve the property value.
BCD value of the second on which the next scheduled power-on is to occur, in the range 00h to 59h.
Key Composition
* Structure: SystemPowerControls
* Property: Second
* Unit: None
Return Value
Type: Byte
```csharp
public static IPropertyKey Second { get; }
```
## See Also
* class [SystemPowerControls](../DmiProperty.SystemPowerControls.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.FirmwareInventoryInformation/NumberOfAssociatedComponents.md
# DmiProperty.FirmwareInventoryInformation.NumberOfAssociatedComponents property
Gets a value representing the key to retrieve the property value.
Defines how many Associated Component Handles are associated with this firmware.
Key Composition
* Structure: FirmwareInventoryInformation
* Property: NumberOfAssociatedComponents
* Unit: None
Return Value
Type: Byte
Remarks
3.5
```csharp
public static IPropertyKey NumberOfAssociatedComponents { get; }
```
## See Also
* class [FirmwareInventoryInformation](../DmiProperty.FirmwareInventoryInformation.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BitMemoryError32/VendorSyndrome.md
# DmiProperty.BitMemoryError32.VendorSyndrome property
Gets a value representing the key to retrieve the property value.
Vendor-specific ECC syndrome or CRC data associated with the erroneous access.
Key Composition
* Structure: BitMemoryError32
* Property: VendorSyndrome
* Unit: None
Return Value
Type: UInt32
Remarks
2.1+
```csharp
public static IPropertyKey VendorSyndrome { get; }
```
## See Also
* class [BitMemoryError32](../DmiProperty.BitMemoryError32.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.OnBoardDevicesExtended.md
# DmiProperty.OnBoardDevicesExtended class
Contains the key definitions available for a type 041 [OnBoardDevicesExtended Information] structure.
```csharp
public static class OnBoardDevicesExtended
```
## Public Members
| name | description |
| --- | --- |
| static [ReferenceDesignation](DmiProperty.OnBoardDevicesExtended/ReferenceDesignation.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static class [Element](DmiProperty.OnBoardDevicesExtended.Element.md) | Contains the key definition for the Element section. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/DmiStructureVersion.cs
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Defines known implemented version of a <b>DMI</b> structure.
/// </summary>
public enum DmiStructureVersion
{
/// <summary>
/// Version valid without specifying its version number.
/// </summary>
Latest = -1,
/// <summary>
/// Unknown version
/// </summary>
Unknown = 0,
/// <summary>
/// Version 2.0
/// </summary>
v20,
/// <summary>
/// Version 2.1
/// </summary>
v21,
/// <summary>
/// Version 2.2
/// </summary>
v22,
/// <summary>
/// Version 2.3
/// </summary>
v23,
/// <summary>
/// Version 2.4
/// </summary>
v24,
/// <summary>
/// Version 2.5
/// </summary>
v25,
/// <summary>
/// Version 2.6
/// </summary>
v26,
/// <summary>
/// Version 2.7
/// </summary>
v27,
/// <summary>
/// Version 2.8
/// </summary>
v28,
/// <summary>
/// Version 3.0
/// </summary>
v30,
/// <summary>
/// Version 3.1
/// </summary>
v31,
/// <summary>
/// Version 3.2
/// </summary>
v32,
/// <summary>
/// Version 3.3
/// </summary>
v33,
/// <summary>
/// Version 3.4
/// </summary>
v34,
/// <summary>
/// Version 3.5
/// </summary>
v35,
/// <summary>
/// Version 3.6
/// </summary>
v36,
/// <summary>
/// Version 3.7
/// </summary>
v37
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType027 [Cooling Device].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 027: Cooling Device.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.2+ Type BYTE 27 Cooling Device indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.2+ Length BYTE Varies Length of the structure, at least 0Ch |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 2.2+ Handle WORD Varies The handle, or instance number, associated|
// | with the structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 2.2+ Temperature WORD Varies The handle, or instance number, of the |
// | Probe Handle temperature probe monitoring this cooling |
// | device. |
// | A value of 0xFFFF indicates that no probe |
// | is provided. |
// | Note: See ProbeHandle |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h 2.2+ Device Type BYTE Bit Field Identifies the cooling device type and |
// | and Status the status of this cooling device. |
// | Note: ver GetDeviceType(byte) |
// | Note: See GetStatus(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h 2.2+ Cooling Unit BYTE Varies Identifies the cooling unit group to which|
// | Group this cooling device is associated. |
// | Having multiple cooling devices in the |
// | same cooling unit implies a redundant |
// | configuration. |
// | The value is 00h if the cooling device is |
// | not a member of a redundant cooling unit. |
// | Non-zero values imply redundancy and that |
// | at least one other cooling device will be |
// | enumerated with the same value. |
// | Note: See UnitGroup |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h 2.2+ OEM-defined DWORD Varies Contains OEM- or BIOS vendor-specific |
// | information. |
// | Note: See OemDefined |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ch 2.2+ Nominal WORD Varies The nominal value for the cooling device’s|
// | Speed rotational speed, in revolutions-per- |
// | minute (rpm). |
// | partition. |
// | If the value is unknown or the cooling |
// | device is nonrotating, the field is set |
// | to 0x8000. |
// | 1 or 2. |
// | This field is present in the structure |
// | only if the structure’s Length is larger |
// | than 0Ch. |
// | Note: See NominalSpeed |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Eh 2.7+ Description BYTE STRING The number of the string that contains |
// | additional descriptive information about |
// | the cooling device or its location. |
// | |
// | This field is present in the structure |
// | only if the structure’s Length is 0Fh or |
// | larger. |
// | Note: See Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Cooling Device (Type 27) structure.
/// </summary>
internal sealed class SmbiosType027 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType027"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType027(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
#region Version 2.2+ fields
/// <summary>
/// Gets a value representing the <b>Temperature Probe Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort TemperatureProbeHandle => (ushort)Reader.GetWord(0x04);
/// <summary>
/// Gets a value representing the <b>Device Type And Status</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte DeviceTypeAndStatus => Reader.GetByte(0x06);
/// <summary>
/// Gets a value representing the <b>Device Type</b> feature of the <b>Device Type And Status</b> field
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte DeviceType => (byte) (DeviceTypeAndStatus & 0x1f);
/// <summary>
/// Gets a value representing the <b>Status</b> feature of the <b>Device Type And Status</b> field
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Status => (byte) ((DeviceTypeAndStatus >> 5) & 0x07);
/// <summary>
/// Gets a value representing the <b>Cooling Unit Group</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte CoolingUnitGroup => Reader.GetByte(0x07);
/// <summary>
/// Gets a value representing the <b>Oem Defined</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint OemDefined => (uint)Reader.GetDoubleWord(0x08);
/// <summary>
/// Gets a value representing the <b>Nominal Speed</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort NominalSpeed => (ushort)Reader.GetWord(0x0c);
#endregion
#region Version 2.7+ fields
/// <summary>
/// Gets a value representing the <b>Description</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Description => GetString(0x0e);
#endregion
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v22)
{
properties.Add(SmbiosProperty.CoolingDevice.TemperatureProbeHandle, TemperatureProbeHandle);
properties.Add(SmbiosProperty.CoolingDevice.DeviceTypeAndStatus.Status, GetStatus(Status));
properties.Add(SmbiosProperty.CoolingDevice.DeviceTypeAndStatus.DeviceType, GetDeviceType(DeviceType));
properties.Add(SmbiosProperty.CoolingDevice.CoolingUnitGroup, CoolingUnitGroup);
properties.Add(SmbiosProperty.CoolingDevice.OemDefined, OemDefined);
if (StructureInfo.Length >= 0x0d)
{
properties.Add(SmbiosProperty.CoolingDevice.NominalSpeed, NominalSpeed);
}
}
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v27)
{
properties.Add(SmbiosProperty.CoolingDevice.Description, Description);
}
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets a string representing the device type.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The device type.
/// </returns>
private static string GetDeviceType(byte code)
{
var value = new[]
{
"Other", // 0x01
"Unknown",
"Fan",
"Centrifugal Blower",
"Chip Fan",
"Cabinet Fan",
"Power Supply Fan",
"Heat Pipe",
"Integrated Refrigeration",
"Active Cooling",
"Passive Cooling" // 0x0b
};
if (code >= 0x01 && code <= 0x0b)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string representing the state of the test.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The state of the test.
/// </returns>
private static string GetStatus(byte code)
{
var value = new[]
{
"Other", // 0x01
"Unknown",
"Ok",
"Non-critical",
"Critical",
"Non-recoverable" // 0x06
};
if (code >= 0x01 && code <= 0x06)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Cache/SupportedSramTypes.md
# DmiProperty.Cache.SupportedSramTypes property
Gets a value representing the key to retrieve the property value.
String collection with supported SRAM types.
Key Composition
* Structure: Cache
* Property: SupportedSramTypes
* Unit: None
Return Value
Type: ReadOnlyCollection where T is String
Remarks
2.0+
```csharp
public static IPropertyKey SupportedSramTypes { get; }
```
## See Also
* class [Cache](../DmiProperty.Cache.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemPowerSupply/Manufacturer.md
# DmiProperty.SystemPowerSupply.Manufacturer property
Gets a value representing the key to retrieve the property value.
Names the company that manufactured the supply.
Key Composition
* Structure: SystemPowerSupply
* Property: Manufacturer
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey Manufacturer { get; }
```
## See Also
* class [SystemPowerSupply](../DmiProperty.SystemPowerSupply.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiMemoryChannelElementCollection.md
# DmiMemoryChannelElementCollection class
Represents a collection of objects MemoryChannelElement.
```csharp
public sealed class DmiMemoryChannelElementCollection : ReadOnlyCollection<DmiMemoryChannelElement>
```
## Public Members
| name | description |
| --- | --- |
| override [ToString](DmiMemoryChannelElementCollection/ToString.md)() | Returns a class String that represents the current object. |
## See Also
* class [DmiMemoryChannelElement](./DmiMemoryChannelElement.md)
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemPowerSupply/InputCurrentProbeHandle.md
# DmiProperty.SystemPowerSupply.InputCurrentProbeHandle property
Gets a value representing the key to retrieve the property value.
Handle, or instance number, of the electrical current probe monitoring this power supply’s input current.
Key Composition
* Structure: SystemPowerSupply
* Property: InputCurrentProbeHandle
* Unit: None
Return Value
Type: UInt16
```csharp
public static IPropertyKey InputCurrentProbeHandle { get; }
```
## See Also
* class [SystemPowerSupply](../DmiProperty.SystemPowerSupply.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType003 [System Enclosure or Chassis].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the System Enclosure or Chassis (Type 3) structure.<br/>
/// For more information, please see <see cref="SmbiosType003"/>.
/// </summary>
internal sealed class DmiType003 : DmiBaseType<SmbiosType003>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType003"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType003(SmbiosType003 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
#region 2.0+
if (ImplementedVersion >= DmiStructureVersion.v20)
{
object manufacturer = SmbiosStructure.GetPropertyValue(SmbiosProperty.Chassis.Manufacturer);
if (manufacturer != null)
{
properties.Add(DmiProperty.Chassis.Manufacturer, manufacturer);
}
object chassisType = SmbiosStructure.GetPropertyValue(SmbiosProperty.Chassis.ChassisType);
if (chassisType != null)
{
properties.Add(DmiProperty.Chassis.ChassisType, chassisType);
}
object locked = SmbiosStructure.GetPropertyValue(SmbiosProperty.Chassis.Locked);
if (locked != null)
{
properties.Add(DmiProperty.Chassis.Locked, locked);
}
object version = SmbiosStructure.GetPropertyValue(SmbiosProperty.Chassis.Version);
if (version != null)
{
properties.Add(DmiProperty.Chassis.Version, version);
}
object serialNumber = SmbiosStructure.GetPropertyValue(SmbiosProperty.Chassis.SerialNumber);
if (serialNumber != null)
{
properties.Add(DmiProperty.Chassis.SerialNumber, serialNumber);
}
object assetTagNumber = SmbiosStructure.GetPropertyValue(SmbiosProperty.Chassis.AssetTagNumber);
if (assetTagNumber != null)
{
properties.Add(DmiProperty.Chassis.AssetTagNumber, assetTagNumber);
}
}
#endregion
#region 2.1+
if (ImplementedVersion >= DmiStructureVersion.v21)
{
object bootUpState = SmbiosStructure.GetPropertyValue(SmbiosProperty.Chassis.BootUpState);
if (bootUpState != null)
{
properties.Add(DmiProperty.Chassis.BootUpState, bootUpState);
}
object powerSupplyState = SmbiosStructure.GetPropertyValue(SmbiosProperty.Chassis.PowerSupplyState);
if (powerSupplyState != null)
{
properties.Add(DmiProperty.Chassis.PowerSupplyState, powerSupplyState);
}
object thermalState = SmbiosStructure.GetPropertyValue(SmbiosProperty.Chassis.ThermalState);
if (thermalState != null)
{
properties.Add(DmiProperty.Chassis.ThermalState, thermalState);
}
object securityStatus = SmbiosStructure.GetPropertyValue(SmbiosProperty.Chassis.SecurityStatus);
if (securityStatus != null)
{
properties.Add(DmiProperty.Chassis.SecurityStatus, securityStatus);
}
}
#endregion
#region 2.3+
if (ImplementedVersion >= DmiStructureVersion.v23)
{
object oemDefined = SmbiosStructure.GetPropertyValue(SmbiosProperty.Chassis.OemDefined);
if ((uint) oemDefined != 0)
{
properties.Add(DmiProperty.Chassis.OemDefined, oemDefined);
}
object height = SmbiosStructure.GetPropertyValue(SmbiosProperty.Chassis.Height);
if ((byte) height != 0)
{
properties.Add(DmiProperty.Chassis.Height, height);
}
object numberOfPowerCords = SmbiosStructure.GetPropertyValue(SmbiosProperty.Chassis.NumberOfPowerCords);
if ((byte) numberOfPowerCords != 0)
{
properties.Add(DmiProperty.Chassis.NumberOfPowerCords, numberOfPowerCords);
}
object containedElements = SmbiosStructure.GetPropertyValue(SmbiosProperty.Chassis.ContainedElements);
if (containedElements == null)
{
return;
}
properties.Add(DmiProperty.Chassis.ContainedElements, new DmiChassisContainedElementCollection((ChassisContainedElementCollection)containedElements));
}
#endregion
#region 2.7+
if (ImplementedVersion >= DmiStructureVersion.v27)
{
object skuNumber = SmbiosStructure.GetPropertyValue(SmbiosProperty.Chassis.SkuNumber);
properties.Add(DmiProperty.Chassis.SkuNumber, skuNumber);
}
#endregion
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemReset.Capabilities.md
# DmiProperty.SystemReset.Capabilities class
Contains the key definition for the Capabilities section.
```csharp
public static class Capabilities
```
## Public Members
| name | description |
| --- | --- |
| static [BootOption](DmiProperty.SystemReset.Capabilities/BootOption.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [BootOptionOnLimit](DmiProperty.SystemReset.Capabilities/BootOptionOnLimit.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Status](DmiProperty.SystemReset.Capabilities/Status.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [WatchdogTimer](DmiProperty.SystemReset.Capabilities/WatchdogTimer.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [SystemReset](./DmiProperty.SystemReset.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/Speed.md
# DmiProperty.MemoryDevice.Speed property
Gets a value representing the key to retrieve the property.
Identifies the maximum capable speed of the device, in megatransfers per second(MT/s). 0000h = the speed is unknown. FFFFh = the speed is 65,535 MT/s or greater, and the actual speed is stored in the [`ExtendedSpeed`](./ExtendedSpeed.md) property.
Key Composition
* Structure: MemoryDevice
* Property: Speed
* Unit: MTs
Return Value
Type: UInt16
Remarks
2.3+
```csharp
public static IPropertyKey Speed { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Chassis.md
# DmiProperty.Chassis class
Contains the key definitions available for a type 003 [SystemEnclosure Information] structure.
```csharp
public static class Chassis
```
## Public Members
| name | description |
| --- | --- |
| static [AssetTagNumber](DmiProperty.Chassis/AssetTagNumber.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [BootUpState](DmiProperty.Chassis/BootUpState.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ChassisType](DmiProperty.Chassis/ChassisType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ContainedElements](DmiProperty.Chassis/ContainedElements.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Height](DmiProperty.Chassis/Height.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Locked](DmiProperty.Chassis/Locked.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Manufacturer](DmiProperty.Chassis/Manufacturer.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [NumberOfPowerCords](DmiProperty.Chassis/NumberOfPowerCords.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [OemDefined](DmiProperty.Chassis/OemDefined.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [PowerSupplyState](DmiProperty.Chassis/PowerSupplyState.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SecurityStatus](DmiProperty.Chassis/SecurityStatus.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SerialNumber](DmiProperty.Chassis/SerialNumber.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SkuNumber](DmiProperty.Chassis/SkuNumber.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ThermalState](DmiProperty.Chassis/ThermalState.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Version](DmiProperty.Chassis/Version.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static class [Elements](DmiProperty.Chassis.Elements.md) | Contains the key definition for the Elements section. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType007 [Cache Information].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Cache Information (Type 7) structure.<br/>
/// For more information, please see <see cref="SmbiosType007"/>.
/// </summary>
internal sealed class DmiType007 : DmiBaseType<SmbiosType007>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType007"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType007(SmbiosType007 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
#region 2.0+
if (ImplementedVersion >= DmiStructureVersion.v20)
{
properties.Add(DmiProperty.Cache.SocketDesignation, SmbiosStructure.GetPropertyValue(SmbiosProperty.Cache.SocketDesignation));
properties.Add(DmiProperty.Cache.CacheConfiguration.OperationalMode, SmbiosStructure.GetPropertyValue(SmbiosProperty.Cache.CacheConfiguration.OperationalMode));
properties.Add(DmiProperty.Cache.CacheConfiguration.CacheEnabled, SmbiosStructure.GetPropertyValue(SmbiosProperty.Cache.CacheConfiguration.CacheEnabled));
properties.Add(DmiProperty.Cache.CacheConfiguration.Location, SmbiosStructure.GetPropertyValue(SmbiosProperty.Cache.CacheConfiguration.Location));
properties.Add(DmiProperty.Cache.CacheConfiguration.CacheSocketed, SmbiosStructure.GetPropertyValue(SmbiosProperty.Cache.CacheConfiguration.CacheSocketed));
properties.Add(DmiProperty.Cache.CacheConfiguration.Level, SmbiosStructure.GetPropertyValue(SmbiosProperty.Cache.CacheConfiguration.Level));
properties.Add(DmiProperty.Cache.MaximumCacheSize, SmbiosStructure.GetPropertyValue(SmbiosProperty.Cache.MaximumCacheSize));
int installedCacheSize = SmbiosStructure.GetPropertyValue<int>(SmbiosProperty.Cache.InstalledCacheSize);
if (installedCacheSize != 0x0000)
{
properties.Add(DmiProperty.Cache.InstalledCacheSize, installedCacheSize);
}
properties.Add(DmiProperty.Cache.SupportedSramTypes, SmbiosStructure.GetPropertyValue(SmbiosProperty.Cache.SupportedSramTypes));
properties.Add(DmiProperty.Cache.CurrentSramType, SmbiosStructure.GetPropertyValue(SmbiosProperty.Cache.CurrentSramType));
}
#endregion
#region 2.1+
if (ImplementedVersion >= DmiStructureVersion.v21)
{
byte cacheSpeed = SmbiosStructure.GetPropertyValue<byte>(SmbiosProperty.Cache.CacheSpeed);
if (cacheSpeed != 0x00)
{
properties.Add(DmiProperty.Cache.CacheSpeed, cacheSpeed);
}
properties.Add(DmiProperty.Cache.ErrorCorrectionType, SmbiosStructure.GetPropertyValue(SmbiosProperty.Cache.ErrorCorrectionType));
properties.Add(DmiProperty.Cache.SystemCacheType, SmbiosStructure.GetPropertyValue(SmbiosProperty.Cache.SystemCacheType));
properties.Add(DmiProperty.Cache.Associativity, SmbiosStructure.GetPropertyValue(SmbiosProperty.Cache.Associativity));
}
#endregion
#region 3.1+
if (ImplementedVersion >= DmiStructureVersion.v31)
{
properties.Add(DmiProperty.Cache.MaximumCacheSize2, SmbiosStructure.GetPropertyValue(SmbiosProperty.Cache.MaximumCacheSize2));
uint installedCacheSize2 = SmbiosStructure.GetPropertyValue<uint>(SmbiosProperty.Cache.InstalledCacheSize2);
if (installedCacheSize2 != 0x00)
{
properties.Add(DmiProperty.Cache.InstalledCacheSize2, installedCacheSize2);
}
}
#endregion
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.AdditionalInformation.Entry/StringValue.md
# DmiProperty.AdditionalInformation.Entry.StringValue property
Gets a value representing the key to retrieve the property value.
Optional string to be associated with the field referenced by the referenced offset.
Key Composition
* Structure: AdditionalInformation
* Property: StringValue
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey StringValue { get; }
```
## See Also
* class [Entry](../DmiProperty.AdditionalInformation.Entry.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiBaseType-1/DmiBaseType.md
# DmiBaseType<TSmbios> constructor
Initializes a new instance of the class SmbiosBaseType by specifying the Header of the structure and current
```csharp
protected DmiBaseType(TSmbios smbiosStructure, int smbiosVersion)
```
| parameter | description |
| --- | --- |
| smbiosStructure | Header of the current structure. |
| smbiosVersion | Current SMBIOS version. |
## See Also
* class [DmiBaseType<TSmbios>](../DmiBaseType-1.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification/DMI/Identificationmethod.md
# DMI.Identificationmethod property
Gets a String that represents access mode.
```csharp
public static string Identificationmethod { get; }
```
## Property Value
A String that represents the mode of access.
## Remarks
This method always returns the <DMI> string.
## See Also
* class [DMI](../DMI.md)
* namespace [iTin.Hardware.Specification](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/ExtendedSpeed.md
# DmiProperty.MemoryDevice.ExtendedSpeed property
Gets a value representing the key to retrieve the property.
Extended speed of the memory device. Identifies the maximum capable speed of the device, in megatransfers per second (MT/s).
Key Composition
* Structure: MemoryDevice
* Property: ExtendedSpeed
* Unit: MTs
Return Value
Type: UInt16
Remarks
3.3+
```csharp
public static IPropertyKey ExtendedSpeed { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor/L2CacheHandle.md
# DmiProperty.Processor.L2CacheHandle property
Gets a value representing the key to retrieve the property value.
Handle of a cache information structure that defines the attributes of the secondary (Level 2) cache for this processor.
* For version 2.1 and version 2.2 implementations, the value is 0FFFFh if the processor has no L2 cache.
* For version 2.3 and later implementations, the value is 0FFFFh if the Cache Information structure is not provided.
Key Composition
* Structure: Processor
* Property: L2CacheHandle
* Unit: None
Return Value
Type: UInt16
Remarks
2.1+
```csharp
public static IPropertyKey L2CacheHandle { get; }
```
## See Also
* class [Processor](../DmiProperty.Processor.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/tools/Readme.txt
Build Documentation
===================
Uses XmlDocMarkdown tool.
https://ejball.com/XmlDocMarkdown/
Install
-------
Nuget: https://www.nuget.org/packages/xmldocmd
Dotnet: dotnet tool install xmldocmd -g
How to use
----------
C:\> xmldocmd MyLibrary.dll documentation
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryChannel.MemoryDevices/Handle.md
# DmiProperty.MemoryChannel.MemoryDevices.Handle property
Gets a value representing the key to retrieve the property value.
Structure handle that identifies the memory device associated with this channel.
Key Composition
* Structure: MemoryChannel
* Property: Handle
* Unit: None
Return Value
Type: UInt16
```csharp
public static IPropertyKey Handle { get; }
```
## See Also
* class [MemoryDevices](../DmiProperty.MemoryChannel.MemoryDevices.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Cache.CacheConfiguration/Location.md
# DmiProperty.Cache.CacheConfiguration.Location property
Gets a value representing the key to retrieve the property value.
Location, relative to the CPU module.
Key Composition
* Structure: Cache
* Property: CacheLocation
* Unit: None
Return Value
Type: String
Remarks
2.0+
```csharp
public static IPropertyKey Location { get; }
```
## See Also
* class [CacheConfiguration](../DmiProperty.Cache.CacheConfiguration.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/Specific/Enums/MemoryDeviceMappedAddressInterleavedPosition.cs
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Defines the type of interpolation of a device.
/// </summary>
public enum MemoryDeviceMappedAddressInterleavedPosition
{
/// <summary>
/// Not interpolated
/// </summary>
NonInterleaved = 0x00,
/// <summary>
/// First interpolated position
/// </summary>
FirstInterleavePosition = 0x01,
/// <summary>
/// Second interpolated position.
/// </summary>
SecondInterleavePosition = 0x02,
/// <summary>
/// Unknown
/// </summary>
Unknown = 0xff,
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.CoolingDevice.DeviceTypeAndStatus.md
# DmiProperty.CoolingDevice.DeviceTypeAndStatus class
Contains the key definition for the Device Type And Status section.
```csharp
public static class DeviceTypeAndStatus
```
## Public Members
| name | description |
| --- | --- |
| static [DeviceType](DmiProperty.CoolingDevice.DeviceTypeAndStatus/DeviceType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Status](DmiProperty.CoolingDevice.DeviceTypeAndStatus/Status.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [CoolingDevice](./DmiProperty.CoolingDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiStructure/ToString.md
# DmiStructure.ToString method
Returns a String that represents this instance.
```csharp
public override string ToString()
```
## Return Value
A String that represents this instance.
## Remarks
This method returns a string that represents this instance.
## See Also
* class [DmiStructure](../DmiStructure.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/references/README.txt
External references for this library
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PhysicalMemoryArray/MemoryErrorCorrection.md
# DmiProperty.PhysicalMemoryArray.MemoryErrorCorrection property
Gets a value representing the key to retrieve the property value.
Primary hardware error correction or detection method supported by this memory array.
Key Composition
* Structure: PhysicalMemoryArray
* Property: MemoryErrorCorrection
* Unit: None
Return Value
Type: String
Remarks
2.1+
```csharp
public static IPropertyKey MemoryErrorCorrection { get; }
```
## See Also
* class [PhysicalMemoryArray](../DmiProperty.PhysicalMemoryArray.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BitMemoryError64/VendorSyndrome.md
# DmiProperty.BitMemoryError64.VendorSyndrome property
Gets a value representing the key to retrieve the property value.
Vendor-specific ECC syndrome or CRC data associated with the erroneous access.
Key Composition
* Structure: BitMemoryError64
* Property: VendorSyndrome
* Unit: None
Return Value
Type: UInt32
```csharp
public static IPropertyKey VendorSyndrome { get; }
```
## See Also
* class [BitMemoryError64](../DmiProperty.BitMemoryError64.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.GroupAssociations.Items/Structure.md
# DmiProperty.GroupAssociations.Items.Structure property
Gets a value representing the key to retrieve the property value.
Item (Structure) Type of this member.
Key Composition
* Structure: GroupAssociations
* Property: Structure
* Unit: None
Return Value
Type: SmbiosStructure
```csharp
public static IPropertyKey Structure { get; }
```
## See Also
* class [Items](../DmiProperty.GroupAssociations.Items.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemSlots.Peers.md
# DmiProperty.SystemSlots.Peers class
Contains the key definition for the Peers section.
```csharp
public static class Peers
```
## Public Members
| name | description |
| --- | --- |
| static [BusDeviceFunction](DmiProperty.SystemSlots.Peers/BusDeviceFunction.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [DataBusWidth](DmiProperty.SystemSlots.Peers/DataBusWidth.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SegmentGroupNumber](DmiProperty.SystemSlots.Peers/SegmentGroupNumber.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [SystemSlots](./DmiProperty.SystemSlots.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BaseBoard.Features/IsReplaceable.md
# DmiProperty.BaseBoard.Features.IsReplaceable property
Gets a value representing the key to retrieve the property value.
Indicates if mainboard is replaceable.
Key Composition
* Structure: BaseBoard
* Property: IsReplaceable
* Unit: None
Return Value
Type: Boolean
```csharp
public static IPropertyKey IsReplaceable { get; }
```
## See Also
* class [Features](../DmiProperty.BaseBoard.Features.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PhysicalMemoryArray/MaximumCapacity.md
# DmiProperty.PhysicalMemoryArray.MaximumCapacity property
Gets a value representing the key to retrieve the property value.
Maximum memory capacity, in kilobytes, for this array.
Key Composition
* Structure: PhysicalMemoryArray
* Property: MaximumCapacity
* Unit: KB
Return Value
Type: UInt64
Remarks
2.1+, 2.7+
```csharp
public static IPropertyKey MaximumCapacity { get; }
```
## See Also
* class [PhysicalMemoryArray](../DmiProperty.PhysicalMemoryArray.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiClass/ImplementedProperties.md
# DmiClass.ImplementedProperties property
Returns a list of implemented properties for this structure
```csharp
public IEnumerable<IPropertyKey> ImplementedProperties { get; }
```
## Return Value
A list of implemented properties for this structure.
## See Also
* class [DmiClass](../DmiClass.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiSupportedEventLogTypeDescriptorElement/DescriptorType.md
# DmiSupportedEventLogTypeDescriptorElement.DescriptorType property
Gets a value that represents the Descriptor Type.
```csharp
public string DescriptorType { get; }
```
## Property Value
Descriptor Type.
## See Also
* class [DmiSupportedEventLogTypeDescriptorElement](../DmiSupportedEventLogTypeDescriptorElement.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PortConnector.md
# DmiProperty.PortConnector class
Contains the key definitions available for a type 008 [PortConnector Information] structure.
```csharp
public static class PortConnector
```
## Public Members
| name | description |
| --- | --- |
| static [ExternalConnectorType](DmiProperty.PortConnector/ExternalConnectorType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ExternalReferenceDesignator](DmiProperty.PortConnector/ExternalReferenceDesignator.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [InternalConnectorType](DmiProperty.PortConnector/InternalConnectorType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [InternalReferenceDesignator](DmiProperty.PortConnector/InternalReferenceDesignator.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [PortType](DmiProperty.PortConnector/PortType.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.TemperatureProbe.md
# DmiProperty.TemperatureProbe class
Contains the key definitions available for a type 028 [TemperatureProbe] structure.
```csharp
public static class TemperatureProbe
```
## Public Members
| name | description |
| --- | --- |
| static [Accuracy](DmiProperty.TemperatureProbe/Accuracy.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Description](DmiProperty.TemperatureProbe/Description.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MaximumValue](DmiProperty.TemperatureProbe/MaximumValue.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MinimumValue](DmiProperty.TemperatureProbe/MinimumValue.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [NominalValue](DmiProperty.TemperatureProbe/NominalValue.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [OemDefined](DmiProperty.TemperatureProbe/OemDefined.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Resolution](DmiProperty.TemperatureProbe/Resolution.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Tolerance](DmiProperty.TemperatureProbe/Tolerance.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static class [LocationAndStatus](DmiProperty.TemperatureProbe.LocationAndStatus.md) | Contains the key definition for the Location And Status section. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType126 [Inactive].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Inactive (Type 126) structure.<br/>
/// For more information, please see <see cref="SmbiosType126"/>.
/// </summary>
internal sealed class DmiType126 : DmiBaseType<SmbiosType126>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType126"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType126(SmbiosType126 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
properties.Add(DmiProperty.Inactive.Description, SmbiosStructure.GetPropertyValue(SmbiosProperty.Inactive.Description));
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.OnBoardDevices/Description.md
# DmiProperty.OnBoardDevices.Description property
Gets a value representing the key to retrieve the property value.
String number of device description.
Key Composition
* Structure: OnBoardDevices
* Property: Description
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey Description { get; }
```
## See Also
* class [OnBoardDevices](../DmiProperty.OnBoardDevices.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiClassPropertiesTable/DmiClassPropertiesTable.md
# DmiClassPropertiesTable constructor
The default constructor.
```csharp
public DmiClassPropertiesTable()
```
## See Also
* class [DmiClassPropertiesTable](../DmiClassPropertiesTable.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Specific/IProcessorSpecificData.cs
namespace iTin.Hardware.Specification.Smbios;
/// <summary>
/// </summary>
public interface IProcessorSpecificData
{
/// <summary>
/// Gets a value that represents the '<b>Major Revision</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
byte? MajorRevision { get; }
/// <summary>
/// Gets a value that represents the '<b>Minor Revision</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
byte? MinorRevision { get; }
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Cache.CacheConfiguration/OperationalMode.md
# DmiProperty.Cache.CacheConfiguration.OperationalMode property
Gets a value representing the key to retrieve the property value.
Cache operational mode (Write Through, Write Back, ...).
Key Composition
* Structure: Cache
* Property: OperationalMode
* Unit: None
Return Value
Type: String
Remarks
2.0+
```csharp
public static IPropertyKey OperationalMode { get; }
```
## See Also
* class [CacheConfiguration](../DmiProperty.Cache.CacheConfiguration.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType010 [On Board Devices].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the On Board Devices (Type 10, Obsolete) structure.<br/>
/// For more information, please see <see cref="SmbiosType010"/>.
/// </summary>
internal sealed class DmiType010 : DmiBaseType<SmbiosType010>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType010"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType010(SmbiosType010 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
properties.Add(DmiProperty.OnBoardDevices.Enabled, SmbiosStructure.GetPropertyValue(SmbiosProperty.OnBoardDevices.Enabled));
properties.Add(DmiProperty.OnBoardDevices.DeviceType, SmbiosStructure.GetPropertyValue(SmbiosProperty.OnBoardDevices.DeviceType));
properties.Add(DmiProperty.OnBoardDevices.Description, SmbiosStructure.GetPropertyValue(SmbiosProperty.OnBoardDevices.Description));
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType044 [Processor Additional Information].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Processor Additional Information (Type 44) structure.<br/>
/// For more information, please see <see cref="SmbiosType044"/>.
/// </summary>
internal sealed class DmiType044: DmiBaseType<SmbiosType044>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType044"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType044(SmbiosType044 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
object referenceHandle = SmbiosStructure.GetPropertyValue(SmbiosProperty.ProcessorAdditionalInformation.ReferencedHandle);
if (referenceHandle != null)
{
properties.Add(DmiProperty.ProcessorAdditionalInformation.ReferencedHandle, referenceHandle);
}
properties.Add(DmiProperty.ProcessorAdditionalInformation.ProcessorSpecificBlock, SmbiosStructure.GetPropertyValue(SmbiosProperty.ProcessorAdditionalInformation.ProcessorSpecificBlock));
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BitMemoryError64/ErrorOperation.md
# DmiProperty.BitMemoryError64.ErrorOperation property
Gets a value representing the key to retrieve the property value.
Memory access operation that caused the error.
Key Composition
* Structure: BitMemoryError64
* Property: ErrorOperation
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey ErrorOperation { get; }
```
## See Also
* class [BitMemoryError64](../DmiProperty.BitMemoryError64.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor.Voltage/SupportedVoltages.md
# DmiProperty.Processor.Voltage.SupportedVoltages property
Gets a value representing the key to retrieve the property value.
Represent the specific voltages that the processor socket can accept.
Key Composition
* Structure: Processor
* Property: VoltageCapability
* Unit: V
Return Value
Type: ReadOnlyCollection where T is String
Remarks
2.0+
```csharp
public static IPropertyKey SupportedVoltages { get; }
```
## See Also
* class [Voltage](../DmiProperty.Processor.Voltage.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/SpecificDmiBaseType/SpecificDmiBaseType.md
# SpecificDmiBaseType constructor (1 of 2)
Initializes a new instance of the class [`SpecificDmiBaseType`](../SpecificDmiBaseType.md).
```csharp
protected SpecificDmiBaseType()
```
## See Also
* class [SpecificDmiBaseType](../SpecificDmiBaseType.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
---
# SpecificDmiBaseType constructor (2 of 2)
Initializes a new instance of the class [`SpecificDmiBaseType`](../SpecificDmiBaseType.md) by specifying the raw data of a specific SMBIOS structure
```csharp
protected SpecificDmiBaseType(byte[] data)
```
| parameter | description |
| --- | --- |
| data | Raw data. |
## See Also
* class [SpecificDmiBaseType](../SpecificDmiBaseType.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.CoolingDevice/CoolingUnitGroup.md
# DmiProperty.CoolingDevice.CoolingUnitGroup property
Gets a value representing the key to retrieve the property value.
Cooling unit group to which this cooling device is associated. Having multiple cooling devices in the same cooling unit implies a redundant configuration.
Key Composition
* Structure: CoolingDevice
* Property: CoolingUnitGroup
* Unit: None
Return Value
Type: Byte
Remarks
2.2+
```csharp
public static IPropertyKey CoolingUnitGroup { get; }
```
## See Also
* class [CoolingDevice](../DmiProperty.CoolingDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PortableBattery/DesignCapacityMultiplier.md
# DmiProperty.PortableBattery.DesignCapacityMultiplier property
Gets a value representing the key to retrieve the property value.
Multiplication factor of the Design Capacity value, which assures that the mWatt hours value does not overflow for SBDS implementations. The multiplier default is 1.
Key Composition
l
* Structure: PortableBattery
* Property: DesignCapacityMultiplier
* Unit: None
Return Value
Type: Byte
Remarks
2.2+
```csharp
public static IPropertyKey DesignCapacityMultiplier { get; }
```
## See Also
* class [PortableBattery](../DmiProperty.PortableBattery.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BiosLanguage/Current.md
# DmiProperty.BiosLanguage.Current property
Gets a value representing the key to retrieve the property value.
Currently installed language.
Key Composition
* Structure: BiosLanguage
* Property: Current
* Unit: None
Return Value
Type: String
Remarks
2.0+
```csharp
public static IPropertyKey Current { get; }
```
## See Also
* class [BiosLanguage](../DmiProperty.BiosLanguage.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor.Characteristics/PowerPerformanceControlSupport.md
# DmiProperty.Processor.Characteristics.PowerPerformanceControlSupport property
Gets a value representing the key to retrieve the property value.
Indicates that the processor is capable of load-based power savings. Does not indicate the present state of this feature.
Key Composition
* Structure: Processor
* Property: PowerPerformanceControlSupport
* Unit: None
Return Value
Type: Boolean
Remarks
2.5+
```csharp
public static IPropertyKey PowerPerformanceControlSupport { get; }
```
## See Also
* class [Characteristics](../DmiProperty.Processor.Characteristics.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.IpmiDevice.BaseAdressModifier/LsBit.md
# DmiProperty.IpmiDevice.BaseAdressModifier.LsBit property
Gets a value representing the key to retrieve the property value.
LS-bit for addresses.
Key Composition
* Structure: IpmiDevice
* Property: LsBit
* Unit: None
Return Value
Type: Byte
```csharp
public static IPropertyKey LsBit { get; }
```
## See Also
* class [BaseAdressModifier](../DmiProperty.IpmiDevice.BaseAdressModifier.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiConnectOptions/DmiConnectOptions.md
# DmiConnectOptions constructor
The default constructor.
```csharp
public DmiConnectOptions()
```
## See Also
* class [DmiConnectOptions](../DmiConnectOptions.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/QueryPropertyCollectionResultExtensions/AsDictionaryResult.md
# QueryPropertyCollectionResultExtensions.AsDictionaryResult method
Converts a QueryPropertyCollectionResult instance into a new QueryPropertyDictionaryResult instance.
```csharp
public static QueryPropertyDictionaryResult AsDictionaryResult(
this QueryPropertyCollectionResult result)
```
| parameter | description |
| --- | --- |
| result | Property collection to convert. |
## Return Value
A new QueryPropertyDictionaryResult instance from QueryPropertyCollectionResult.
## See Also
* class [QueryPropertyCollectionResultExtensions](../QueryPropertyCollectionResultExtensions.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Core/iTin.Core.Hardware/iTin.Core.Hardware.Windows.Specification.Smbios/SmbiosOperations.cs
using System;
using System.Linq;
using System.Management;
using iTin.Core.Hardware.Abstractions.Specification.Smbios;
namespace iTin.Core.Hardware.Windows.Specification.Smbios;
/// <summary>
/// Specialization of the <see cref="ISmbiosOperations"/> interface that contains the <b>SMBIOS</b> operations for <b>Windows</b> system.
/// </summary>
public class SmbiosOperations : ISmbiosOperations
{
/// <summary>
/// Gets a value containing the raw <b>SMBIOS</b> data.
/// </summary>
/// <param name="options">Connection options for remote use</param>
/// <returns>
/// The raw <b>SMBIOS</b> data.
/// </returns>
public byte[] GetSmbiosDataArray(ISmbiosConnectOptions options = null)
{
ManagementScope scope;
if (options != null)
{
var connectionOptions = new ConnectionOptions
{
Username = options.UserName,
Authentication = AuthenticationLevel.Packet,
Impersonation = ImpersonationLevel.Impersonate,
SecurePassword = options.Password.ToSecureString()
};
scope = new ManagementScope($"\\\\{options.MachineNameOrIpAddress}\\root\\cimv2", connectionOptions);
try
{
scope.Connect();
}
catch
{
return Array.Empty<byte>();
}
}
else
{
string[] tableNames = Firmware.EnumerateTables(FirmwareProvider.RSMB);
if (tableNames.Any())
{
return Firmware.GetTable(FirmwareProvider.RSMB, tableNames[0]);
}
scope = new ManagementScope("root\\WMI");
}
var result = Array.Empty<byte>();
var query = new ObjectQuery("SELECT * FROM MSSmBios_RawSMBiosTables");
using (var wmi = new ManagementObjectSearcher(scope, query))
{
foreach (var mos in wmi.Get())
{
var queryObj = (ManagementObject)mos;
result = (byte[])queryObj["SMBiosData"];
}
}
return result;
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType029 [Electrical Current Probe].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 029: Electrical Current Probe.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 29 Electrical Current Probe indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE Varies Length of the structure, at least 14h |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies The handle, or instance number, associated with the |
// | structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Description BYTE STRING The number of the string that contains additional |
// | descriptive information about the probe or its |
// | location. |
// | Note: See Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Location and BYTE Bit Field Defines the probe’s physical location and status of |
// | Status the current monitored by this temperature probe. |
// | Note: See GetLocation(byte) |
// | Note: See GetStatus(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h Maximum Value WORD Varies The maximum current readable by this probe, in |
// | milliamps. |
// | If the value is unknown, the field is set to 0x8000. |
// | Note: See MaximumValue |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h Minimum Value WORD Varies The Minimum current readable by this probe, in |
// | milliamps. |
// | If the value is unknown, the field is set to 0x8000. |
// | Note: See MinimumValue |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ah Resolution WORD Varies The resolution for the probe’s reading, in tenths of |
// | milliamps. |
// | If the value is unknown, the field is set to 0x8000. |
// | Note: See Resolution |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ch Tolerance WORD Varies The tolerance for reading from this probe, in +/- |
// | milliamps. |
// | If the value is unknown, the field is set to 0x8000. |
// | Note: See Tolerance |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Eh Accuracy WORD Varies The accuracy for reading from this probe, in +/- |
// | 1/100th of a percent. |
// | If the value is unknown, the field is set to 0x8000. |
// | Note: See Accuracy |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 10h OEM-defined DWORD Varies Contains OEM- or BIOS vendor-specific information. |
// | Note: See OemDefined |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 14h Nominal Value WORD Varies The nominal value for the probe’s reading in |
// | milliamps. |
// | If the value is unknown, the field is set to 0x8000. |
// | This field is present in the structure only if the |
// | structure’s Length is larger than 14h. |
// | Note: See NominalValue |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Electrical Current Probe (Type 29) structure.
/// </summary>
internal sealed class SmbiosType029 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType029"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType029(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Description</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Description => GetString(0x04);
/// <summary>
/// Gets a value representing the <b>Location And Status</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte LocationAndStatus => Reader.GetByte(0x05);
/// <summary>
/// Gets a value representing the <b>Location</b> feature of the <b>Location And Status</b> field
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Location => (byte)(LocationAndStatus & 0x1f);
/// <summary>
/// Gets a value representing the <b>Status</b> feature of the <b>Location And Status</b> field
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Status => (byte)((LocationAndStatus >> 5) & 0x07);
/// <summary>
/// Gets a value representing the <b>Maximun Value</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort MaximunValue => (ushort)Reader.GetWord(0x06);
/// <summary>
/// Gets a value representing the <b>Minimun Value</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort MinimunValue => (ushort)Reader.GetWord(0x08);
/// <summary>
/// Gets a value representing the <b>Resolution</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort Resolution => (ushort)Reader.GetWord(0x0a);
/// <summary>
/// Gets a value representing the <b>Tolerance</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort Tolerance => (ushort)Reader.GetWord(0x0c);
/// <summary>
/// Gets a value representing the <b>Accuracy</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort Accuracy => (ushort)Reader.GetWord(0x0e);
/// <summary>
/// Gets a value representing the <b>Oem Defined</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint OemDefined => (uint)Reader.GetDoubleWord(0x10);
/// <summary>
/// Gets a value representing the <b>Nominal Value</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort NominalValue => (ushort)Reader.GetWord(0x14);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.Latest)
{
properties.Add(SmbiosProperty.ElectricalCurrentProbe.Description, Description);
properties.Add(SmbiosProperty.ElectricalCurrentProbe.LocationAndStatus.Status, GetStatus(Status));
properties.Add(SmbiosProperty.ElectricalCurrentProbe.LocationAndStatus.Location, GetLocation(Location));
properties.Add(SmbiosProperty.ElectricalCurrentProbe.MaximumValue, MaximunValue);
properties.Add(SmbiosProperty.ElectricalCurrentProbe.MinimumValue, MinimunValue);
properties.Add(SmbiosProperty.ElectricalCurrentProbe.Resolution, Resolution);
properties.Add(SmbiosProperty.ElectricalCurrentProbe.Tolerance, Tolerance);
properties.Add(SmbiosProperty.ElectricalCurrentProbe.Accuracy, Accuracy);
properties.Add(SmbiosProperty.ElectricalCurrentProbe.OemDefined, OemDefined);
}
if (StructureInfo.Length >= 0x15)
{
properties.Add(SmbiosProperty.ElectricalCurrentProbe.NominalValue, NominalValue);
}
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets a string representing the location.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The location.
/// </returns>
private static string GetLocation(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"Proccessor",
"Disk",
"Peripheral Bay",
"System Management Module",
"Motherboard",
"Memory Module",
"Processor Module",
"Power Unit",
"Add-in Card",
"Front Panel Board",
"Back Panel Board",
"Power System Board",
"Drive Back Plane" // 0x0f
};
if (code >= 0x01 && code <= 0x0f)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string representing the state of the test.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The state of the test.
/// </returns>
private static string GetStatus(byte code)
{
var value = new[]
{
"Other", // 0x01
"Unknown",
"Ok",
"Non-critical",
"Critical",
"Non-recoverable" // 0x06
};
if (code >= 0x01 && code <= 0x06)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BuiltInPointingDevice/Interface.md
# DmiProperty.BuiltInPointingDevice.Interface property
Gets a value representing the key to retrieve the property value.
Interface type for the pointing device.
Key Composition
* Structure: BuiltInPointingDevice
* Property: Interface
* Unit: None
Return Value
Type: String
Remarks
2.1+
```csharp
public static IPropertyKey Interface { get; }
```
## See Also
* class [BuiltInPointingDevice](../DmiProperty.BuiltInPointingDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/Specific/DmiPeerDevice.cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// This class represents an element of the structure <see cref="DmiType009"/>.
/// </summary>
public class DmiPeerDevice
{
#region private members
private readonly SmbiosPropertiesTable _reference;
#endregion
#region constructor/s
/// <summary>
/// Initialize a new instance of the class <see cref="DmiPeerDevice"/>.
/// </summary>
/// <param name="reference"><b>SMBIOS</b> properties.</param>
internal DmiPeerDevice(SmbiosPropertiesTable reference)
{
_reference = reference;
}
#endregion
#region public properties
/// <summary>
/// Gets the properties available for this structure.
/// </summary>
/// <value>
/// Availables properties.
/// </value>
public DmiClassPropertiesTable Properties =>
new()
{
{DmiProperty.SystemSlots.Peers.DataBusWidth, _reference[SmbiosProperty.SystemSlots.Peers.DataBusWidth]},
{DmiProperty.SystemSlots.Peers.BusDeviceFunction, _reference[SmbiosProperty.SystemSlots.Peers.BusDeviceFunction]},
{DmiProperty.SystemSlots.Peers.SegmentGroupNumber, _reference[SmbiosProperty.SystemSlots.Peers.SegmentGroupNumber]}
};
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Abstractions.Specification.Smbios/ComponentModel/SmbiosConnectOptions.cs
using iTin.Core.Hardware.Abstractions.Specification.Smbios;
namespace iTin.Hardware.Abstractions.Specification.Smbios.ComponentModel;
/// <summary>
/// Defines remote user parameters
/// </summary>
public class SmbiosConnectOptions : ISmbiosConnectOptions
{
/// <summary>
///
/// </summary>
/// <value>
/// </value>
public string MachineNameOrIpAddress { get; set; }
/// <summary>
///
/// </summary>
/// <value>
/// </value>
public string UserName { get; set; }
/// <summary>
///
/// </summary>
/// <value>
/// </value>
public string Password { get; set; }
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemEventLog.md
# DmiProperty.SystemEventLog class
Contains the key definitions available for a type 015 [SystemEventLog] structure.
```csharp
public static class SystemEventLog
```
## Public Members
| name | description |
| --- | --- |
| static [AccessMethod](DmiProperty.SystemEventLog/AccessMethod.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [AccessMethodAddress](DmiProperty.SystemEventLog/AccessMethodAddress.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [DataStartOffset](DmiProperty.SystemEventLog/DataStartOffset.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ListSupportedEventLogTypeDescriptors](DmiProperty.SystemEventLog/ListSupportedEventLogTypeDescriptors.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [LogAreaLength](DmiProperty.SystemEventLog/LogAreaLength.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [LogChangeToken](DmiProperty.SystemEventLog/LogChangeToken.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [LogHeaderFormat](DmiProperty.SystemEventLog/LogHeaderFormat.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [LogHeaderStartOffset](DmiProperty.SystemEventLog/LogHeaderStartOffset.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [LogStatus](DmiProperty.SystemEventLog/LogStatus.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SupportedLogTypeDescriptors](DmiProperty.SystemEventLog/SupportedLogTypeDescriptors.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.AdditionalInformation.Entry.md
# DmiProperty.AdditionalInformation.Entry class
Contains the key definition for the Entry section.
```csharp
public static class Entry
```
## Public Members
| name | description |
| --- | --- |
| static [EntryLength](DmiProperty.AdditionalInformation.Entry/EntryLength.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ReferencedHandle](DmiProperty.AdditionalInformation.Entry/ReferencedHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ReferencedOffset](DmiProperty.AdditionalInformation.Entry/ReferencedOffset.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [StringValue](DmiProperty.AdditionalInformation.Entry/StringValue.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Value](DmiProperty.AdditionalInformation.Entry/Value.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [AdditionalInformation](./DmiProperty.AdditionalInformation.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Inactive/Description.md
# DmiProperty.Inactive.Description property
Gets a value representing the key to retrieve the property value.
Indicates end of structures. Always returns the 'Inactive' string.
Key Composition
* Structure: Inactive
* Property: Description
* Unit: None
Return Value
Type: String
Remarks
Any version
```csharp
public static IPropertyKey Description { get; }
```
## See Also
* class [Inactive](../DmiProperty.Inactive.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.FirmwareInventoryInformation/FirmwareIdFormat.md
# DmiProperty.FirmwareInventoryInformation.FirmwareIdFormat property
Gets a value representing the key to retrieve the property value.
Describes the format of the Firmware ID.
Key Composition
* Structure: FirmwareInventoryInformation
* Property: FirmwareIdFormat
* Unit: None
Return Value
Type: String
Remarks
3.5
```csharp
public static IPropertyKey FirmwareIdFormat { get; }
```
## See Also
* class [FirmwareInventoryInformation](../DmiProperty.FirmwareInventoryInformation.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Bios.md
# DmiProperty.Bios class
Contains the key definitions available for a type 000 [Bios Information] structure.
```csharp
public static class Bios
```
## Public Members
| name | description |
| --- | --- |
| static [BiosReleaseDate](DmiProperty.Bios/BiosReleaseDate.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [BiosRomSize](DmiProperty.Bios/BiosRomSize.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [BiosRomSizeUnit](DmiProperty.Bios/BiosRomSizeUnit.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [BiosStartSegment](DmiProperty.Bios/BiosStartSegment.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [BiosVersion](DmiProperty.Bios/BiosVersion.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Characteristics](DmiProperty.Bios/Characteristics.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [CharacteristicsExtensionByte1](DmiProperty.Bios/CharacteristicsExtensionByte1.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [CharacteristicsExtensionByte2](DmiProperty.Bios/CharacteristicsExtensionByte2.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [FirmwareMajorRelease](DmiProperty.Bios/FirmwareMajorRelease.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [FirmwareMinorRelease](DmiProperty.Bios/FirmwareMinorRelease.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SystemBiosMajorRelease](DmiProperty.Bios/SystemBiosMajorRelease.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SystemBiosMinorRelease](DmiProperty.Bios/SystemBiosMinorRelease.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Vendor](DmiProperty.Bios/Vendor.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.FirmwareInventoryInformation/FirmwareId.md
# DmiProperty.FirmwareInventoryInformation.FirmwareId property
Gets a value representing the key to retrieve the property value.
String number of the Firmware ID of this firmware. The format of this value is defined by the Firmware ID Format.
Key Composition
* Structure: FirmwareInventoryInformation
* Property: FirmwareId
* Unit: None
Return Value
Type: String
Remarks
3.5
```csharp
public static IPropertyKey FirmwareId { get; }
```
## See Also
* class [FirmwareInventoryInformation](../DmiProperty.FirmwareInventoryInformation.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/BaseBoardContainedElementCollection.md
# BaseBoardContainedElementCollection class
Represents a collection of objects SmbiosStructure available on a motherboard.
```csharp
public sealed class BaseBoardContainedElementCollection : ReadOnlyCollection<SmbiosStructure>
```
## Public Members
| name | description |
| --- | --- |
| override [ToString](BaseBoardContainedElementCollection/ToString.md)() | Returns a class String that represents the current object. |
## See Also
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/DmiClassCollection.cs
using System.Collections.Generic;
using System.Collections.ObjectModel;
using iTin.Hardware.Specification.Smbios;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Representa una colección de objetos <see cref="DmiClass"/>.
/// </summary>
public sealed class DmiClassCollection : ReadOnlyCollection<DmiClass>
{
/// <summary>
/// Initialize a new instance of the <see cref = "DmiClassCollection"/> class.
/// </summary>
/// <param name="parent">Estructura.</param>
internal DmiClassCollection(DmiStructure parent) : base(new List<DmiClass>())
{
var structures = parent.Context.Get((SmbiosStructure)(int)parent.Class);
foreach (var structure in structures)
{
Items.Add(new DmiClass(DmiStructureFactory.Create(structure, parent.Context.Version)));
}
}
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType000 [BIOS Information].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Bios Information (Type 0) structure.<br/>
/// For more information, please see <see cref="SmbiosType000"/>.
/// </summary>
internal sealed class DmiType000 : DmiBaseType<SmbiosType000>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType000"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType000(SmbiosType000 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
#region 2.0+
if (ImplementedVersion >= DmiStructureVersion.v20)
{
object vendor = SmbiosStructure.GetPropertyValue(SmbiosProperty.Bios.Vendor);
if (vendor != null)
{
properties.Add(DmiProperty.Bios.Vendor, vendor);
}
object biosVersion = SmbiosStructure.GetPropertyValue(SmbiosProperty.Bios.BiosVersion);
if (biosVersion != null)
{
properties.Add(DmiProperty.Bios.BiosVersion, biosVersion);
}
object biosStartSegment = SmbiosStructure.GetPropertyValue(SmbiosProperty.Bios.BiosStartSegment);
if (biosStartSegment != null)
{
properties.Add(DmiProperty.Bios.BiosStartSegment, biosStartSegment);
}
object biosReleaseDate = SmbiosStructure.GetPropertyValue(SmbiosProperty.Bios.BiosReleaseDate);
if (biosReleaseDate != null)
{
properties.Add(DmiProperty.Bios.BiosReleaseDate, biosReleaseDate);
}
object characteristics = SmbiosStructure.GetPropertyValue(SmbiosProperty.Bios.Characteristics);
if (characteristics != null)
{
properties.Add(DmiProperty.Bios.Characteristics, characteristics);
}
}
#endregion
#region 2.4+
if (ImplementedVersion >= DmiStructureVersion.v24)
{
object characteristicsExtensionByte1 = SmbiosStructure.GetPropertyValue(SmbiosProperty.Bios.CharacteristicsExtensionByte1);
if (characteristicsExtensionByte1 != null)
{
properties.Add(DmiProperty.Bios.CharacteristicsExtensionByte1, characteristicsExtensionByte1);
}
object characteristicsExtensionByte2 = SmbiosStructure.GetPropertyValue(SmbiosProperty.Bios.CharacteristicsExtensionByte2);
if (characteristicsExtensionByte2 != null)
{
properties.Add(DmiProperty.Bios.CharacteristicsExtensionByte2, characteristicsExtensionByte2);
}
object systemBiosMajorRelease = SmbiosStructure.GetPropertyValue(SmbiosProperty.Bios.SystemBiosMajorRelease);
if (systemBiosMajorRelease != null)
{
properties.Add(DmiProperty.Bios.SystemBiosMajorRelease, systemBiosMajorRelease);
}
object systemBiosMinorRelease = SmbiosStructure.GetPropertyValue(SmbiosProperty.Bios.SystemBiosMinorRelease);
if (systemBiosMinorRelease != null)
{
properties.Add(DmiProperty.Bios.SystemBiosMinorRelease, systemBiosMinorRelease);
}
object firmwareMajorRelease = SmbiosStructure.GetPropertyValue(SmbiosProperty.Bios.FirmwareMajorRelease);
if (firmwareMajorRelease != null)
{
properties.Add(DmiProperty.Bios.FirmwareMajorRelease, firmwareMajorRelease);
}
object firmwareMinorRelease = SmbiosStructure.GetPropertyValue(SmbiosProperty.Bios.FirmwareMinorRelease);
if (firmwareMinorRelease != null)
{
properties.Add(DmiProperty.Bios.FirmwareMinorRelease, firmwareMinorRelease);
}
}
#endregion
#region 3.1+
if (ImplementedVersion >= DmiStructureVersion.v31)
{
object romSizeProperty = SmbiosStructure.GetPropertyValue(SmbiosProperty.Bios.BiosRomSize);
if (romSizeProperty != null)
{
byte romSize = (byte) romSizeProperty;
if (romSize != 0xff)
{
object extendedBiosRomSize = SmbiosStructure.GetPropertyValue(SmbiosProperty.Bios.ExtendedBiosRomSize);
if (extendedBiosRomSize != null)
{
properties.Add(DmiProperty.Bios.BiosRomSize, extendedBiosRomSize);
}
object biosRomSizeUnit = SmbiosStructure.GetPropertyValue(SmbiosProperty.Bios.BiosRomSizeUnit);
if (biosRomSizeUnit != null)
{
properties.Add(DmiProperty.Bios.BiosRomSizeUnit, biosRomSizeUnit);
}
}
else
{
properties.Add(DmiProperty.Bios.BiosRomSize, (uint)romSize);
properties.Add(DmiProperty.Bios.BiosRomSizeUnit, MemorySizeUnit.KB);
}
}
}
#endregion
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiSupportedEventLogTypeDescriptorElement/ToString.md
# DmiSupportedEventLogTypeDescriptorElement.ToString method
Returns a class String that represents the current instance.
```csharp
public override string ToString()
```
## Return Value
Object String that represents the current AdditionalInformationEntry class.
## See Also
* class [DmiSupportedEventLogTypeDescriptorElement](../DmiSupportedEventLogTypeDescriptorElement.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.HardwareSecurity.HardwareSecuritySettings.md
# DmiProperty.HardwareSecurity.HardwareSecuritySettings class
Contains the key definition for the HardwareSecuritySettings section.
```csharp
public static class HardwareSecuritySettings
```
## Public Members
| name | description |
| --- | --- |
| static [AdministratorPasswordStatus](DmiProperty.HardwareSecurity.HardwareSecuritySettings/AdministratorPasswordStatus.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [FrontPanelResetStatus](DmiProperty.HardwareSecurity.HardwareSecuritySettings/FrontPanelResetStatus.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [KeyboardPasswordStatus](DmiProperty.HardwareSecurity.HardwareSecuritySettings/KeyboardPasswordStatus.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [PowerOnPasswordStatus](DmiProperty.HardwareSecurity.HardwareSecuritySettings/PowerOnPasswordStatus.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [HardwareSecurity](./DmiProperty.HardwareSecurity.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.BaseBoard.Features/IsHostingBoard.md
# DmiProperty.BaseBoard.Features.IsHostingBoard property
Gets a value representing the key to retrieve the property value.
Indicates if is hosting board.
Key Composition
* Structure: BaseBoard
* Property: IsHostingBoard
* Unit: None
Return Value
Type: Boolean
```csharp
public static IPropertyKey IsHostingBoard { get; }
```
## See Also
* class [Features](../DmiProperty.BaseBoard.Features.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.FirmwareInventoryInformation/LowestSupportedFirmwareVersion.md
# DmiProperty.FirmwareInventoryInformation.LowestSupportedFirmwareVersion property
Gets a value representing the key to retrieve the property value.
String number of the lowest version to which this firmware can be rolled back to. The format of this value is defined by the Version Format.
Key Composition
* Structure: FirmwareInventoryInformation
* Property: LowestSupportedFirmwareVersion
* Unit: None
Return Value
Type: String
Remarks
3.5
```csharp
public static IPropertyKey LowestSupportedFirmwareVersion { get; }
```
## See Also
* class [FirmwareInventoryInformation](../DmiProperty.FirmwareInventoryInformation.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType024 [Hardware Security].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 024: Hardware Security.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 24 Hardware Security indicator |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE 05h Length of the structure. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies The handle, or instance number, associated with the |
// | structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Hardware BYTE Bit Field Identifies the password and reset status for the |
// | Security system: |
// | Settings |
// | Bits 07:06 - Power-on Password Status value: |
// | 00b - Disabled |
// | 01b - Enabled |
// | 10b - Not Implemented |
// | 11b - Unknown |
// | |
// | Bits 05:04 - Keyboard Password Status value: |
// | 00b - Disabled |
// | 01b - Enabled |
// | 10b - Not Implemented |
// | 11b - Unknown |
// | |
// | Bits 03:02 - Administrator Password Status value: |
// | 00b - Disabled |
// | 01b - Enabled |
// | 10b - Not Implemented |
// | 11b - Unknown |
// | |
// | Bits 01:00 - Front Panel Reset Status value: |
// | 00b - Disabled |
// | 01b - Enabled |
// | 10b - Not Implemented |
// | 11b - Unknown |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Hardware Security (Type 24) structure.
/// </summary>
internal sealed class SmbiosType024 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType024"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType024(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Hardware Security Setting</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte HardwareSecuritySettings => Reader.GetByte(0x04);
/// <summary>
/// Gets a value representing the <b>Front Panel ResetS Status</b> hardware setting of the <b>Hardware Security Setting</b> field
/// </summary>
/// <value>
/// Hardware setting value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte FrontPanelResetStatus => (byte) (HardwareSecuritySettings & 0x03);
/// <summary>
/// Gets a value representing the <b>Administrator Password Status</b> hardware setting of the <b>Hardware Security Setting</b> field
/// </summary>
/// <value>
/// Hardware setting value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte AdministratorPasswordStatus => (byte) ((HardwareSecuritySettings >> 2) & 0x03);
/// <summary>
/// Gets a value representing the <b>Keyboard Password Status</b> hardware setting of the <b>Hardware Security Setting</b> field
/// </summary>
/// <value>
/// Hardware setting value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte KeyboardPasswordStatus => (byte) ((HardwareSecuritySettings >> 4) & 0x03);
/// <summary>
/// Gets a value representing the <b>Power-On Password Status</b> hardware setting of the <b>Hardware Security Setting</b> field
/// </summary>
/// <value>
/// Hardware setting value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte PowerOnPasswordStatus => (byte) ((HardwareSecuritySettings >> 6) & 0x03);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.Latest)
{
return;
}
properties.Add(SmbiosProperty.HardwareSecurity.HardwareSecuritySettings.FrontPanelResetStatus, GetSettings(FrontPanelResetStatus));
properties.Add(SmbiosProperty.HardwareSecurity.HardwareSecuritySettings.AdministratorPasswordStatus, GetSettings(AdministratorPasswordStatus));
properties.Add(SmbiosProperty.HardwareSecurity.HardwareSecuritySettings.KeyboardPasswordStatus, GetSettings(KeyboardPasswordStatus));
properties.Add(SmbiosProperty.HardwareSecurity.HardwareSecuritySettings.PowerOnPasswordStatus, GetSettings(PowerOnPasswordStatus));
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets a string representing the set configuration.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The set configuration.
/// </returns>
private static string GetSettings(byte code)
{
string[] value =
{
"Disabled", // 0x00
"Enabled",
"Not Implemented",
"Unknown" // 0x03
};
return value[code];
}
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Specific/Base/SpecificSmbiosBaseType.cs
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using iTin.Core;
using iTin.Core.Hardware.Common;
using iTin.Core.Helpers;
namespace iTin.Hardware.Specification.Smbios;
/// <summary>
/// The <b>SmbiosBaseType</b> class provides functions to analyze the properties associated with a structure <see cref="SMBIOS"/>.
/// </summary>
public abstract class SpecificSmbiosBaseType
{
#region private members
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private SmbiosPropertiesTable _smbiosPropertiesTable;
#endregion
#region private readonly members
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly byte[] _data;
#endregion
#region constructor/s
/// <summary>
/// Initializes a new instance of the class <see cref="SpecificSmbiosBaseType"/>.
/// </summary>
protected SpecificSmbiosBaseType()
{
}
/// <summary>
/// Initializes a new instance of the class <see cref="SpecificSmbiosBaseType"/> by specifying the raw data of a specific <b>SMBIOS</b> structure
/// </summary>
/// <param name="data">Raw data.</param>
protected SpecificSmbiosBaseType(byte[] data)
{
_data = data;
}
#endregion
#region public readonly properties
/// <summary>
/// Returns a list of implemented properties for this smbios structure.
/// </summary>
/// <returns>
/// A list of implemented properties for this structure.
/// </returns>
public IEnumerable<IPropertyKey> ImplementedProperties => Properties.Keys;
/// <summary>
/// Gets the properties available for this structure.
/// </summary>
/// <value>
/// Availables properties.
/// </value>
public SmbiosPropertiesTable Properties
{
get
{
if (_smbiosPropertiesTable != null)
{
return _smbiosPropertiesTable;
}
_smbiosPropertiesTable = new SmbiosPropertiesTable();
Parse(_smbiosPropertiesTable);
return _smbiosPropertiesTable;
}
}
#endregion
#region protected readonly properties
/// <summary>
/// Gets the current version of <see cref="SMBIOS"/>.
/// </summary>
/// <value>
/// Value representing the current version of <see cref="SMBIOS"/>.
/// </value>
protected int SmbiosVersion { get; }
#endregion
#region public methods
/// <summary>
/// Returns the value of specified property. Always returns the first appearance of the property. If it does not exist, returns <b>null</b> (<b>Nothing</b> in visual basic).
/// </summary>
/// <param name="propertyKey">Key to the property to obtain</param>
/// <returns>
/// Reference to the object that represents the value of the property. Always returns the first appearance of the property.
/// </returns>
public object GetPropertyValue(IPropertyKey propertyKey) => Properties.ContainsKey(propertyKey) ? Properties[propertyKey] : null;
/// <summary>
/// Returns the the strongly typed value of specified property. Always returns the first appearance of the property. If it does not exist, returns <b>null</b> (<b>Nothing</b> in visual basic).
/// </summary>
/// <param name="propertyKey">Key to the property to obtain</param>
/// <returns>
/// Reference to the object that represents the strongly typed value of the property. Always returns the first appearance of the property.
/// </returns>
public T GetPropertyValue<T>(IPropertyKey propertyKey) => (T)GetPropertyValue(propertyKey);
#endregion
#region protected methods
/// <summary>
/// Returns the stored value from the specified byte.
/// </summary>
/// <param name="target">target byte</param>
/// <returns>
/// The value stored in the indicated byte.
/// </returns>
protected byte GetByte(byte target) => _data[target];
/// <summary>
/// Returns the stored array from start with specified lenght.
/// </summary>
/// <param name="start">start byte</param>
/// <param name="lenght">lenght</param>
/// <returns>
/// The array value stored.
/// </returns>
protected byte[] GetBytes(byte start, byte lenght)
{
var bytes = new Collection<byte>();
for (var i = start; i <= lenght; i++)
{
bytes.Add(_data[i]);
}
return bytes.ToArray();
}
#region [protected] (int) GetWord(byte): Returns the stored value from the specified byte
/// <summary>
/// Returns the stored value from the specified byte.
/// </summary>
/// <param name="start">start byte</param>
/// <returns>
/// The value stored in the indicated byte.
/// </returns>
protected int GetWord(byte start) => _data.GetWord(start);
#endregion
#region [protected] (int) GetDoubleWord(byte): Returns the stored value from the specified byte
/// <summary>
/// Returns the stored value from the specified byte.
/// </summary>
/// <param name="start">start byte</param>
/// <returns>
/// The value stored in the indicated byte.
/// </returns>
protected int GetDoubleWord(byte start) => _data.GetDoubleWord(start);
#endregion
#region [protected] (long) GetQuadrupleWord(byte): Returns the stored value from the specified byte
/// <summary>
/// Returns the stored value from the specified byte.
/// </summary>
/// <param name="start">start byte</param>
/// <returns>
/// The value stored in the indicated byte.
/// </returns>
protected long GetQuadrupleWord(byte start) => _data.GetQuadrupleWord(start);
#endregion
#region [protected] (void) Parse(SmbiosPropertiesTable): Parse and populates the property collection for this structure
/// <summary>
/// Parse and populates the property collection for this structure.
/// </summary>
/// <param name="properties">Collection of properties of this structure.</param>
protected void Parse(SmbiosPropertiesTable properties)
{
SentinelHelper.ArgumentNull(properties, nameof(properties));
PopulateProperties(properties);
}
#endregion
#endregion
#region protected virtual methods
/// <summary>
/// Populates the property collection for this structure.
/// </summary>
/// <param name="properties">Collection of properties of this structure.</param>
protected virtual void PopulateProperties(SmbiosPropertiesTable properties)
{
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor.Characteristics/Arm64SocIdSupported.md
# DmiProperty.Processor.Characteristics.Arm64SocIdSupported property
Gets a value representing the key to retrieve the property value.
indicates that the processor supports returning a SoC ID value using the SMCCC_ARCH_SOC_ID architectural call, as defined in the Arm SMC Calling Convention Specification v1.2 at https://developer.arm.com/architectures/system-architectures/software-standards/smccc.
Key Composition
* Structure: Processor
* Property: Arm64SocIdSupported
* Unit: None
Return Value
Type: Boolean
Remarks
3.4+
```csharp
public static IPropertyKey Arm64SocIdSupported { get; }
```
## See Also
* class [Characteristics](../DmiProperty.Processor.Characteristics.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType028 [Temperature Probe].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Temperature Probe (Type 28) structure.<br/>
/// For more information, please see <see cref="SmbiosType028"/>.
/// </summary>
internal sealed class DmiType028 : DmiBaseType<SmbiosType028>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType028"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType028(SmbiosType028 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion >= DmiStructureVersion.Latest)
{
properties.Add(DmiProperty.TemperatureProbe.Description, SmbiosStructure.GetPropertyValue(SmbiosProperty.TemperatureProbe.Description));
properties.Add(DmiProperty.TemperatureProbe.LocationAndStatus.Status, SmbiosStructure.GetPropertyValue(SmbiosProperty.TemperatureProbe.LocationAndStatus.Status));
properties.Add(DmiProperty.TemperatureProbe.LocationAndStatus.Location, SmbiosStructure.GetPropertyValue(SmbiosProperty.TemperatureProbe.LocationAndStatus.Location));
ushort maximumValue = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.TemperatureProbe.MaximumValue);
if (maximumValue != 0x8000)
{
properties.Add(DmiProperty.TemperatureProbe.MaximumValue, maximumValue);
}
ushort minimumValue = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.TemperatureProbe.MinimumValue);
if (minimumValue != 0x8000)
{
properties.Add(DmiProperty.TemperatureProbe.MinimumValue, minimumValue);
}
ushort resolution = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.TemperatureProbe.Resolution);
if (resolution != 0x8000)
{
properties.Add(DmiProperty.TemperatureProbe.Resolution, resolution);
}
ushort tolerance = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.TemperatureProbe.Tolerance);
if (tolerance != 0x8000)
{
properties.Add(DmiProperty.TemperatureProbe.Tolerance, tolerance);
}
ushort accuracy = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.TemperatureProbe.Accuracy);
if (accuracy != 0x8000)
{
properties.Add(DmiProperty.TemperatureProbe.Accuracy, accuracy);
}
properties.Add(DmiProperty.TemperatureProbe.OemDefined, SmbiosStructure.GetPropertyValue(SmbiosProperty.TemperatureProbe.OemDefined));
}
if (SmbiosStructure.StructureInfo.Length < 0x15)
{
return;
}
ushort nominalValue = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.TemperatureProbe.NominalValue);
if (nominalValue != 0x8000)
{
properties.Add(DmiProperty.TemperatureProbe.NominalValue, nominalValue);
}
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemSlots/CurrentUsage.md
# DmiProperty.SystemSlots.CurrentUsage property
Gets a value representing the key to retrieve the property value.
Slot current usage.
Key Composition
* Structure: SystemSlots
* Property: CurrentUsage
* Unit: None
Return Value
Type: String
Remarks
2.0+
```csharp
public static IPropertyKey CurrentUsage { get; }
```
## See Also
* class [SystemSlots](../DmiProperty.SystemSlots.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PortConnector/InternalReferenceDesignator.md
# DmiProperty.PortConnector.InternalReferenceDesignator property
Gets a value representing the key to retrieve the property value.
String number for Internal Reference Designator, that is, internal to the system enclosure.
Key Composition
* Structure: PortConnector
* Property: InternalReferenceDesignator
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey InternalReferenceDesignator { get; }
```
## See Also
* class [PortConnector](../DmiProperty.PortConnector.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/CHANGELOG.md
# Changelog
All notable changes to this project will be documented in this file.
## 1.1.9 -
### Added
- Multiple Repository is used.
In the image, I show my folder structure, in case it helps someone
![multi-repo.png][mutli-repo]
### Changed
- Library versions for this version
| Library | Version | Description |
|:------|:------|:----------|
| iTin.Core| 2.0.0.7 | Base library containing various extensions, helpers, common constants |
| iTin.Core.Hardware.Abstractions | 1.0.0.0 | Generic Common Hardware Abstractions |
| iTin.Core.Hardware.Common | 1.0.0.5 | Common Hardware Infrastructure |
| iTin.Core.Hardware.Linux.Specification.Smbios | 1.0.0.2 | Linux Hardware Infrastructure |
| iTin.Core.Hardware.MacOS.Specification.Smbios | 1.0.0.2 | MacOS Hardware Infrastructure |
| iTin.Core.Hardware.Windows.Specification.Smbios | 1.0.0.2 | Windows Hardware Infrastructure |
| iTin.Core.Interop.Shared | 1.0.0.4 | Generic Shared Interop Definitions |
| iTin.Core.Interop.Windows.Specification.Smbios | 1.0.0.1 | Win32 Generic Interop Calls (SMBIOS) |
| iTin.Hardware.Abstractions.Specification.Smbios | 1.0.0.3 | Generic Common Hardware Abstractions |
| iTin.Hardware.Specification.Dmi | 3.3.0.7 | DMI Specification Implementation |
| iTin.Hardware.Specification.Smbios | 3.3.0.7 | SMBIOS Specification Implementation |
| iTin.Hardware.Specification.Tpm | 1.0.0.2 | TPM Specification Implementation |
| iTin.Logging | 1.0.0.3 | Logging library |
## [1.1.8] - 2023-08-17
### Fixed
- Fix **ProcesorId** property in **SmbiosType004 [Processor Information]** by [@Nuklon](https://github.com/Nuklon).
### Added
- Added support for System Management BIOS (SMBIOS) v3.7.0, includes:
* Processor Information (Type 4):
- SMBIOSCR00222: Added new processor sockets
- SMBIOSCR00224: Added new processor family
– SMBIOSCR00225: Added new processor socket
– SMBIOSCR00226: Added new processor sockets and updated link for LoongArch processor-specific data
– SMBIOSCR00228: Added new processor sockets
* Memory Device (Type 9):
- SMBIOSCR00221: Modified CXL description and added CXL 3.0 support
* Memory Device (Type 17):
- SMBIOSCR00227: Added PMIC/RCD Manufacturer ID and Revision information
### Changed
- Library versions for this version
| Library | Version | Description |
|:------|:------|:----------|
| iTin.Core| **2.0.0.7** | Base library containing various extensions, helpers, common constants |
| **iTin.Core.Hardware.Abstractions** | **1.0.0.0** | **Generic Common Hardware Abstractions** |
| iTin.Core.Hardware.Common | **1.0.0.5** | Common Hardware Infrastructure |
| iTin.Core.Hardware.Linux.Specification.Smbios | **1.0.0.2** | Linux Hardware Infrastructure |
| iTin.Core.Hardware.MacOS.Specification.Smbios | **1.0.0.2** | MacOS Hardware Infrastructure |
| iTin.Core.Hardware.Windows.Specification.Smbios | **1.0.0.2** | Windows Hardware Infrastructure |
| iTin.Core.Interop.Shared | **1.0.0.4** | Generic Shared Interop Definitions |
| iTin.Core.Interop.Windows.Specification.Smbios | **1.0.0.1** | Win32 Generic Interop Calls (SMBIOS) |
| iTin.Hardware.Abstractions.Specification.Smbios | **1.0.0.3** | Generic Common Hardware Abstractions |
| iTin.Hardware.Specification.Dmi | **3.3.0.7** | DMI Specification Implementation |
| iTin.Hardware.Specification.Smbios | **3.3.0.7** | SMBIOS Specification Implementation |
| iTin.Hardware.Specification.Tpm | **1.0.0.2** | TPM Specification Implementation |
| iTin.Logging | **1.0.0.3** | Logging library |
## [1.1.7] - 2022-10-11
### Added
- Added support for System Management BIOS (SMBIOS) v3.6.0, includes:
* Processor Information (Type 4):
- SMBIOSCR00214: Added new processor sockets
- SMBIOSCR00215: Added processor family ID for ARMv9
– SMBIOSCR00218: Added new processor socket types
– SMBIOSCR00219: Added "thread enabled" field
* Memory Device (Type 17):
- SMBIOSCR00220: Added HBM3
* Various:
- SMBIOSCR00217: Added LoongArch processor architecture
- Added support for **netstandard2.1**
- Add **SplitEnumerator** ref struct.
- **ByteReader** class rewritten to work with **Span** in net core projects.
- Added sample project for **net60**
### Changed
- Unify calls to obtain change information from a remote or local computer, currently this functionality is only available for Windows systems,
The logic of each platform is in its own assembly *iTin.Core.Hardware.**Target-System**.Specification.Smbios*.
*Where:*
**Target-System**, it can be *Linux*, *Windows* or *MacOS* and the platform independent logic is found in the
**iTin.Hardware.Abstractions.Specification.Smbios** assembly, so that from *SMBIOS* a call is made independent of the target platform and this
assembly has the responsibility of managing the final call to the platform destination.
- Library versions for this version
| Library | Version | Description |
|:------|:------|:----------|
| iTin.Core| **2.0.0.4** | Base library containing various extensions, helpers, common constants |
| iTin.Core.Hardware.Common | **1.0.0.3** | Common Hardware Infrastructure |
| iTin.Core.Hardware.Linux.Specification.Smbios | **1.0.0.1** | Linux Hardware Infrastructure |
| iTin.Core.Hardware.MacOS.Specification.Smbios | **1.0.0.1** | MacOS Hardware Infrastructure |
| iTin.Core.Hardware.Windows.Specification.Smbios | **1.0.0.1** | Windows Hardware Infrastructure |
| iTin.Core.Interop.Shared | **1.0.0.2** | Generic Shared Interop Definitions |
| iTin.Core.Interop.Windows.Specification.Smbios | **1.0.0.0** | Win32 Generic Interop Calls (SMBIOS) |
| iTin.Hardware.Abstractions.Specification.Smbios | **1.0.0.2** | Generic Common Hardware Abstractions |
| iTin.Hardware.Specification.Dmi| **3.3.0.6** | DMI Specification Implementation |
| iTin.Hardware.Specification.Smbios| **3.3.0.6** | SMBIOS Specification Implementation |
| iTin.Hardware.Specification.Tpm| 1.0.0.1 | TPM Specification Implementation |
| iTin.Logging| **1.0.0.1** | Logging library |
## [1.1.6] - 2021-12-09
### Fixed
- Fixes an issue that generates an exception when a property that returns an object of type QueryPropertyDictionaryResult not available.
### Added
- Added support for System Event Log structure.
- Added support for System Management BIOS (SMBIOS) v3.5.0, includes:
* BIOS Information (Type 0):
- SMBIOSCR00209: Added support for manufacturing mode
- SMBIOSCR00210: Updated the definition of BIOS Starting Address Segment for UEFI systems
* Processor Information (Type 4):
- SMBIOSCR00205: Added processor socket (LGA4677)
* System Slots (Type 9):
- SMBIOSCR00202: Added support for slot height
– SMBIOSCR00203: Errata: correct offsets
* Built-in Pointing Device (Type 21):
- SMBIOSCR00200: Added support for new Pointing Device interfaces
* Built-in Pointing Device (Type 41):
- SMBIOSCR00201: Added support for new Onboard Device Types
– SMBIOSCR00204: Added note on how to describe multi-function devices
* Firmware Inventory Information (Type 45, new):
– SMBIOSCR00208: Added structure type for Firmware Inventory Information
* String Property (Type 46, new):
– SMBIOSCR00211: Added structure for string properties
- Library documentation
- ```tools``` folder in solution root. Contains a script for update help md files.
- Added support for **MacOS** (In progress...)
Tested on:
| macOS | Version |
|:------|:------|
| macOS Monterey | 12.0.1 |
| Big Sur | 11.0.1 |
| Catalina | 10.15.7 |
### Changed
- Changed **```IResultGeneric```** interface. Changed **```Value```** property name by **```Result```** (for code clarify).
This change may have implications in your final code, it is resolved by changing Value to Result
- Updated result classes for support more scenaries.
- Library versions for this version
| Library | Version | Description |
|:------|:------|:----------|
| iTin.Core| **2.0.0.3** | Base library containing various extensions, helpers, common constants |
| iTin.Core.Hardware.Common | **1.0.0.2** | Common Hardware Infrastructure |
| iTin.Core.Hardware.Linux.Specification.Smbios | **1.0.0.0** | Linux Hardware Infrastructure |
| iTin.Core.Hardware.MacOS.Specification.Smbios | **1.0.0.0** | MacOS Hardware Infrastructure |
| iTin.Core.Hardware.Windows.Specification.Smbios | **1.0.0.0** | Windows Hardware Infrastructure |
| iTin.Core.Interop.Shared | **1.0.0.1** | Generic Shared Interop Definitions |
| iTin.Core.Interop.Windows.Specification.Smbios | **1.0.0.0** | Win32 Generic Interop Calls (SMBIOS) |
| iTin.Hardware.Abstractions.Specification.Smbios | **1.0.0.1** | Generic Common Hardware Abstractions |
| iTin.Hardware.Specification.Dmi| **3.3.0.5** | DMI Specification Implementation |
| iTin.Hardware.Specification.Smbios| **3.3.0.5** | SMBIOS Specification Implementation |
| iTin.Hardware.Specification.Tpm| 1.0.0.1 | TPM Specification Implementation |
| iTin.Logging| 1.0.0.0 | Logging library |
## [1.1.5] - 2020-10-11
### Added
- Add new libraries and remove old libraries for compability with another packages (Win32 only and Cross-Platform)
- In order to unify the obtaining of one or more properties by directly consulting the structures, two new methods have been added to replace the existing ones.
#### Examples:
##### Single property
###### Before
DmiStructureCollection structures = DMI.CreateInstance().Structures;
object biosVersion = structures.GetProperty(DmiProperty.Bios.BiosVersion);
if (biosVersion! = null)
{
Console.WriteLine ($ @ "BIOS Version> {biosVersion}");
}
###### Current Version
DmiStructureCollection structures = DMI.CreateInstance().Structures;
QueryPropertyResult biosVersion = structures.GetProperty (DmiProperty.Bios.BiosVersion);
if (biosVersion.Success)
{
Console.WriteLine ($ @ "> BIOS Version> {biosVersion.Value.Value}");
}
###### Where
> Success
true if current operation was executed successfully, otherwise false.
> Value
If is success, contains an instance of PropertyItem containing property value (Value property) and property key (Key property)
> Errors
If not success, contains a error collection, containing the query errors.
##### Multiple properties
###### Before
DmiStructureCollection structures = DMI.CreateInstance().Structures;
IDictionary<int, object> systemSlots = structures.GetProperties(DmiProperty.SystemSlots.SlotId);
bool hasSystemSlots = systemSlots.Any();
if (!hasSystemSlots)
{
Console.WriteLine($" > There is no system slots information structure in this computer");
}
else
{
foreach (KeyValuePair<int, object> systemSlot in systemSlots)
{
int element = systemSlot.Key;
var property = ((IEnumerable<KeyValuePair<IPropertyKey, object>>) systemSlot.Value).FirstOrDefault();
Console.WriteLine($@" System Slot ({element}) > {property.Value}");
}
}
###### Current Version
DmiStructureCollection structures = DMI.CreateInstance().Structures;
QueryPropertyCollectionResult systemSlotsQueryResult = structures.GetProperties(DmiProperty.SystemSlots.SlotDesignation);
if (!systemSlotsQueryResult.Success)
{
Console.WriteLine($@" > Error(s)");
Console.WriteLine($@" {systemSlotsQueryResult.Errors.AsMessages().ToStringBuilder()}");
}
else
{
IEnumerable<PropertyItem> systemSlotsItems = systemSlotsQueryResult.Value.ToList();
bool hasSystemSlotsItems = systemSlotsItems.Any();
if (!hasSystemSlotsItems)
{
Console.WriteLine($@" > Sorry, The '{DmiProperty.SystemSlots.SlotId}' property has not implemented on this system");
}
else
{
int index = 0;
foreach (var systemSlotItem in systemSlotsItems)
{
Console.WriteLine($@" > System Slot ({index}) > {systemSlotItem.Value}");
index++;
}
}
}
###### Where
> Success
true if current operation was executed successfully, otherwise false.
> Value
If is success, contains an instance of IEnumerable<PropertyItem> containing properties list,
on each item contains an instance of PropertyItem containing property value (Value property)
and property key (Key property)
> Errors
If not success, contains a error collection, containing the query errors.
### Removed
- Removed **net45** and **netcoreapp** targets. Current supported targets, **net461** and **netstandard20**
- Libraries removed in this version
|Library|Version|Description|
|:------|:------|:----------|
|iTin.Core.Interop| 1.0.0 | Interop calls |
|iTin.Core.Hardware| 1.0.1 | Hardware Interop Calls |
### Changed
- Rename **iTin.Core.Harware.XXX** namespaces for **iTin.Harware.XXX** namespaces
- Library versions for this version
|Library|Version|Description|
|:------|:------|:----------|
|iTin.Core| **2.0.0.1** | Base library containing various extensions, helpers, common constants |
|iTin.Core.Hardware.Common| **1.0.0.1** | Generic Common Hardware Infrastructure |
|iTin.Core.Hardware.Windows.Smbios| 1.0.0.0 | Win32 Generic Hardware Calls (SMBIOS) |
|iTin.Core.Interop.Shared| 1.0.0.0 | Generic Shared Interop Definitions, Data Structures, Constants... |
|iTin.Core.Interop.Windows.Smbios| 1.0.0.0 | Win32 Generic Interop Calls (SMBIOS) |
|iTin.Hardware.Specification.Dmi|**3.3.0.4**| DMI Specification Implementation |
|iTin.Hardware.Specification.Smbios|**3.3.0.4**| SMBIOS Specification Implementation |
|iTin.Hardware.Specification.Tpm|**1.0.0.1**| TPM Specification Implementation |
|iTin.Logging|1.0.0.0| Logging library |
## [1.1.4] - 2020-08-02
### Added
- Adds support for System Management BIOS (SMBIOS) v3.4.0, includes:
* Processor Information (Type 4):
- SMBIOSCR00189: update the definition of Type 4 Processor Id for ARM64 CPUs
- SMBIOSCR00191: add Socket LGA1200
* System Slots (Type 9):
- SMBIOSCR00193: add OCP NIC Prior to 3.0
- SMBIOSCR00196: Slot Type extensions for PCIe Gen6 and beyond
- SMBIOSCR00197: Add support for CXL 2.0 devices
- SMBIOSCR00199: Add support for EDSFF slot types
* Memory Device (Type 17):
- SMBIOSCR00195: update description for Intel persistent memory device
- SMBIOSCR00197: Add support for CXL 2.0 devices
- Adds support for retrieving **DMI** information for remote machines using **WMI**
- **Currently in experimental mode, you can try to use it as it is implemented and comment if you find any problems**
- Please review the following document that indicates how to configure a remote computer to accept **WMI** calls
[Connecting to WMI on a Remote Computer]
- Usage examples
The DMI.Instance property now is mark as obsolete use DMI.CreateInstance() method instead
If you want to connect to a remote machine fill in an instance of the DmiConnectOptions object and use it
as the argument of the DMI method.CreateInstance(optionsInstance).
Example:
// Returns same result as DMI.Instance
DMI dmi = DMI.CreateInstance();
// Connect to remote machine.
DMI dmi = DMI.CreateInstance(
new DmiConnectOptions
{
UserName = "username to use"
Password = "<PASSWORD>",
MachineNameOrIpAddress = "target remote machine name or machine ip address"
});
### Changed
- Library versions for this version
|Library|Version|Description|
|:------|:------|:----------|
|iTin.Core| **1.0.2** | Common calls |
|iTin.Core.Interop| 1.0.0 | Interop calls |
|iTin.Core.Hardware| 1.0.1 | Hardware Interop Calls |
|iTin.Core.Hardware.Specification.Dmi|**3.3.0.3**| DMI Specification Implementation |
|iTin.Core.Hardware.Specification.Smbios|**3.3.0.3**| SMBIOS Specification Implementation |
|iTin.Core.Hardware.Specification.Tpm|1.0.0| TPM Specification Implementation |
## [1.1.3] - 2020-03-06
### Fixed
- Fixed a bug in the DmiType 022 [Portable Battery] structure for versions equal to or greater than 2.1, which prevents the correct assignment of the **DesignVoltage** property due to an error in type conversion
- Fixed a bug in the DmiType 022 [Portable Battery] structure for versions equal to or greater than 2.1, which prevents the correct assignment of the **DesignCapacity** property due to an error in type conversion
- Fixed a bug in the DmiType 022 [Portable Battery] structure for versions equal to or greater than 2.1, which prevents the correct assignment of the **OemSpecific** property due to an error in type conversion
- Fixed a bug in the DmiType 000 [BIOS] structure for versions equal to or greater than 3.1, which prevents the correct assignment of the **BiosRomSize** property due to an error in type conversion
- Fixed a bug where the detection of **StructureVersion** for Type017 [Memory device], when the length of the structure is not a canonical length, such as windows running virtualized in parallels on a mac
### Changed
- Library versions for this version
|Library|Version|Description|
|:------|:------|:----------|
|iTin.Core| 1.0.1 | Common calls |
|iTin.Core.Interop| 1.0.0 | Interop calls |
|iTin.Core.Hardware| 1.0.1 | Hardware Interop Calls |
|iTin.Core.Hardware.Specification.Dmi|3.3.0.1| DMI Specification Implementation |
|iTin.Core.Hardware.Specification.Smbios|3.3.0.2| SMBIOS Specification Implementation |
|iTin.Core.Hardware.Specification.Tpm|1.0.0| TPM Specification Implementation |
## [1.1.2] - 2020-02-15
### Added
- Adds support for System Management BIOS (SMBIOS) v3.4.0a (Preliminary version), includes:
* Processor Information (Type 4)::
- SMBIOSCR00190: add Socket LGA4189
* System Slots (Type 9):
- SMBIOSCR00186: add PCI Express Gen 5 and U.2 values
- SMBIOSCR00188: add OCP NIC 3.0 values
* Memory Device (Type 17):
- SMBIOSCR00187: add new memory device types (DDR5, LPDDR5)
- Adds **SmbiosVersion** property to **DMI** object.
- Adds **ImplementedVersion** property to **DmiClasses**, indicates which structure version the manufacturer has implemented for a version of smbios.
- SMBIOS 3.4.0a (preliminary version) pdf file to Documents folder.
### Changed
- Typographic errors. Renames properties names.
- Adds descriptive code help. I Tried to adds a help most descriptive for the properties keys.
- The image below shows an example.
![Help.png][help]
- Library versions for this version
|Library|Version|Description|
|:------|:------|:----------|
|iTin.Core| 1.0.1 | Common calls |
|iTin.Core.Interop| 1.0.0 | Interop calls |
|iTin.Core.Hardware| 1.0.1 | Hardware Interop Calls |
|iTin.Core.Hardware.Specification.Dmi|3.3.0.1| DMI Specification Implementation |
|iTin.Core.Hardware.Specification.Smbios|3.3.0.1| SMBIOS Specification Implementation |
|iTin.Core.Hardware.Specification.Tpm|1.0.0| TPM Specification Implementation |
## [1.1.1] - 2019-10-20
### Added
- Adds support for System Management BIOS (SMBIOS) v3.3.0, includes:
* System Slots (Type 9):
- SMBIOSCR00184: add PCI Express Gen 4 values
- SMBIOSCR00185: clarify bus number usage for PCI Express
* Memory Device (Type 17):
- SMBIOSCR00178: add new memory device type value (HBM) and new form factor value (Die)
- SMBIOSCR00179: update the string for Intel persistent memory
* Various:
- SMBIOSCR00181: add support for RISC-V processors, add structure type 44 (processor-additional information)
- SMBIOSCR00183: add support for CXL Flexbus
### Changed
- Library versions for this version
|Library|Version|Description|
|:------|:------|:----------|
|iTin.Core| 1.0.0 | Common calls |
|iTin.Core.Interop| 1.0.0 | Interop calls |
|iTin.Core.Hardware| 1.0.0 | Hardware Interop Calls |
|iTin.Core.Hardware.Specification.Dmi|3.3.0.0| DMI Specification Implementation |
|iTin.Core.Hardware.Specification.Smbios|3.3.0.0| SMBIOS Specification Implementation |
|iTin.Core.Hardware.Specification.Tpm|1.0.0| TPM Specification Implementation |
## [1.1.0] - 2019-09-02
### Added
- **iTin.Core.Interop**: Adds binary compability with iEEDID, iCPUID, iScreen (comming soon)
- Many structures, enumerations, win32 native methods have been added to project, for video cards, video modes, monitors, storage, etc ...
- Minor changes.
### Changed
- **iTin.Core.Hardware**:
- Due to a problem with duplicate properties of the same type, the data type for storing the properties has been changed.
## [1.0.9] - 2019-08-28
### Added
- Added **iSMBIOS.ConsoleAppCore** netcoreapp console app project.
\root
- lib
- iTin.Core
- iTin.Core [Common Calls]
- iTin.Core.Interop [Interop Calls]
- iTin.Core.Hardware
- iTin.Core.Hardware [Hardware Interop Calls]
- iTin.Core.Hardware.Specification
- iTin.Core.Hardware.Specification.Dmi [DMI Specification Implementation]
- iTin.Core.Hardware.Specification.Smbios [SMBIOS Specification Implementation]
- iTin.Core.Hardware.Specification.Tpm [TPM Specification Implementation]
- test
- iSMBIOS.ConsoleApp [Console Test App]
- iSMBIOS.ConsoleAppCore [NetCoreApp Console Test App]
- Minor changes.
### Changed
- The solution has been migrated to **.NetStandard**.
- The supported targets are:
.NetFramework > = 4.5
.NetStandard > = 2.0
.NetCoreapp > = 2.0
## [1.0.8] - 2019-08-23
### Added
- Added **iTin.Core.Hardware.Specification.Smbios** project for **SMBIOS** calls.
- Implements the fully specification(s).
- Now you can directly access the SMBIOS properties, to do this make the following call.
var smbios = SMBIOS.Instance.ImplementedStructures;
- Added **iTin.Core.Hardware.Specification.Dmi** project for **DMI** calls.
- Simplify access to properties, that is, it is sometimes possible for the specification to define a property for a specific version, and in another version add a new property that extends the previous one, the **Smbios library**, will return both properties separately each with its own corresponding key, however the **Dmi library** with a single key will return the value of the property either normal or extended.
Example:
SmbiosType000 [BIOS Information], contains BIOS ROM Size and Extended BIOS ROM Size properties if your version allows.
· Smbios will have both properties available:
> SmbiosProperty.Bios.BiosRomSize
> SmbiosProperty.Bios.ExtendedBiosRomSize
· Dmi will have one property available:
> DmiProperty.Bios.BiosRomSize
- Added **iTin.Core.Hardware.Specification.Tpm** project.
- Includes TPM (Trusted Platform Module), used in SmbiosType043 [TPM Device] class.
- Minor changes.
### Changed
- Solution structure, prepare solution structure to add future new specifications.
\root
- lib
- iTin.Core
- iTin.Core [Common Calls]
- iTin.Core.Interop [Interop Calls]
- iTin.Core.Hardware
- iTin.Core.Hardware [Hardware Interop Calls]
- iTin.Core.Hardware.Specification
- iTin.Core.Hardware.Specification.Dmi [DMI Specification Implementation]
- iTin.Core.Hardware.Specification.Smbios [SMBIOS Specification Implementation]
- iTin.Core.Hardware.Specification.Tpm [TPM Specification Implementation]
- test
- iSMBIOS.ConsoleApp [Console Test App]
- Assemblies with strong naming.
### Removed
- Unused variables.
## [1.0.7] - 2019-08-13
### Changed
- Changes nuget package for work in release mode.
## [1.0.6] - 2019-04-30
### Changed
- Type 0 - BIOS Information structure
- Unified the BIOS Rom Size and Extended BIOS Rom Size properties in the Rom Size BIOS property.
- Modified the property BIOS Rom Size Unit to display values in order of KB.
- Type 1 - System Information structure
- Modified the UUID property for start with '\{' and end with '\}'.
- Example:
Before
7DFF2AF0-F6B9-4946-9AF6-4E10B59D5106
After
{7DFF2AF0-F6B9-4946-9AF6-4E10B59D5106}
- Minor changes.
### Fixed
- Type 4 - Processor structure
- Fix an error in the Processor structure. Now the Voltage property returns the correct value.
## [1.0.5] - 2019-04-25
- Equals to v1.0.4 but without errors in nuget package.
## 1.0.4 - 2019-04-25
### Added
- Added **iTin.Core.Interop** project for interop calls.
- The **GetProperty** method was added in the class **DmiClass**, to directly recover a property, this allows us to consider a specification as a bag of consultable properties,
for more information, please see how to use it in the example project. On the other hand later when there are more implemented specifications the use of the **DeviceProperty** type will allow us to and consult properties in different "bags".
- Minor changes.
### Changed
- Solution structure, prepare solution structure to add future new specifications.
\root
- lib
- iTin.Core
- iTin.Core [Common Calls]
- iTin.Core.Interop [Interop Calls]
- iTin.Core.Hardware
- iTin.Core.Hardware [Hardware Interop Calls]
- iTin.Core.Hardware.Specification [Hardware Specification(s) Implementation(s)]
- test
- iSMBIOS.ConsoleApp [Console Test App]
### Removed
- **DeviceProperty** data type. This type of data is not going to be eliminated but its use will change, later it can be used as a receiver of the different types of data returned by the different specifications.
## [1.0.3] - 2019-04-11
### Added
- Added support for Type 43 [TPM Device].
- Added native interop functions for handle the firmware tables.
- Now first we try to get the BIOS data through a native call, if this fails, the call will be made through **WMI**.
- Added two new methods to **DmiStructureCollection** class that allow you to consult a property directly. For more information, please see GetProperty and GetProperties.
- Minor changes.
## [1.0.2] - 2019-04-03
### Added
- This CHANGELOG file.
- Memory Technology field to Structure Type 17 [Memory Device].
### Changed
- Full support for Structure Type 42 [Management Controller Host Interface].
- Rewrite KnownDmiProperty files (uses expression-body syntax) implies remove 1000 lines aprox.
### Fixed
- Fixes an error that occurs when trying to retrieve the ExtendedMaximumCapacity field of structure 16 [Physical Memory Array]
when running on a virtualized computer with Parallels (MacOS).
## [1.0.1] - 2019-03-29
### Fixed
- Fix crash caused by IntExtension from [@DexterWoo](https://github.com/DexterWoo).
## [1.0.0] - 2018-12-29
### Added
- Create project and first commit
[1.1.9]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.1.9
[1.1.8]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.1.8
[1.1.7]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.1.7
[1.1.6]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.1.6
[1.1.5]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.1.5
[1.1.4]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.1.4
[1.1.3]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.1.3
[1.1.2]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.1.2
[1.1.1]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.1.1
[1.1.0]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.1.0
[1.0.9]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.0.9
[1.0.8]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.0.8
[1.0.7]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.0.7
[1.0.6]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.0.6
[1.0.5]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.0.5
[1.0.3]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.0.3
[1.0.2]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.0.2
[1.0.1]: https://github.com/iAJTin/iSMBIOS/releases/tag/v1.0.1
[1.0.0]: https://github.com/iAJTin/iSMBIOS
[help]: ./assets/help.png "help"
[mutli-repo]: ./assets/multi-repo.png "folder structure"
[Connecting to WMI on a Remote Computer]: https://docs.microsoft.com/es-es/windows/win32/wmisdk/connecting-to-wmi-on-a-remote-computer
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryController.md
# DmiProperty.MemoryController class
Contains the key definitions available for a type 005, obsolete [MemoryController Information] structure.
```csharp
public static class MemoryController
```
## Public Members
| name | description |
| --- | --- |
| static [ContainedMemoryModules](DmiProperty.MemoryController/ContainedMemoryModules.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [CurrentInterleave](DmiProperty.MemoryController/CurrentInterleave.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [EnabledErrorCorrectingCapabilities](DmiProperty.MemoryController/EnabledErrorCorrectingCapabilities.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ErrorCorrectingCapabilities](DmiProperty.MemoryController/ErrorCorrectingCapabilities.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ErrorDetectingMethod](DmiProperty.MemoryController/ErrorDetectingMethod.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MaximumMemoryModuleSize](DmiProperty.MemoryController/MaximumMemoryModuleSize.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MemoryModuleVoltages](DmiProperty.MemoryController/MemoryModuleVoltages.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [NumberMemorySlots](DmiProperty.MemoryController/NumberMemorySlots.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SupportedInterleave](DmiProperty.MemoryController/SupportedInterleave.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SupportedMemoryTypes](DmiProperty.MemoryController/SupportedMemoryTypes.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SupportedSpeeds](DmiProperty.MemoryController/SupportedSpeeds.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/DmiStructureClass.cs
using iTin.Core.Hardware.Common;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Known <see cref="DMI"/> structures.
/// </summary>
public enum DmiStructureClass
{
/// <summary>
/// <b>Bios</b> structure, for more information please see <see cref="DmiType000"/>.
/// </summary>
[PropertyName("BIOS")]
[PropertyDescription("")]
Bios = 0x00,
/// <summary>
/// <b>System</b> structure, for more information please see <see cref="DmiType001"/>.
/// </summary>
[PropertyName("System")]
[PropertyDescription("")]
System = 0x01,
/// <summary>
/// <b>BaseBoard</b> structure, for more information please see <see cref="DmiType002"/>.
/// </summary>
[PropertyName("Base Board")]
[PropertyDescription("")]
BaseBoard = 0x02,
/// <summary>
/// <b>System Enclosure</b> structure, for more information please see <see cref="DmiType003"/>.
/// </summary>
[PropertyName("System Enclosure")]
[PropertyDescription("")]
SystemEnclosure = 0x03,
/// <summary>
/// <b>Processor</b> structure, for more information please see <see cref="DmiType004"/>.
/// </summary>
[PropertyName("Processor")]
[PropertyDescription("")]
Processor = 0x04,
/// <summary>
/// <b>Memory Controller</b> (obsolete) structure, for more information please see <see cref="DmiType005"/>.
/// </summary>
[PropertyName("Memory Controller")]
[PropertyDescription("")]
MemoryController = 0x05,
/// <summary>
/// <b>Memory Module</b> (obsolete) structure, for more information please see <see cref="DmiType006"/>.
/// </summary>
[PropertyName("Memory Module")]
[PropertyDescription("")]
MemoryModule = 0x06,
/// <summary>
/// <b>Cache Memory</b> structure, for more information please see <see cref="DmiType007"/>.
/// </summary>
[PropertyName("Cache")]
[PropertyDescription("")]
Cache = 0x07,
/// <summary>
/// <b>Port Connector</b> structure, for more information please see <see cref="DmiType008"/>.
/// </summary>
[PropertyName("Port Connector")]
[PropertyDescription("")]
PortConnector = 0x08,
/// <summary>
/// <b>System Slots</b> structure, for more information please see <see cref="DmiType009"/>.
/// </summary>
[PropertyName("System Slots")]
[PropertyDescription("")]
SystemSlots = 0x09,
/// <summary>
/// <b>On Board Devices</b> structure, for more information please see <see cref="DmiType010"/>.
/// </summary>
[PropertyName("On Board Devices")]
[PropertyDescription("")]
OnBoardDevices = 0x0a,
/// <summary>
/// <b>OEM Strings</b> structure, for more information please see <see cref="DmiType011"/>.
/// </summary>
[PropertyName("OEM Strings")]
[PropertyDescription("")]
OemStrings = 0x0b,
/// <summary>
/// <b>System Configuration Options</b> structure, for more information please see <see cref="DmiType012"/>.
/// </summary>
[PropertyName("System Configuration Options")]
[PropertyDescription("")]
SystemConfigurationOptions = 0x0c,
/// <summary>
/// <b>Bios Language</b> structure, for more information please see <see cref="DmiType013"/>.
/// </summary>
[PropertyName("Bios Language")]
[PropertyDescription("")]
BiosLanguage = 0x0d,
/// <summary>
/// <b>Group Associations</b> structure, for more information please see <see cref="DmiType014"/>.
/// </summary>
[PropertyName("Group Associations")]
[PropertyDescription("")]
GroupAssociations = 0x0e,
/// <summary>
/// <b>System Event Log</b> structure, for more information please see <see cref="DmiType015"/>.
/// </summary>
[PropertyName("System Event Log")]
[PropertyDescription("")]
SystemEventLog = 0x0f,
/// <summary>
/// <b>Physical Memory Array</b> structure, for more information please see <see cref="DmiType016"/>.
/// </summary>
[PropertyName("Physical Memory Array")]
[PropertyDescription("")]
PhysicalMemoryArray = 0x10,
/// <summary>
/// <b>Memory Device</b> structure, for more information please see <see cref="DmiType017"/>.
/// </summary>
[PropertyName("Memory Device")]
[PropertyDescription("")]
MemoryDevice = 0x11,
/// <summary>
/// <b>32-Bit Memory Error Information</b> structure, for more information please see <see cref="DmiType018"/>.
/// </summary>
[PropertyName("32-Bit Memory Error")]
[PropertyDescription("")]
BitMemoryError32 = 0x12,
/// <summary>
/// <b>Memory Array Mapped Address</b> structure, for more information please see <see cref="DmiType019"/>.
/// </summary>
[PropertyName("Memory Array Mapped Address")]
[PropertyDescription("")]
MemoryArrayMappedAddress = 0x13,
/// <summary>
/// <b>Memory Device Mapped Address</b> structure, for more information please see <see cref="DmiType020"/>.
/// </summary>
[PropertyName("Memory Device Mapped Address")]
[PropertyDescription("")]
MemoryDeviceMappedAddress = 0x14,
/// <summary>
/// <b>Built-in Pointing Device</b> structure, for more information please see <see cref="DmiType021"/>.
/// </summary>
[PropertyName("Built-In Pointing Device")]
[PropertyDescription("")]
BuiltInPointingDevice = 0x15,
/// <summary>
/// <b>Portable Battery</b> structure, for more information please see <see cref="DmiType022"/>.
/// </summary>
[PropertyName("Portable Battery")]
[PropertyDescription("")]
PortableBattery = 0x16,
/// <summary>
/// <b>System Reset</b> structure, for more information please see <see cref="DmiType023"/>.
/// </summary>
[PropertyName("System Reset")]
[PropertyDescription("")]
SystemReset = 0x17,
/// <summary>
/// <b>Hardware Security</b> structure, for more information please see <see cref="DmiType024"/>.
/// </summary>
[PropertyName("Hardware Security")]
[PropertyDescription("")]
HardwareSecurity = 0x18,
/// <summary>
/// <b>System Power Controls</b> structure, for more information please see <see cref="DmiType025"/>.
/// </summary>
[PropertyName("System Power Controls")]
[PropertyDescription("")]
SystemPowerControls = 0x19,
/// <summary>
/// <b>Voltage Probe</b> structure, for more information please see <see cref="DmiType026"/>.
/// </summary>
[PropertyName("Voltage Probe")]
[PropertyDescription("")]
VoltageProbe = 0x1a,
/// <summary>
/// <b>Cooling Device</b> structure, for more information please see <see cref="DmiType027"/>.
/// </summary>
[PropertyName("Cooling Device")]
[PropertyDescription("")]
CoolingDevice = 0x1b,
/// <summary>
/// <b>Temperature Probe</b> structure, for more information please see <see cref="DmiType028"/>.
/// </summary>
[PropertyName("Temperature Probe")]
[PropertyDescription("")]
TemperatureProbe = 0x1c,
/// <summary>
/// <b>Electrical Current Probe</b> structure, for more information please see <see cref="DmiType029"/>.
/// </summary>
[PropertyName("Electrical Current Probe")]
[PropertyDescription("")]
ElectricalCurrentProbe = 0x1d,
/// <summary>
/// <b>Out-Of-Band Remote</b> structure, for more information please see <see cref="DmiType030"/>.
/// </summary>
[PropertyName("Out Of Band Remote")]
[PropertyDescription("")]
OutOfBandRemote = 0x1e,
/// <summary>
/// <b>Boot Integrity Services (BIS) Entry Point</b> structure, for more information please see <see cref="DmiType031"/>.
/// </summary>
[PropertyName("Boot Integrity Services Entry Point")]
[PropertyDescription("")]
BootIntegrityServicesEntryPoint = 0x1f,
/// <summary>
/// <b>System Boot Information</b> structure, for more information please see <see cref="DmiType032"/>.
/// </summary>
[PropertyName("System Boot")]
[PropertyDescription("")]
SystemBoot = 0x20,
/// <summary>
/// <b>64-Bit Memory Error Information</b> structure, for more information please see <see cref="DmiType033"/>.
/// </summary>
[PropertyName("64-Bit Memory Error")]
[PropertyDescription("")]
BitMemoryError64 = 0x21,
/// <summary>
/// <b>Management Device</b> structure, for more information please see <see cref="DmiType034"/>.
/// </summary>
[PropertyName("Management Device")]
[PropertyDescription("")]
ManagementDevice = 0x22,
/// <summary>
/// <b>Management Device Component</b> structure, for more information please see <see cref="DmiType035"/>.
/// </summary>
[PropertyName("Management Device Component")]
[PropertyDescription("")]
ManagementDeviceComponent = 0x23,
/// <summary>
/// <b>Management Device Threshold Data</b> structure, for more information please see <see cref="DmiType036"/>.
/// </summary>
[PropertyName("Management Device Threshold Data")]
[PropertyDescription("")]
ManagementDeviceThresholdData = 0x24,
/// <summary>
/// <b>Memory Channel</b> structure, for more information please see <see cref="DmiType037"/>.
/// </summary>
[PropertyName("Memory Channel")]
[PropertyDescription("")]
MemoryChannel = 0x25,
/// <summary>
/// <b>IPMI Device Information</b> structure, for more information please see <see cref="DmiType038"/>.
/// </summary>
[PropertyName("IPMI Device")]
[PropertyDescription("")]
IpmiDevice = 0x26,
/// <summary>
/// <b>System Power Supply</b> structure, for more information please see <see cref="DmiType039"/>.
/// </summary>
[PropertyName("System Power Supply")]
[PropertyDescription("")]
SystemPowerSupply = 0x27,
/// <summary>
/// <b>Additional Information</b> structure, for more information please see <see cref="DmiType040"/>.
/// </summary>
[PropertyName("Additional Information")]
[PropertyDescription("")]
AdditionalInformation = 0x28,
/// <summary>
/// <b>OnBoard Devices Extended Information</b> structure, for more information please see <see cref="DmiType041"/>.
/// </summary>
[PropertyName("On Board Devices Extended")]
[PropertyDescription("")]
OnBoardDevicesExtended = 0x29,
/// <summary>
/// <b>Management Controller Host Interface</b> structure, for more information please see <see cref="DmiType042"/>.
/// </summary>
[PropertyName("Management Controller Host Interface")]
[PropertyDescription("")]
ManagementControllerHostInterface = 0x2A,
/// <summary>
/// <b>TPM Device</b> structure, for more information please see <see cref="DmiType043"/>.
/// </summary>
[PropertyName("TPM Device")]
[PropertyDescription("")]
TpmDevice = 0x2b,
/// <summary>
/// <b>TPM Device</b> structure, for more information please see <see cref="DmiType044"/>.
/// </summary>
[PropertyName("Processor Additional Information")]
[PropertyDescription("")]
ProcessorAdditionalInformation = 0x2c,
/// <summary>
/// <b>Firmware Inventory Information</b> structure, for more information please see <see cref="DmiType045"/>.
/// </summary>
[PropertyName("Firmware Inventory Information")]
[PropertyDescription("")]
FirmwareInventoryInformation = 0x2d,
/// <summary>
/// <b>String Property</b> structure, for more information please see <see cref="DmiType046"/>.
/// </summary>
[PropertyName("String Property")]
[PropertyDescription("")]
StringProperty = 0x2e,
/// <summary>
/// <b>Inactive</b> structure, for more information please see <see cref="DmiType126"/>.
/// </summary>
[PropertyName("Inactive")]
[PropertyDescription("")]
Inactive = 0x7e,
/// <summary>
/// <b>End-Of-Table</b> structure, for more information please see <see cref="DmiType127"/>.
/// </summary>
[PropertyName("End Of Table")]
[PropertyDescription("")]
EndOfTable = 0x7f,
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType012 [System Configuration Options].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the System Configuration Options (Type 12) structure.<br/>
/// For more information, please see <see cref="SmbiosType012"/>.
/// </summary>
internal sealed class DmiType012 : DmiBaseType<SmbiosType012>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType012"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType012(SmbiosType012 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
properties.Add(DmiProperty.SystemConfigurationOptions.Values, SmbiosStructure.GetPropertyValue(SmbiosProperty.SystemConfigurationOptions.Values));
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.ElectricalCurrentProbe.LocationAndStatus/Location.md
# DmiProperty.ElectricalCurrentProbe.LocationAndStatus.Location property
Gets a value representing the key to retrieve the property value.
Probe’s physical location of the temperature monitored by this temperature probe.
Key Composition
* Structure: ElectricalCurrentProbe
* Property: Location
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey Location { get; }
```
## See Also
* class [LocationAndStatus](../DmiProperty.ElectricalCurrentProbe.LocationAndStatus.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor.Characteristics/ExecuteProtectionSupport.md
# DmiProperty.Processor.Characteristics.ExecuteProtectionSupport property
Gets a value representing the key to retrieve the property value.
Indicates that the processor supports marking specific memory regions as non-executable. For example, this is the NX (No eXecute) feature of AMD processors and the XD (eXecute Disable) feature of Intel processors. Does not indicate the present state of this feature.
Key Composition
* Structure: Processor
* Property: ExecuteProtectionSupport
* Unit: None
Return Value
Type: Boolean
Remarks
2.5+
```csharp
public static IPropertyKey ExecuteProtectionSupport { get; }
```
## See Also
* class [Characteristics](../DmiProperty.Processor.Characteristics.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemEventLog/LogAreaLength.md
# DmiProperty.SystemEventLog.LogAreaLength property
Gets a value representing the key to retrieve the property value.
The length, in bytes, of the overall event log area
Key Composition
* Structure: SystemEventLog
* Property: LogAreaLength
* Unit: None
Return Value
Type: Int32
```csharp
public static IPropertyKey LogAreaLength { get; }
```
## See Also
* class [SystemEventLog](../DmiProperty.SystemEventLog.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.ManagementControllerHostInterface/InterfaceTypeSpecificData.md
# DmiProperty.ManagementControllerHostInterface.InterfaceTypeSpecificData property
Gets a value representing the key to retrieve the property value.
Management Controller Host Interface Data as specified by the Interface Type.
The format uses the 'Enterprise Number' that is assigned and maintained by IANA (www.iana.org) as the means of identifying a particular vendor, company, or organization.
Key Composition
* Structure: ManagementControllerHostInterface
* Property: InterfaceTypeSpecificData
* Unit: None
Return Value
Type: ReadOnlyCollection where T is Byte
```csharp
public static IPropertyKey InterfaceTypeSpecificData { get; }
```
## See Also
* class [ManagementControllerHostInterface](../DmiProperty.ManagementControllerHostInterface.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiGroupAssociationElementCollection/DmiGroupAssociationElementCollection.md
# DmiGroupAssociationElementCollection constructor
Initialize a new instance of the class [`DmiGroupAssociationElementCollection`](../DmiGroupAssociationElementCollection.md).
```csharp
public DmiGroupAssociationElementCollection(GroupAssociationElementCollection elements)
```
| parameter | description |
| --- | --- |
| elements | Item list. |
## See Also
* class [DmiGroupAssociationElementCollection](../DmiGroupAssociationElementCollection.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Specific/SupportedEventLogTypeDescriptorElement.cs
namespace iTin.Hardware.Specification.Smbios;
// •—————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Log Type BYTE ENUM Event Log types |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Variable Data Format Type BYTE ENUM Event Log Variable Data Format Type |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// This class represents an element of the structure <see cref="SmbiosType015"/>.
/// </summary>
public class SupportedEventLogTypeDescriptorElement
{
#region constructor/s
/// <summary>
/// Initialize a new instance of the class <see cref="SupportedEventLogTypeDescriptorElement"/> specifying the structure information.
/// </summary>
/// <param name="data">Untreated information of the current structure.</param>
internal SupportedEventLogTypeDescriptorElement(byte[] data)
{
DescriptorFormat = GetEventLogDescriptorType(data[0x00]);
DescriptorType = GetEventLogDescriptorFormat(data[0x01]);
}
#endregion
#region public readonly properties
/// <summary>
/// Gets a value that represents the Descriptor Format.
/// </summary>
/// <value>
/// Descriptor Format.
/// </value>
public string DescriptorFormat { get; }
/// <summary>
/// Gets a value that represents the Descriptor Type.
/// </summary>
/// <value>
/// Descriptor Type.
/// </value>
public string DescriptorType { get; }
#endregion
#region public override methods
/// <summary>
/// Returns a class <see cref="string"/> that represents the current instance.
/// </summary>
/// <returns>
/// Object <see cref="string"/> that represents the current <see cref="AdditionalInformationEntry"/> class.
/// </returns>
public override string ToString() => $"Type = \"{DescriptorType}\"";
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
private static string GetEventLogDescriptorFormat(byte code)
{
string[] formats =
{
"None", // 0x00
"Handle",
"Multiple-event",
"Multiple-event handle",
"POST results bitmap",
"System management",
"Multiple-event system management" // 0x06
};
if (code <= 0x06)
{
return formats[code];
}
if (code >= 0x80)
{
return "OEM-specific";
}
return SmbiosHelper.OutOfSpec;
}
private static string GetEventLogDescriptorType(byte code)
{
string[] descriptorTypes =
{
SmbiosHelper.Reserved, // 0x00
"Single-bit ECC memory error",
"Multi-bit ECC memory error",
"Parity memory error",
"Bus timeout",
"I/O channel block",
"Software NMI",
"POST memory resize",
"POST error",
"PCI parity error",
"PCI system error",
"CPU failure",
"EISA failsafe timer timeout",
"Correctable memory log disabled",
"Logging disabled",
SmbiosHelper.Reserved,
"System limit exceeded",
"Asynchronous hardware timer expired",
"System configuration information",
"Hard disk information",
"System reconfigured",
"Uncorrectable CPU-complex error",
"Log area reset/cleared",
"System boot" // 0x17
};
if (code <= 0x17)
{
return descriptorTypes[code];
}
if (code >= 0x80 && code <= 0xfe)
{
return "OEM-specific";
}
if (code == 0xff)
{
return "End of log";
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiSupportedEventLogTypeDescriptorElement.md
# DmiSupportedEventLogTypeDescriptorElement class
This class represents an element of the structure.
```csharp
public class DmiSupportedEventLogTypeDescriptorElement
```
## Public Members
| name | description |
| --- | --- |
| [DescriptorFormat](DmiSupportedEventLogTypeDescriptorElement/DescriptorFormat.md) { get; } | Gets a value that represents the Descriptor Format. |
| [DescriptorType](DmiSupportedEventLogTypeDescriptorElement/DescriptorType.md) { get; } | Gets a value that represents the Descriptor Type. |
| override [ToString](DmiSupportedEventLogTypeDescriptorElement/ToString.md)() | Returns a class String that represents the current instance. |
## See Also
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI.cs
using System;
using System.Diagnostics;
using iTin.Hardware.Abstractions.Specification.Smbios.ComponentModel;
using iTin.Hardware.Specification.Dmi;
namespace iTin.Hardware.Specification;
/// <summary>
/// The Desktop Management Interface (DMI) or the desktop management interface, standard framework for management and<br/>
/// component tracking on a desktop, laptop or server.
/// </summary>
public sealed class DMI
{
#region private readonly members
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly DmiConnectOptions _options;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly SMBIOS _smbios;
#endregion
#region private members
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private DmiStructureCollection _dmiStructureCollection;
#endregion
#region constructor/s
/// <summary>
/// Prevents a default instance of the <see cref="DMI"/> class from being created.
/// </summary>
private DMI() : this(null)
{
}
/// <summary>
/// Prevents a default instance of the <see cref="DMI"/> class from being created.
/// </summary>
private DMI(DmiConnectOptions options)
{
_options = options;
_smbios = _options == null
? SMBIOS.CreateInstance()
: SMBIOS.CreateInstance(new SmbiosConnectOptions
{
UserName = options.UserName,
Password = options.Password,
MachineNameOrIpAddress = options.MachineNameOrIpAddress
});
}
#endregion
#region public static readonly properties
/// <summary>
/// Gets a <see cref="string"/> that represents the type of access.
/// </summary>
/// <value>
/// A string that represents the type of access.
/// </value>
/// <remarks>
/// This method always returns the <b>System BIOS</b> string.
/// </remarks>
public static string AccessType => "System BIOS";
/// <summary>
/// Gets a <see cref="string"/> that represents access mode.
/// </summary>
/// <value>
/// A <see cref="string"/> that represents the mode of access.
/// </value>
/// <remarks>
/// This method always returns the <b><DMI></b> string.
/// </remarks>
public static string Identificationmethod => "<DMI>";
/// <summary>
/// Gets a instance of this class.
/// </summary>
/// <value>
/// A <see cref="DMI"/> reference that contains <b>DMI</b> information.
/// </value>
[Obsolete("please use the DMI.CreateInstance() method instead of DMI.Instance for local DMI instance. For remote instance use DMI.CreateInstance(DmiConnectOptions)")]
public static DMI Instance => new();
#endregion
#region public readonly properties
/// <summary>
/// Gets the <b>SMBIOS</b> version.
/// </summary>
/// <value>
/// The <b>SMBIOS</b> version.
/// </value>
public string SmbiosVersion => _smbios.Version.ToString("X");
/// <summary>
/// Gets the collection of available structures.
/// </summary>
/// <value>
/// Object <see cref="DmiStructureCollection"/> that contains the collection of available <see cref="DmiStructure"/> objects.
/// If there is no object <see cref="DmiStructure"/>, <b>null</b> is returned.
/// </value>
public DmiStructureCollection Structures => _dmiStructureCollection ??= new DmiStructureCollection(_smbios);
#endregion
#region public static methods
/// <summary>
/// Gets an instance of this class for remote machine.<br/>
/// If <paramref name="options"/> is <b>null</b> (<b>Nothing</b> in Visual Basic) always returns an instance for this machine.
/// </summary>
/// <value>
/// A <see cref="DMI"/> reference that contains <b>DMI</b> information.
/// </value>
public static DMI CreateInstance(DmiConnectOptions options = null) => options == null ? new DMI() : new DMI(options);
#endregion
#region public overrides methods
/// <summary>
/// Returns a <see cref="string"/> that represents this instance.
/// </summary>
/// <returns>
/// A <see cref="string"/> that represents this instance.
/// </returns>
/// <remarks>
/// The <see cref="ToString()"/> method returns a string that includes the version expresed in hexadecimal format,
/// the number of available structures, and <see cref="SMBIOS"/> total size occupied by all structures.
/// </remarks>
public override string ToString() =>
_options == null
? $"SMBIOS={SmbiosVersion}, Classes={_smbios.ImplementedStructures.Count}, Size={_smbios.Lenght}"
: _smbios.ToString();
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Processor/ThreadCount.md
# DmiProperty.Processor.ThreadCount property
Gets a value representing the key to retrieve the property value.
Number of threads per processor socket. If the value is unknown, the field is set to 0. For thread counts of 256 or greater, this property returns FFh and the ThreadCount2 property is set to the number of threads.
Key Composition
* Structure: Processor
* Property: ThreadCount
* Unit: None
Return Value
Type: UInt16
Remarks
2.5+
```csharp
public static IPropertyKey ThreadCount { get; }
```
## See Also
* class [Processor](../DmiProperty.Processor.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType034 [Management Device].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Management Device (Type 34) structure.<br/>
/// For more information, please see <see cref="SmbiosType034"/>.
/// </summary>
internal sealed class DmiType034 : DmiBaseType<SmbiosType034>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType034"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType034(SmbiosType034 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion < DmiStructureVersion.Latest)
{
return;
}
properties.Add(DmiProperty.ManagementDevice.Description, SmbiosStructure.GetPropertyValue(SmbiosProperty.ManagementDevice.Description));
properties.Add(DmiProperty.ManagementDevice.Type, SmbiosStructure.GetPropertyValue(SmbiosProperty.ManagementDevice.Type));
properties.Add(DmiProperty.ManagementDevice.Address, SmbiosStructure.GetPropertyValue(SmbiosProperty.ManagementDevice.Address));
properties.Add(DmiProperty.ManagementDevice.AddressType, SmbiosStructure.GetPropertyValue(SmbiosProperty.ManagementDevice.AddressType));
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDeviceMappedAddress/MemoryDeviceHandle.md
# DmiProperty.MemoryDeviceMappedAddress.MemoryDeviceHandle property
Gets a value representing the key to retrieve the property value.
Handle, or instance number, associated with the memory device structure to which this address range is mapped multiple address ranges can be mapped to a single memory device.
Key Composition
* Structure: MemoryDeviceMappedAddress
* Property: MemoryDeviceHandle
* Unit: None
Return Value
Type: UInt16
Remarks
2.1+
```csharp
public static IPropertyKey MemoryDeviceHandle { get; }
```
## See Also
* class [MemoryDeviceMappedAddress](../DmiProperty.MemoryDeviceMappedAddress.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType039 [System Power Supply].cs
using System.Diagnostics;
using iTin.Core;
using iTin.Core.Helpers.Enumerations;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 039: System Power Supply.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 39 Power Supply Structure indicator. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE Length of the structure, a minimum of 10h. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies The handle, or instance number, associated with the |
// | structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Power BYTE Varies Identifies the power unit group to which this power |
// | Unit Group supply is associated. |
// | Specifying the same Power Unit Group value for more |
// | than one System Power Supply structure indicates a |
// | redundant power supply configuration. |
// | The field’s value is 00h if the power supply is not a |
// | member of a redundant power unit. |
// | Non-zero values imply redundancy and that at least one|
// | other power supply will be enumerated with the same |
// | value. |
// | Note: See IsRedundant |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Location BYTE STRING The number of the string that identifies the location |
// | Channel of the power supply. |
// | Load |
// | EXAMPLES: “in the back, on the left-hand side” or |
// | “Left Supply Bay” |
// | Note: See Location |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h Device Name BYTE STRING The number of the string that names the power supply |
// | |
// | EXAMPLES: “DR-36” |
// | Note: See DeviceName |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h Manufacturer BYTE STRING The number of the string that names the company that |
// | manufactured the supply. |
// | Note: See Manufacturer |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h Serial Number BYTE STRING The number of the string that contains the serial |
// | number for the power supply. |
// | Note: See SerialNumber |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 09h Asset Tag BYTE STRING The number of the string that contains the Asset Tag |
// | Number Number. |
// | Note: See AssetTagNumber |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ah Model Part BYTE STRING The number of the string that contains the OEM Part |
// | Number Order Number. |
// | Note: See ModelPartNumber |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Bh Revision BYTE STRING Power supply Revision String. |
// | Level EXAMPLE: “2.30” |
// | Note: See RevisionLevel |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ch Max Power WORD Varies Maximum sustained power output in Watts. |
// | Capacity Set to 0x8000 if unknown. |
// | Note that the units specified by the DMTF for this |
// | field are milliWatts. |
// | Note: See MaxPowerCapacity |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Eh Power Supply WORD Varies Bits 15:14 - Reserved, set to 00b. |
// | Characteristics |
// | Bits 13:10 - DMTF Power Supply Type. |
// | 0001b - Other |
// | 0010b - Unknown |
// | 0011b - Linear |
// | 0100b - Switching |
// | 0101b - Battery |
// | 0110b - UPS |
// | 0111b - Converter |
// | 1000b - Regulator |
// | 1001b to 1111b — Reserved for future |
// | assignment. |
// | Note: See GetSupplyType(byte) |
// | |
// | Bits 09:07 - Status. |
// | 001b - Other |
// | 010b - Unknown |
// | 011b - OK |
// | 100b - Non-critical |
// | 101b - Critical; power supply has failed |
// | and has been taken off-line. |
// | Note: See GetStatus(byte) |
// | |
// | Bits 06:03 - DMTF Input Voltage Range Switching. |
// | 0001b - Other |
// | 0010b - Unknown |
// | 0011b - Manual |
// | 0100b - Auto-switch |
// | 0101b - Wide range |
// | 0110b - Not applicable |
// | 0111b to 1111b — Reserved for future |
// | assignment. |
// | Note: See InputVoltageRange(byte) |
// | |
// | Bit 02 - Power supply is unplugged from the wall, |
// | if 1. |
// | Note: See IsPlugged |
// | |
// | Bit 01 - Power supply is present, if 1. |
// | Note: See Ispresent |
// | |
// | Bit 00 - Power supply is hot replaceable, if 1. |
// | Note: See IsReplaceable |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 10h Input Voltage WORD Varies The handle, or instance number, of a Voltage Probe |
// | Probe Handle (Type 26) monitoring this power supply’s input |
// | voltage. |
// | A value of 0xFFFF indicates that no probe is provided.|
// | Note: See InputVoltageProbeHandle |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 12h Cooling Device WORD Varies The handle, or instance number, of a Cooling Device |
// | Handle (Type 27) associated with this power supply. |
// | A value of 0xFFFF indicates that no probe is provided.|
// | Note: See CoolingDeviceHandle |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 14h Input Current WORD Varies The handle, or instance number, of the Electrical |
// | Probe Handle Current Probe (Type 29) monitoring this power supply’s|
// | input current. |
// | A value of 0xFFFF indicates that no probe is provided.|
// | Note: See InputCurrentProbeHandle |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the System Power Supply (Type 39) structure.
/// </summary>
internal sealed class SmbiosType039 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType039"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType039(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Is Redundant</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool IsRedundant => Reader.GetByte(0x04) != 0x00;
/// <summary>
/// Gets a value representing the <b>Location</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Location => GetString(0x05);
/// <summary>
/// Gets a value representing the <b>Device Name</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string DeviceName => GetString(0x06);
/// <summary>
/// Gets a value representing the <b>Manufacturer</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Manufacturer => GetString(0x07);
/// <summary>
/// Gets a value representing the <b>Serial Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string SerialNumber => GetString(0x08);
/// <summary>
/// Gets a value representing the <b>Asset Tag Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string AssetTagNumber => GetString(0x09);
/// <summary>
/// Gets a value representing the <b>Model Part Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string ModelPartNumber => GetString(0x0a);
/// <summary>
/// Gets a value representing the <b>Revision Level</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string RevisionLevel => GetString(0x0b);
/// <summary>
/// Gets a value representing the <b>Max Power Capacity</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort MaxPowerCapacity => (ushort)Reader.GetWord(0x0c);
/// <summary>
/// Gets a value representing the <b>Characteristics</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort Characteristics => (ushort)Reader.GetWord(0x0e);
/// <summary>
/// Gets a value representing the <b>Is Hot Replaceable</b> feature of the <b>Characteristics</b> field
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool IsHotReplaceable => Characteristics.CheckBit(Bits.Bit00);
/// <summary>
/// Gets a value representing the <b>Is Present</b> feature of the <b>Characteristics</b> field
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool IsPresent => Characteristics.CheckBit(Bits.Bit01);
/// <summary>
/// Gets a value representing the <b>Is Plugged</b> feature of the <b>Characteristics</b> field
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private bool IsPlugged => !Characteristics.CheckBit(Bits.Bit02);
/// <summary>
/// Gets a value representing the <b>Input Voltage Range</b> feature of the <b>Characteristics</b> field
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte InputVoltageRange => (byte) ((Characteristics >> 0x03) & 0x0007);
/// <summary>
/// Gets a value representing the <b>Status</b> feature of the <b>Characteristics</b> field
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Status => (byte) ((Characteristics >> 0x07) & 0x0007);
/// <summary>
/// Gets a value representing the <b>Supply Type</b> feature of the <b>Characteristics</b> field
/// </summary>
/// <value>
/// Feature value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte SupplyType => (byte) ((Characteristics >> 0x0a) & 0x000f);
/// <summary>
/// Gets a value representing the <b>Input Voltage Probe Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort InputVoltageProbeHandle => (ushort)Reader.GetWord(0x10);
/// <summary>
/// Gets a value representing the <b>Cooling Device Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort CoolingDeviceHandle => (ushort)Reader.GetWord(0x12);
/// <summary>
/// Gets a value representing the <b>Input Current Probe Handle</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort InputCurrentProbeHandle => (ushort)Reader.GetWord(0x14);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
properties.Add(SmbiosProperty.SystemPowerSupply.IsRedundant, IsRedundant);
properties.Add(SmbiosProperty.SystemPowerSupply.Location, Location);
properties.Add(SmbiosProperty.SystemPowerSupply.DeviceName, DeviceName);
properties.Add(SmbiosProperty.SystemPowerSupply.Manufacturer, Manufacturer);
properties.Add(SmbiosProperty.SystemPowerSupply.SerialNumber, SerialNumber);
properties.Add(SmbiosProperty.SystemPowerSupply.AssetTagNumber, AssetTagNumber);
properties.Add(SmbiosProperty.SystemPowerSupply.ModelPartNumber, ModelPartNumber);
properties.Add(SmbiosProperty.SystemPowerSupply.RevisionLevel, RevisionLevel);
properties.Add(SmbiosProperty.SystemPowerSupply.MaxPowerCapacity, MaxPowerCapacity);
properties.Add(SmbiosProperty.SystemPowerSupply.Characteristics.SupplyType, GetSupplyType(SupplyType));
properties.Add(SmbiosProperty.SystemPowerSupply.Characteristics.Status, GetStatus(Status));
properties.Add(SmbiosProperty.SystemPowerSupply.Characteristics.InputVoltageRange, GetInputVoltageRange(InputVoltageRange));
properties.Add(SmbiosProperty.SystemPowerSupply.Characteristics.IsPlugged, IsPlugged);
properties.Add(SmbiosProperty.SystemPowerSupply.Characteristics.IsPresent, IsPresent);
properties.Add(SmbiosProperty.SystemPowerSupply.Characteristics.IsHotReplaceable, IsHotReplaceable);
if (StructureInfo.Length >= 0x11)
{
properties.Add(SmbiosProperty.SystemPowerSupply.InputVoltageProbeHandle, InputVoltageProbeHandle);
}
if (StructureInfo.Length >= 0x13)
{
properties.Add(SmbiosProperty.SystemPowerSupply.CoolingDeviceHandle, CoolingDeviceHandle);
}
if (StructureInfo.Length >= 0x15)
{
properties.Add(SmbiosProperty.SystemPowerSupply.InputCurrentProbeHandle, InputCurrentProbeHandle);
}
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets a string representing the mode of use of the power supply.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The mode of use of the power supply.
/// </returns>
private static string GetInputVoltageRange(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"Manual",
"Auto-switch",
"Wide range",
"Not applicable" // 0x06
};
if (code >= 0x01 && code <= 0x06)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string representing the state of the power supply.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The state of the power supply.
/// </returns>
private static string GetStatus(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"OK",
"Non-critical",
"Critical, power supply has failed and has been taken off-line" // 0x05
};
if (code >= 0x01 && code <= 0x05)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets a string representing the type of power supply.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The type of power supply.
/// </returns>
private static string GetSupplyType(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"Linear",
"Switching",
"Battery",
"UPS",
"Converter",
"Regulator" // 0x08
};
if (code >= 0x01 && code <= 0x08)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.TpmDevice.md
# DmiProperty.TpmDevice class
Contains the key definitions available for a type 043 [TpmDevice] structure.
```csharp
public static class TpmDevice
```
## Public Members
| name | description |
| --- | --- |
| static [Characteristics](DmiProperty.TpmDevice/Characteristics.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Description](DmiProperty.TpmDevice/Description.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [FirmwareVersion](DmiProperty.TpmDevice/FirmwareVersion.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MajorSpecVersion](DmiProperty.TpmDevice/MajorSpecVersion.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MinorSpecVersion](DmiProperty.TpmDevice/MinorSpecVersion.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [OemDefined](DmiProperty.TpmDevice/OemDefined.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [VendorId](DmiProperty.TpmDevice/VendorId.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [VendorIdDescription](DmiProperty.TpmDevice/VendorIdDescription.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryModule/CurrentSpeed.md
# DmiProperty.MemoryModule.CurrentSpeed property
Gets a value representing the key to retrieve the property value.
Speed of the memory module, in ns.
Key Composition
* Structure: MemoryModule
* Property: CurrentSpeed
* Unit: ns
Return Value
Type: Nullable where T is Byte
```csharp
public static IPropertyKey CurrentSpeed { get; }
```
## See Also
* class [MemoryModule](../DmiProperty.MemoryModule.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.TpmDevice/VendorIdDescription.md
# DmiProperty.TpmDevice.VendorIdDescription property
Gets a value representing the key to retrieve the property value.
Vendor Id description.
Key Composition
* Structure: TpmDevice
* Property: VendorIdDescription
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey VendorIdDescription { get; }
```
## See Also
* class [TpmDevice](../DmiProperty.TpmDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/SpecificDmiBaseType/GetDoubleWord.md
# SpecificDmiBaseType.GetDoubleWord method
Returns the stored value from the specified byte.
```csharp
protected int GetDoubleWord(byte start)
```
| parameter | description |
| --- | --- |
| start | start byte |
## Return Value
The value stored in the indicated byte.
## See Also
* class [SpecificDmiBaseType](../SpecificDmiBaseType.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.PhysicalMemoryArray/NumberOfMemoryDevices.md
# DmiProperty.PhysicalMemoryArray.NumberOfMemoryDevices property
Gets a value representing the key to retrieve the property value.
Number of slots or sockets available for Memory devices in this array.
Key Composition
* Structure: PhysicalMemoryArray
* Property: NumberOfMemoryDevices
* Unit: None
Return Value
Type: UInt16
Remarks
2.1+
```csharp
public static IPropertyKey NumberOfMemoryDevices { get; }
```
## See Also
* class [PhysicalMemoryArray](../DmiProperty.PhysicalMemoryArray.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType037 [Memory Channel].cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using iTin.Core;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 037: Memory Channel.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 37 Management Device Threshold Data structure indicator. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE 7 + 3 * (Memory Device Count) |
// | |
// | NOTE: To allow future structure growth by appending |
// | information after the Load/Handle list, this |
// | field must not be used to determine the number |
// | of memory devices specified within the |
// | structure. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies The handle, or instance number, associated with the |
// | structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Channel BYTE Varies Identifies the type of memory associated with the |
// | Type channel. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Maximum BYTE Varies The maximum load supported by the channel; the sum of |
// | Channel all device loads cannot exceed this value. |
// | Load |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h Memory BYTE Varies The channel load provided by the first Memory Device |
// | Device associated with this channel. |
// | Count (n) This value also defines the number of Load/Handle |
// | pairs that follow. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h Memory BYTE Varies The channel load provided by the first Memory Device |
// | Device 1 associated with this channel. |
// | Load |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h Memory WORD Varies The structure handle that identifies the first Memory |
// | Device 1 Device associated with this channel. |
// | Handle |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 7 + Memory BYTE Varies The channel load provided by the nth Memory Device |
// | 3*(n-1) Device (n) associated with this channel. |
// | Load |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 8 + Memory WORD Varies The structure handle that identifies the nth Memory |
// | 3*(n-1) Device (n) Device associated with this channel. |
// | Handle |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Memory Channel (Type 37) structure.
/// </summary>
internal sealed class SmbiosType037 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType037"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType037(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Channel Type</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ChannelType => Reader.GetByte(0x04);
/// <summary>
/// Gets a value representing the <b>Maximun Channel Load</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte MaximunChannelLoad => Reader.GetByte(0x05);
/// <summary>
/// Gets a value representing the <b>Count</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Count => Reader.GetByte(0x06);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.Latest)
{
return;
}
properties.Add(SmbiosProperty.MemoryChannel.ChannelType, GetChannelType(ChannelType));
properties.Add(SmbiosProperty.MemoryChannel.MaximumChannelLoad, MaximunChannelLoad);
byte n = Count;
if (n == 0x00)
{
return;
}
if (StructureInfo.Length >= 0x08)
{
byte[] containedElementsArray = StructureInfo.RawData.Extract(0x07, n * 3).ToArray();
IEnumerable<MemoryChannelElement> containedElements = GetContainedElements(containedElementsArray, n);
properties.Add(SmbiosProperty.MemoryChannel.Devices, new MemoryChannelElementCollection(containedElements));
}
}
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets a string representing the channel type
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// Channel type.
/// </returns>
private static string GetChannelType(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"RamBus",
"SyncLink" // 0x04
};
if (code >= 0x01 && code <= 0x04)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
/// <summary>
/// Gets the list of devices.
/// </summary>
/// <param name="rawValueArray">Raw information.</param>
/// <param name="n">Number of items to be treated.</param>
/// <returns>
/// Item collection.
/// </returns>
private static IEnumerable<MemoryChannelElement> GetContainedElements(byte[] rawValueArray, byte n)
{
int m = rawValueArray.Length / n;
Collection<MemoryChannelElement> containedElements = new Collection<MemoryChannelElement>();
for (int i = 0; i < rawValueArray.Length; i += m)
{
byte[] value = new byte[m];
Array.Copy(rawValueArray, i, value, 0, m);
containedElements.Add(new MemoryChannelElement(value));
}
return containedElements;
}
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType022 [Portable Battery].cs
using System;
using System.Diagnostics;
using System.Globalization;
using iTin.Core;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 022: Portable Battery.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 2.1+ Type BYTE 22 Portable Battery |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h 2.1+ Length BYTE 1Ah Length of the structure. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 2.1+ Handle WORD Varies The handle, or instance number, associated|
// | with the structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 2.1+ Location BYTE STRING The number of the string that identifies |
// | the location of the battery. |
// | EXAMPLE: “in the back, on the left-hand |
// | side” |
// | Note: Ver Location |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h 2.1+ Manufacturer BYTE STRING The number of the string that names the |
// | company that manufactured the battery. |
// | Note: Ver Manufacturer |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h 2.1+ Manufacture BYTE STRING The number of the string that identifies |
// | Date the date on which the battery was |
// | manufactured. |
// | Version 2.2+ implementations that use a |
// | Smart Battery set this field to 0 |
// | (no string) to indicate that the SBDS |
// | Manufacture Date field contains the |
// | information. |
// | Note: Ver ManufactureDate |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 07h 2.1+ Serial Number BYTE STRING The number of the string that contains the|
// | serial number for the battery. |
// | Version 2.2+ implementations that use a |
// | Smart Battery set this field to 0 |
// | (no string) to indicate that the |
// | SBDS Serial Number field contains the |
// | information |
// | Note: Ver SerialNumber |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h 2.1+ Device Name BYTE STRING The number of the string that names the |
// | battery device. |
// | EXAMPLE: “DR-36” |
// | Note: Ver DeviceName |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 09h 2.1+ Device BYTE ENUM Identifies the battery chemistry. |
// | Chemistry Version 2.2+ implementations that use a |
// | Smart Battery set this field to 02h |
// | (Unknown) to indicate that the SBDS Device|
// | Chemistry field contains the information. |
// | Note: Ver GetDeviceChemistry(byte) |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ah 2.1+ Design WORD Varies The design capacity of the battery in |
// | Capacity mWatt-hours. |
// | If the value is unknown, the field |
// | contains 0. |
// | For version 2.2+ implementations, this |
// | value is multiplied by the Design |
// | Capacity Multiplier to produce the actual |
// | value. |
// | Note: Ver DesignCapacity |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ch 2.1+ Design Voltage WORD Varies The design voltage of the battery in |
// | mVolts. |
// | If the value is unknown, the field |
// | contains 0. |
// | Note: Ver DesignVoltage |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Eh 2.1+ SBDS Version BYTE STRING The number of the string that contains the|
// | Number Smart Battery Data Specification version |
// | number supported by this battery. |
// | If the battery does not support the |
// | function, no string is supplied. |
// | Note: Ver SBDSVersionNumber |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Fh 2.1+ Maximum Error BYTE Varies The maximum error (as a percentage in the |
// | in Battery Data range 0 to 100) in the Watt-hour data |
// | reported by the battery, indicating an |
// | upper bound on how much additional energy |
// | the battery might have above the energy it|
// | reports having. |
// | If the value is unknown, the field |
// | contains FFh. |
// | Note: Ver MaximumErrorInBatteryData |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 10h 2.2+ SBDS Serial WORD Varies The 16-bit value that identifies the |
// | Number battery’s serial number. |
// | This value, when combined with the |
// | Manufacturer, Device Name, and Manufacture|
// | Date uniquely identifies the battery. |
// | The Serial Number field must be set to 0 |
// | (no string) for this field to be valid. |
// | Note: Ver SBDSSerialNumber |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 12h 2.2+ SBDS WORD Varies The date the cell pack was manufactured, |
// | Manufacture in packed format: |
// | Date |
// | Bits 15:09 - Year, biased by 1980, in the |
// | range 0 to 127 |
// | Bits 08:05 - Month, in the range 1 to 12. |
// | Bits 04:00 - Date, in the range 1 to 31. |
// | |
// | EXAMPLE: 01 February 2000 would be |
// | identified as: |
// | 0010 1000 0100 0001b (0x2841)|
// | |
// | The Manufacture Date field must be set to |
// | 0 (no string) for this field to be valid. |
// | Note: Ver SBDSManufactureDate |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 14h 2.2+ SBDS Device BYTE STRING The number of the string that identifies |
// | Chemistry the battery chemistry (for example, |
// | “PbAc”). |
// | The Device Chemistry field must be set to |
// | 02h (Unknown) for this field to be valid. |
// | Note: Ver SBDSDeviceChemistry |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 15h 2.2+ Design BYTE Varies The multiplication factor of the Design |
// | Capacity Capacity value, which assures that the |
// | Multiplier mWatt hours value does not overflow for |
// | SBDS implementations. |
// | The multiplier default is 1, SBDS |
// | implementations use the value 10 to |
// | correspond to the data as returned from |
// | the SBDS Function 18h. |
// | Note: Ver DesignCapacityMultiplier |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 15h 2.2+ OEM-specific DWORD Varies Contains OEM- or BIOS vendor-specific |
// | information. |
// | Note: Ver OemSpecific |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Portable Battery (Type 22) structure.
/// </summary>
internal sealed class SmbiosType022 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType022"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType022(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
#region Version 2.1+ fields
/// <summary>
/// Gets a value representing the <b>Location</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Location => GetString(0x04);
/// <summary>
/// Gets a value representing the <b>Manufacturer</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string Manufacturer => GetString(0x05);
/// <summary>
/// Gets a value representing the <b>Manufacturer Date</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string ManufactureDate
{
get
{
byte rawManufactureDate = Reader.GetByte(0x06);
if (rawManufactureDate == 0x00)
{
return string.Empty;
}
return GetString(rawManufactureDate);
}
}
/// <summary>
/// Gets a value representing the <b>Serial Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string SerialNumber
{
get
{
byte rawSerialNumber = Reader.GetByte(0x07);
if (rawSerialNumber == 0x00)
{
return string.Empty;
}
return GetString(rawSerialNumber);
}
}
/// <summary>
/// Gets a value representing the <b>Device Name</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string DeviceName => GetString(0x08);
/// <summary>
/// Gets a value representing the <b>Device Chemistry Value</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte DeviceChemistryValue => Reader.GetByte(0x09);
/// <summary>
/// Gets a value representing the <b>Design Capacity</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort DesignCapacity => (ushort) Reader.GetWord(0x0a);
/// <summary>
/// Gets a value representing the <b>Design Voltage</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort DesignVoltage => (ushort)Reader.GetWord(0x0c);
/// <summary>
/// Gets a value representing the <b>Sbds Version Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string SbdsVersionNumber => GetString(0x0e);
/// <summary>
/// Gets a value representing the <b>Maximum Error In Battery Data</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte MaximumErrorInBatteryData => Reader.GetByte(0x0f);
#endregion
#region Version 2.2+ fields
/// <summary>
/// Gets a value representing the <b>Sbds Serial Number</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string SbdsSerialNumber => Reader.GetWord(0x10).ToString(CultureInfo.InvariantCulture);
/// <summary>
/// Gets a value representing the <b>Sbds Manufacture Date</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string SbdsManufactureDate => UnpacketBatteryDate((ushort)Reader.GetWord(0x12));
/// <summary>
/// Gets a value representing the <b>Sbds Device Chemistry</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string SbdsDeviceChemistry => GetString(0x14);
/// <summary>
/// Gets a value representing the <b>Design Capacity Multiplier</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte DesignCapacityMultiplier => Reader.GetByte(0x15);
/// <summary>
/// Gets a value representing the <b>Oem Specific</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private uint OemSpecific => (uint)Reader.GetDoubleWord(0x16);
#endregion
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v21)
{
properties.Add(SmbiosProperty.PortableBattery.Location, Location);
properties.Add(SmbiosProperty.PortableBattery.Manufacturer, Manufacturer);
properties.Add(SmbiosProperty.PortableBattery.DeviceName, DeviceName);
properties.Add(SmbiosProperty.PortableBattery.DesignVoltage, DesignVoltage);
properties.Add(SmbiosProperty.PortableBattery.SBDSVersionNumber, SbdsVersionNumber);
properties.Add(SmbiosProperty.PortableBattery.MaximunErrorInBatteryData, MaximumErrorInBatteryData);
if (string.IsNullOrEmpty(ManufactureDate))
{
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v22)
{
properties.Add(SmbiosProperty.PortableBattery.ManufactureDate, SbdsManufactureDate);
}
}
else
{
properties.Add(SmbiosProperty.PortableBattery.ManufactureDate, ManufactureDate);
}
if (string.IsNullOrEmpty(SerialNumber))
{
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v22)
{
properties.Add(SmbiosProperty.PortableBattery.SerialNumber, SbdsSerialNumber);
}
}
else
{
properties.Add(SmbiosProperty.PortableBattery.SerialNumber, SerialNumber);
}
if (DeviceChemistryValue == 0x02)
{
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v22)
{
properties.Add(SmbiosProperty.PortableBattery.DeviceChemistry, SbdsDeviceChemistry);
}
}
else
{
properties.Add(SmbiosProperty.PortableBattery.DeviceChemistry, GetDeviceChemistry(DeviceChemistryValue));
}
if (DesignCapacity != 00)
{
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v22)
{
int designCapacityCalculated = DesignCapacity * DesignCapacityMultiplier;
properties.Add(SmbiosProperty.PortableBattery.DesignCapacity, designCapacityCalculated);
properties.Add(SmbiosProperty.PortableBattery.DesignCapacityMultiplier, DesignCapacityMultiplier);
}
else
{
properties.Add(SmbiosProperty.PortableBattery.DesignCapacity, DesignCapacity);
}
}
}
if (StructureInfo.StructureVersion >= SmbiosStructureVersion.v22)
{
properties.Add(SmbiosProperty.PortableBattery.OemSpecific, OemSpecific);
}
}
#endregion
#region private static methods
/// <summary>
/// The unpacket battery date
/// </summary>
private static readonly Func<ushort, string> UnpacketBatteryDate = a => string.Concat(("00" + (a & 0x1F)).Right(2), "/", ("00" + (a >> 5 & 0x0F)).Right(2), "/", 0x07BC + (a >> 9));
#endregion
#region BIOS Specification 2.7.1 (26/01/2011)
/// <summary>
/// Gets a string representing the battery type.
/// </summary>
/// <param name="code">Value to analyze.</param>
/// <returns>
/// The battery type.
/// </returns>
private static string GetDeviceChemistry(byte code)
{
string[] value =
{
"Other", // 0x01
"Unknown",
"Lead Acid",
"Nickel Cadmium",
"Nickel metal hydride",
"Lithium-ion",
"Zinc air",
"Lithium Polymer" // 0x08
};
if (code >= 0x01 && code <= 0x08)
{
return value[code - 0x01];
}
return SmbiosHelper.OutOfSpec;
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiChassisContainedElement.md
# DmiChassisContainedElement class
This class represents an element of the structure DmiType003.
```csharp
public class DmiChassisContainedElement
```
## Public Members
| name | description |
| --- | --- |
| [Properties](DmiChassisContainedElement/Properties.md) { get; } | Gets the properties available for this structure. |
## See Also
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/SpecificDmiBaseType.md
# SpecificDmiBaseType class
The SmbiosBaseType class provides functions to analyze the properties associated with a structure [`DMI`](../iTin.Hardware.Specification/DMI.md).
```csharp
public abstract class SpecificDmiBaseType
```
## Public Members
| name | description |
| --- | --- |
| [ImplementedProperties](SpecificDmiBaseType/ImplementedProperties.md) { get; } | Returns a list of implemented properties for this smbios structure. |
| [Properties](SpecificDmiBaseType/Properties.md) { get; } | Gets the properties available for this structure. |
| [GetPropertyValue](SpecificDmiBaseType/GetPropertyValue.md)(…) | Returns the value of specified property. Always returns the first appearance of the property. If it does not exist, returns null (Nothing in visual basic). |
| [GetPropertyValue<T>](SpecificDmiBaseType/GetPropertyValue.md)(…) | Returns the the strongly typed value of specified property. Always returns the first appearance of the property. If it does not exist, returns null (Nothing in visual basic). |
## Protected Members
| name | description |
| --- | --- |
| [SpecificDmiBaseType](SpecificDmiBaseType/SpecificDmiBaseType.md)() | Initializes a new instance of the class [`SpecificDmiBaseType`](./SpecificDmiBaseType.md). |
| [SpecificDmiBaseType](SpecificDmiBaseType/SpecificDmiBaseType.md)(…) | Initializes a new instance of the class [`SpecificDmiBaseType`](./SpecificDmiBaseType.md) by specifying the raw data of a specific SMBIOS structure |
| [GetByte](SpecificDmiBaseType/GetByte.md)(…) | Returns the stored value from the specified byte. |
| [GetBytes](SpecificDmiBaseType/GetBytes.md)(…) | Returns the stored array from start with specified lenght. |
| [GetDoubleWord](SpecificDmiBaseType/GetDoubleWord.md)(…) | Returns the stored value from the specified byte. |
| [GetQuadrupleWord](SpecificDmiBaseType/GetQuadrupleWord.md)(…) | Returns the stored value from the specified byte. |
| [GetWord](SpecificDmiBaseType/GetWord.md)(…) | Returns the stored value from the specified byte. |
| [Parse](SpecificDmiBaseType/Parse.md)(…) | Parse and populates the property collection for this structure. |
| virtual [PopulateProperties](SpecificDmiBaseType/PopulateProperties.md)(…) | Populates the property collection for this structure. |
## See Also
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.GroupAssociations.Items/Handle.md
# DmiProperty.GroupAssociations.Items.Handle property
Gets a value representing the key to retrieve the property value.
Handle corresponding to a item collection.
Key Composition
* Structure: GroupAssociations
* Property: Handle
* Unit: None
Return Value
Type: UInt16
```csharp
public static IPropertyKey Handle { get; }
```
## See Also
* class [Items](../DmiProperty.GroupAssociations.Items.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/IDmiType.md
# IDmiType interface
The DmiBaseType class provides functions to analyze the properties associated with a structure [`DMI`](../iTin.Hardware.Specification/DMI.md).
```csharp
public interface IDmiType
```
## Members
| name | description |
| --- | --- |
| [ImplementedProperties](IDmiType/ImplementedProperties.md) { get; } | Returns a list of implemented properties for a structure |
| [ImplementedVersion](IDmiType/ImplementedVersion.md) { get; } | Returns a value that indicates the implemented version of a [`DMI`](../iTin.Hardware.Specification/DMI.md) structure. |
| [Properties](IDmiType/Properties.md) { get; } | Gets the properties available for this structure. |
| [GetProperty](IDmiType/GetProperty.md)(…) | Returns the value of specified property. Always returns the first appearance of the property. |
## See Also
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.System.md
# DmiProperty.System class
Contains the key definitions available for a type 001 [System Information] structure.
```csharp
public static class System
```
## Public Members
| name | description |
| --- | --- |
| static [Family](DmiProperty.System/Family.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Manufacturer](DmiProperty.System/Manufacturer.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ProductName](DmiProperty.System/ProductName.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SerialNumber](DmiProperty.System/SerialNumber.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SkuNumber](DmiProperty.System/SkuNumber.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [UUID](DmiProperty.System/UUID.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Version](DmiProperty.System/Version.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [WakeUpType](DmiProperty.System/WakeUpType.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiBaseType-1/ToString.md
# DmiBaseType<TSmbios>.ToString method
Returns a String that represents this instance.
```csharp
public override string ToString()
```
## Return Value
A String that represents this instance.
## See Also
* class [DmiBaseType<TSmbios>](../DmiBaseType-1.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemPowerSupply.md
# DmiProperty.SystemPowerSupply class
Contains the key definitions available for a type 039 [SystemPowerSupply Information] structure.
```csharp
public static class SystemPowerSupply
```
## Public Members
| name | description |
| --- | --- |
| static [AssetTagNumber](DmiProperty.SystemPowerSupply/AssetTagNumber.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [CoolingDeviceHandle](DmiProperty.SystemPowerSupply/CoolingDeviceHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [DeviceName](DmiProperty.SystemPowerSupply/DeviceName.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [InputCurrentProbeHandle](DmiProperty.SystemPowerSupply/InputCurrentProbeHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [InputVoltageProbeHandle](DmiProperty.SystemPowerSupply/InputVoltageProbeHandle.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [IsRedundant](DmiProperty.SystemPowerSupply/IsRedundant.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Location](DmiProperty.SystemPowerSupply/Location.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Manufacturer](DmiProperty.SystemPowerSupply/Manufacturer.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MaxPowerCapacity](DmiProperty.SystemPowerSupply/MaxPowerCapacity.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ModelPartNumber](DmiProperty.SystemPowerSupply/ModelPartNumber.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [RevisionLevel](DmiProperty.SystemPowerSupply/RevisionLevel.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [SerialNumber](DmiProperty.SystemPowerSupply/SerialNumber.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static class [Characteristics](DmiProperty.SystemPowerSupply.Characteristics.md) | Contains the key definition for the Characteristics section. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Specific/AdditionalInformationEntry.cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 040: Additional Information. Additional Information Entry
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Entry Length BYTE Varies Length of this Additional Information Entry instance; |
// | a minimum of 6 |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Referenced WORD Varies The handle, or instance number, associated with the |
// | Handle structure for which additional information is provided |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 03h Referenced BYTE Varies The offset of the field within the structure referenced |
// | Offset by the Referenced Handle for which additional |
// | information is provided |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h String BYTE STRING The number of the optional string to be associated with |
// | the field referenced by the Referenced Offset |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 05h Value Varies Varies The enumerated value or updated field content that has |
// | not yet been approved for publication in this |
// | specification and therefore could not be used in the |
// | field referenced by Referenced Offset. |
// | NOTE: This field is the same type and size as the field |
// | being referenced by this Additional Information |
// | Entry. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// This class represents an element of the structure <see cref="SmbiosType040"/>.
/// </summary>
public class AdditionalInformationEntry : SpecificSmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initialize a new instance of the <see cref="AdditionalInformationEntry"/> class specifying the structure information.
/// </summary>
/// <param name="additionalInformationEntryArray">Untreated information of the current structure.</param>
internal AdditionalInformationEntry(byte[] additionalInformationEntryArray) : base(additionalInformationEntryArray)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value that represents the <b>Entry Length</b> field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte EntryLength => GetByte(0x00);
/// <summary>
/// Gets a value that represents the '<b>Referenced Handle</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort ReferencedHandle => (ushort)GetWord(0x01);
/// <summary>
/// Gets a value that represents the '<b>Referenced Offset</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte ReferencedOffset => GetByte(0x03);
/// <summary>
/// Gets a value that represents the '<b>String</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string StringValue => string.Empty;
/// <summary>
/// Gets a value that represents the '<b>Value</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte Value => GetByte(0x05);
#endregion
#region public override methods
/// <summary>
/// Returns a class <see cref="string"/> that represents the current object.
/// </summary>
/// <returns>
/// Object <see cref="string"/> that represents the current <see cref="AdditionalInformationEntry"/> class.
/// </returns>
/// <remarks>
/// This method returns a string that includes the property <see cref="P:iTin.Hardware.Specification.Smbios.AdditionalInformationEntry.Value"/>.
/// </remarks>
public override string ToString() => $"Value = {Value}";
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
properties.Add(SmbiosProperty.AdditionalInformation.Entry.EntryLength, EntryLength);
properties.Add(SmbiosProperty.AdditionalInformation.Entry.ReferencedHandle, ReferencedHandle);
properties.Add(SmbiosProperty.AdditionalInformation.Entry.ReferencedOffset, ReferencedOffset);
properties.Add(SmbiosProperty.AdditionalInformation.Entry.StringValue, StringValue);
properties.Add(SmbiosProperty.AdditionalInformation.Entry.Value, Value);
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/Rank.md
# DmiProperty.MemoryDevice.Rank property
Gets a value representing the key to retrieve the property.
Rank.
Key Composition
* Structure: MemoryDevice
* Property: Rank
* Unit: None
Return Value
Type: Byte
Remarks
2.3+
```csharp
public static IPropertyKey Rank { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryChannel.md
# DmiProperty.MemoryChannel class
Contains the key definitions available for a type 037 [MemoryChannel] structure.
```csharp
public static class MemoryChannel
```
## Public Members
| name | description |
| --- | --- |
| static [ChannelType](DmiProperty.MemoryChannel/ChannelType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Devices](DmiProperty.MemoryChannel/Devices.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [MaximunChannelLoad](DmiProperty.MemoryChannel/MaximunChannelLoad.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static class [MemoryDevices](DmiProperty.MemoryChannel.MemoryDevices.md) | Contains the key definition for the Memory Devices section. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/Specific/LoongArchProcessorSpecificData.cs
using System;
using System.Diagnostics;
using iTin.Core;
using iTin.Core.Helpers.Enumerations;
namespace iTin.Hardware.Specification.Smbios;
// Type 044: Processor Specific Block > LoongArch Processor-specific Block Structure.
// For more information, please see: https://loongson.github.io/loongarch-smbios/LoongArch-Processor-SMBIOS-Spec-EN.html.
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Spec. |
// | Offset Version Name Length Value Description |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h 0100h Revision of RISC-V WORD 0100h Bit 15:08 Major revision |
// | (v1.0) Processor Specific (v1.00) Bit 07:00 Minor revision |
// | Block Specific Revision of LoongArch Processor-specific |
// | Block Structure. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h 0100h Block BYTE 28h Length of Processor-specific Data. |
// | (v1.0) Length (40d) |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 03h 0100h Reserved BYTE 00h Reserved. |
// | (v1.0) |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h 0100h Machine Vendor ID DQWORD Varies The manufacturer vendor ID of the |
// | (v1.0) processor. It is semantically equivalent |
// | to the value at the offset 0x10 of the |
// | IOCSR space on a Loongson CPU. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 14h 0100h CPU ID DQWORD Varies The CPU ID used for this LoongArch |
// | (v1.0) processor manufacturer to mark different |
// | CPU types or CPU instances. |
// | It is semantically equivalent to the |
// | value at the offset 0x20 of the IOCSR |
// | space on a Loongson CPU. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 24h 0100h ISA extensions DQWORD Bit-field The bit field [3:0] indicates support |
// | (v1.0) support for the existing LoongArch standard ISA |
// | extensions. It is modeled after the |
// | LoongArch EUEN register (CSR 0x2), and |
// | meaning of each bit is the same as |
// | defined for the EUEN (Extended Component |
// | Unit Enable) register. |
// | Setting a bit in this field indicates |
// | that this system supports the . |
// | corresponding ISA extension. |
// | Please see: |
// | https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#extended-component-unit-enable |
// | |
// | Bits Name Description |
// | ----- ---- ----------- |
// | 00 FPE The base floating-point instruction enable bit. |
// | When this bit is 0, execution of the base floating-point instruction as described in |
// | Overview of Floating-Point Instructions will trigger a floating-point instruction disable |
// | exception (FPD). |
// | |
// | 01 SXE The 128-bit vector expansion instruction enable bit. When this bit is 0, execution of the 128- |
// | bit vector expansion instruction as described in Volume 2 will trigger the 128-bit vector |
// | expansion instruction disable exception (SXD). |
// | |
// | 02 ASXE The 256-bit vector expansion instruction enables the control bit. When this bit is 0, execution |
// | of the 256-bit vector expansion instruction as described in Volume 2 will trigger the 256-bit |
// | vector expansion instruction disable exception (ASXD). |
// | |
// | 03 BTE Binary translation expansion instruction enable bit. |
// | When this bit is 0, execution of the binary translation expansion instruction described in |
// | Volume 2 will trigger the binary translation expansion instruction disable exception (BTD). |
// | |
// | 31:04 0 Reserved field. Return 0 if read this field, and software is not allowed to change its value. |
// •—————————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// This class represents a processor specific block of the structure <see cref="SmbiosType044"/>.
/// </summary>
public class LoongArchProcessorSpecificData : IProcessorSpecificData
{
#region private readonly memebrs
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly byte[] _data;
#endregion
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="RiskVProcessorSpecificData"/> class specifying the structure information.
/// </summary>
/// <param name="processorSpecificInformationBlockData">Untreated information of the current structure.</param>
internal LoongArchProcessorSpecificData(byte[] processorSpecificInformationBlockData)
{
_data = processorSpecificInformationBlockData;
}
/// <summary>
/// Initializes a new instance of the <see cref="RiskVProcessorSpecificData"/> class.
/// </summary>
private LoongArchProcessorSpecificData()
{
_data = Array.Empty<byte>();
}
#endregion
#region public static readonly properties
/// <summary>
/// Returns a new <see cref="LoongArchProcessorSpecificData"/> instance that indicates that it has not been implemented.
/// </summary>
/// <value>
/// A new <see cref="LoongArchProcessorSpecificData"/> instance.
/// </value>
public static LoongArchProcessorSpecificData NotImplemented => new();
#endregion
#region private properties
/// <summary>
/// Gets a value that represents the '<b>Revision</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int? Revision => _data.IsNullOrEmpty()
? null
: _data.GetWord(0x00);
/// <summary>
/// Gets a value that represents the '<b>Block Length</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte? BlockLength => _data.IsNullOrEmpty()
? null
: _data[0x02];
/// <summary>
/// Gets a value that represents the '<b>Reserved</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private byte? Reserved => _data.IsNullOrEmpty()
? null
: _data[0x03];
/// <summary>
/// Gets a value that represents the '<b>Machine Vendor Id</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private long? MachineVendorId => _data.IsNullOrEmpty()
? null
: _data.GetQuadrupleWord(0x04);
/// <summary>
/// Gets a value that represents the '<b>CPU ID</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private long? Cpuid => _data.IsNullOrEmpty()
? null
: _data.GetQuadrupleWord(0x14);
/// <summary>
/// Gets a value that represents the '<b>ISA Extensions Support</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int? IsaExtensionsSupport => _data.IsNullOrEmpty()
? null
: _data.GetDoubleWord(0x24);
#endregion
#region public properties
/// <summary>
/// Gets a value that represents the '<b>Major Revision</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
public byte? MajorRevision => Revision == null
? null
: (byte?)((Revision & 0xf0) >> 7);
/// <summary>
/// Gets a value that represents the '<b>Minor Revision</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
public byte? MinorRevision => Revision == null
? null
: (byte?)(Revision & 0x0f);
/// <summary>
/// Gets a value that represents the '<b>FPE</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
public bool? FPE => IsaExtensionsSupport?.CheckBit(Bits.Bit00);
/// <summary>
/// Gets a value that represents the '<b>SXE</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
public bool? SXE => IsaExtensionsSupport?.CheckBit(Bits.Bit01);
/// <summary>
/// Gets a value that represents the '<b>ASXE</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
public bool? ASXE => IsaExtensionsSupport?.CheckBit(Bits.Bit02);
/// <summary>
/// Gets a value that represents the '<b>BTE</b>' field.
/// </summary>
/// <value>
/// Value of the property.
/// </value>
public bool? BTE => IsaExtensionsSupport?.CheckBit(Bits.Bit03);
#endregion
#region public override methods
/// <summary>
/// Returns a class <see cref="string"/> that represents the current object.
/// </summary>
/// <returns>
/// Object <see cref="string"/> that represents the current <see cref="RiskVProcessorSpecificData"/> class.
/// </returns>
public override string ToString() => $"Revision = {MajorRevision}{MinorRevision}";
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Chassis.Elements/Min.md
# DmiProperty.Chassis.Elements.Min property
Gets a value representing the key to retrieve the property value.
Specifies the minimum number of the element type that can be installed in the chassis for the chassis to properly operate, in the range 0 to 254.
Key Composition
* Structure: SystemEnclosure
* Property: ContainedElementMinimum
* Unit: None
Return Value
Type: Byte
Remarks
2.3+
```csharp
public static IPropertyKey Min { get; }
```
## See Also
* class [Elements](../DmiProperty.Chassis.Elements.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiClassPropertiesTable.md
# DmiClassPropertiesTable class
Specialization of the BasePropertiesTable class that stores the available properties for each data table.
```csharp
public class DmiClassPropertiesTable : BasePropertiesTable
```
## Public Members
| name | description |
| --- | --- |
| [DmiClassPropertiesTable](DmiClassPropertiesTable/DmiClassPropertiesTable.md)() | The default constructor. |
## See Also
* namespace [iTin.Hardware.Specification.Dmi](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification/DMI/AccessType.md
# DMI.AccessType property
Gets a String that represents the type of access.
```csharp
public static string AccessType { get; }
```
## Property Value
A string that represents the type of access.
## Remarks
This method always returns the System BIOS string.
## See Also
* class [DMI](../DMI.md)
* namespace [iTin.Hardware.Specification](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.AdditionalInformation.md
# DmiProperty.AdditionalInformation class
Contains the key definitions available for a type 040 [AdditionalInformation] structure.
```csharp
public static class AdditionalInformation
```
## Public Members
| name | description |
| --- | --- |
| static [Entries](DmiProperty.AdditionalInformation/Entries.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static class [Entry](DmiProperty.AdditionalInformation.Entry.md) | Contains the key definition for the Entry section. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/MaximumVoltage.md
# DmiProperty.MemoryDevice.MaximumVoltage property
Gets a value representing the key to retrieve the property.
Maximum operating voltage for this device, in millivolts.
Key Composition
* Structure: MemoryDevice
* Property: MaximumVoltage
* Unit: mV
Return Value
Type: UInt16
Remarks
2.8+
```csharp
public static IPropertyKey MaximumVoltage { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType019 [Memory Array Mapped Address].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Memory Array Mapped Address (Type 19) structure.<br/>
/// For more information, please see <see cref="SmbiosType019"/>.
/// </summary>
internal sealed class DmiType019 : DmiBaseType<SmbiosType019>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType019"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType019(SmbiosType019 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion < DmiStructureVersion.v21)
{
return;
}
properties.Add(DmiProperty.MemoryArrayMappedAddress.MemoryArrayHandle, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryArrayMappedAddress.MemoryArrayHandle));
properties.Add(DmiProperty.MemoryArrayMappedAddress.PartitionWidth, SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryArrayMappedAddress.PartitionWidth));
uint startingAddress = SmbiosStructure.GetPropertyValue<uint>(SmbiosProperty.MemoryArrayMappedAddress.StartingAddress);
properties.Add(
DmiProperty.MemoryArrayMappedAddress.StartingAddress,
startingAddress == 0xffffffff
? SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryArrayMappedAddress.ExtendedStartingAddress)
: (ulong)startingAddress * (ulong)1024);
uint endingAddress = SmbiosStructure.GetPropertyValue<uint>(SmbiosProperty.MemoryArrayMappedAddress.EndingAddress);
properties.Add(
DmiProperty.MemoryArrayMappedAddress.EndingAddress,
endingAddress == 0xffffffff
? SmbiosStructure.GetPropertyValue(SmbiosProperty.MemoryArrayMappedAddress.ExtendedEndingAddress)
: (ulong)endingAddress * (ulong)1024);
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryChannel/MaximunChannelLoad.md
# DmiProperty.MemoryChannel.MaximunChannelLoad property
Gets a value representing the key to retrieve the property value.
Maximum load supported by the channel; the sum of all device loads cannot exceed this value.
Key Composition
* Structure: MemoryChannel
* Property: MaximumChannelLoad
* Unit: None
Return Value
Type: Byte
```csharp
public static IPropertyKey MaximunChannelLoad { get; }
```
## See Also
* class [MemoryChannel](../DmiProperty.MemoryChannel.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/SmbiosStructuresCache.cs
using System.Collections.Generic;
using System.Diagnostics;
namespace iTin.Hardware.Specification.Smbios;
/// <summary>
/// The <see cref="SmbiosStructuresCache"/> class represents the cache of available structures for a particular type.
/// </summary>
internal class SmbiosStructuresCache
{
#region private readonly members
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly Dictionary<SmbiosStructure, SmbiosStructureCollection> _structureDictionary;
#endregion
#region public static readonly memebrs
/// <summary>
/// Gets a reference to the available structures cache.
/// </summary>
public static readonly SmbiosStructuresCache Cache = new();
#endregion
#region constructor/s
/// <summary>
/// Prevents a default instance of the class from being created.
/// </summary>
private SmbiosStructuresCache()
{
_structureDictionary = new Dictionary<SmbiosStructure, SmbiosStructureCollection>();
}
#endregion
#region public methods
/// <summary>
/// Gets the collection of available structures.
/// </summary>
/// <param name="structureInfo">The structure info.</param>
/// <returns>
/// The collection of available structures.
/// </returns>
public SmbiosStructureCollection Get(SmbiosStructureInfo structureInfo)
{
if (!_structureDictionary.ContainsKey(structureInfo.StructureType))
{
_structureDictionary.Add(structureInfo.StructureType, structureInfo.Structures);
}
return _structureDictionary[structureInfo.StructureType];
}
#endregion
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDevice/TypeDetail.md
# DmiProperty.MemoryDevice.TypeDetail property
Gets a value representing the key to retrieve the property.
Additional detail on the memory device type.
Key Composition
* Structure: MemoryDevice
* Property: TypeDetail
* Unit: None
Return Value
Type: ReadOnlyCollection where T is String
Remarks
2.1+
```csharp
public static IPropertyKey TypeDetail { get; }
```
## See Also
* class [MemoryDevice](../DmiProperty.MemoryDevice.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.Bios/FirmwareMinorRelease.md
# DmiProperty.Bios.FirmwareMinorRelease property
Gets a value representing the key to retrieve the property value.
Identifies the minor release of the embedded controller firmware.
Key Composition
* Structure: Bios
* Property: FirmwareMinorRelease
* Unit: None
Return Value
Type: Nullable where T is Byte
Remarks
2.4+
```csharp
public static IPropertyKey FirmwareMinorRelease { get; }
```
## See Also
* class [Bios](../DmiProperty.Bios.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.OutOfBandRemote.Connections.md
# DmiProperty.OutOfBandRemote.Connections class
Contains the key definition for the Connections And Status section.
```csharp
public static class Connections
```
## Public Members
| name | description |
| --- | --- |
| static [InBoundConnection](DmiProperty.OutOfBandRemote.Connections/InBoundConnection.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [OutBoundConnection](DmiProperty.OutOfBandRemote.Connections/OutBoundConnection.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [OutOfBandRemote](./DmiProperty.OutOfBandRemote.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.ManagementControllerHostInterface.Protocol.md
# DmiProperty.ManagementControllerHostInterface.Protocol class
Contains the key definition for the Elements section.
```csharp
public static class Protocol
```
## Public Members
| name | description |
| --- | --- |
| static [ProtocolType](DmiProperty.ManagementControllerHostInterface.Protocol/ProtocolType.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [ProtocolTypeSpecificData](DmiProperty.ManagementControllerHostInterface.Protocol/ProtocolTypeSpecificData.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [ManagementControllerHostInterface](./DmiProperty.ManagementControllerHostInterface.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Smbios/SMBIOS/Structures/SmbiosType036 [Management Device Threshold Data].cs
using System.Diagnostics;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Smbios;
// Type 036: Management Device Threshold Data.
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | Offset Name Length Value Description |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 00h Type BYTE 36 Management Device Threshold Data structure indicator. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 01h Length BYTE 10h Length of the structure. |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 02h Handle WORD Varies The handle, or instance number, associated with the |
// | structure |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 04h Lower WORD Varies The lower non-critical threshold for this component. |
// | Threshold |
// | Non-critical Note: Ver LowerNonCritical |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 06h Upper WORD Varies The upper non-critical threshold for this component. |
// | Threshold |
// | Non-critical Note: Ver UpperNonCritical |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 08h Lower WORD Varies The lower critical threshold for this component. |
// | Threshold |
// | Critical Note: Ver LowerCritical |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ah Upper WORD Varies The upper critical threshold for this component. |
// | Threshold |
// | Critical Note: Ver UpperCritical |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Ch Lower WORD Varies The lower non-recoverable threshold for this |
// | Threshold component. |
// | Non-recoverable Note: Ver LowerNonRecoverable |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
// | 0Eh Upper WORD Varies The upper non-recoverable threshold for this |
// | Threshold component. |
// | Non-recoverable Note: Ver UpperNonRecoverable |
// •————————————————————————————————————————————————————————————————————————————————————————————————————————————•
/// <summary>
/// Specialization of the <see cref="SmbiosBaseType"/> class that contains the logic to decode the Management Device Threshold Data (Type 36) structure.
/// </summary>
internal sealed class SmbiosType036 : SmbiosBaseType
{
#region constructor/s
/// <summary>
/// Initializes a new instance of the <see cref="SmbiosType036"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructureHeaderInfo">Raw information of the current structure.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public SmbiosType036(SmbiosStructureHeaderInfo smbiosStructureHeaderInfo, int smbiosVersion) : base(smbiosStructureHeaderInfo, smbiosVersion)
{
}
#endregion
#region private properties
/// <summary>
/// Gets a value representing the <b>Lower Non Critical</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort LowerNonCritical => (ushort)Reader.GetWord(0x04);
/// <summary>
/// Gets a value representing the <b>Upper Non Critical</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort UpperNonCritical => (ushort)Reader.GetWord(0x06);
/// <summary>
/// Gets a value representing the <b>Lower Critical</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort LowerCritical => (ushort)Reader.GetWord(0x08);
/// <summary>
/// Gets a value representing the <b>Upper Critical</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort UpperCritical => (ushort)Reader.GetWord(0x0a);
/// <summary>
/// Gets a value representing the <b>Lower Non Recoverable</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort LowerNonRecoverable => (ushort)Reader.GetWord(0x0c);
/// <summary>
/// Gets a value representing the <b>Upper Non Recoverable</b> field.
/// </summary>
/// <value>
/// Property value.
/// </value>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private ushort UpperNonRecoverable => (ushort)Reader.GetWord(0x0e);
#endregion
#region protected override methods
/// <inheritdoc/>
protected override void PopulateProperties(SmbiosPropertiesTable properties)
{
if (StructureInfo.StructureVersion < SmbiosStructureVersion.Latest)
{
return;
}
properties.Add(SmbiosProperty.ManagementDeviceThresholdData.LowerNonCritical, LowerNonCritical);
properties.Add(SmbiosProperty.ManagementDeviceThresholdData.UpperNonCritical, UpperNonCritical);
properties.Add(SmbiosProperty.ManagementDeviceThresholdData.LowerCritical, LowerCritical);
properties.Add(SmbiosProperty.ManagementDeviceThresholdData.UpperCritical, UpperCritical);
properties.Add(SmbiosProperty.ManagementDeviceThresholdData.LowerNonRecoverable, LowerNonRecoverable);
properties.Add(SmbiosProperty.ManagementDeviceThresholdData.UpperNonRecoverable, UpperNonRecoverable);
}
#endregion
}
<file_sep>/src/lib/net/iTin.Hardware/iTin.Hardware.Specification.Dmi/DMI/Structures/DmiType027 [Cooling Device].cs
using iTin.Hardware.Specification.Dmi.Property;
using iTin.Hardware.Specification.Smbios;
using iTin.Hardware.Specification.Smbios.Property;
namespace iTin.Hardware.Specification.Dmi;
/// <summary>
/// Specialization of the <see cref="DmiBaseType{T}"/> class that contains the logic to decode the Cooling Device (Type 27) structure.<br/>
/// For more information, please see <see cref="SmbiosType027"/>.
/// </summary>
internal sealed class DmiType027: DmiBaseType<SmbiosType027>
{
/// <summary>
/// Initializes a new instance of the <see cref="DmiType027"/> class by specifying the structure information and the <see cref="SMBIOS"/> version.
/// </summary>
/// <param name="smbiosStructure">Formatted structure information.</param>
/// <param name="smbiosVersion">Current <see cref="SMBIOS"/> version.</param>
public DmiType027(SmbiosType027 smbiosStructure, int smbiosVersion) : base(smbiosStructure, smbiosVersion)
{
}
/// <inheritdoc/>
protected override void PopulateProperties(DmiClassPropertiesTable properties)
{
if (ImplementedVersion > DmiStructureVersion.v22)
{
ushort temperatureProbeHandle = SmbiosStructure.GetPropertyValue<ushort>(SmbiosProperty.CoolingDevice.TemperatureProbeHandle);
if (temperatureProbeHandle != 0x8000)
{
properties.Add(DmiProperty.CoolingDevice.TemperatureProbeHandle, temperatureProbeHandle);
}
properties.Add(DmiProperty.CoolingDevice.DeviceTypeAndStatus.Status, SmbiosStructure.GetPropertyValue(SmbiosProperty.CoolingDevice.DeviceTypeAndStatus.Status));
properties.Add(DmiProperty.CoolingDevice.DeviceTypeAndStatus.DeviceType, SmbiosStructure.GetPropertyValue(SmbiosProperty.CoolingDevice.DeviceTypeAndStatus.DeviceType));
byte coolingUnitGroup = SmbiosStructure.GetPropertyValue<byte>(SmbiosProperty.CoolingDevice.CoolingUnitGroup);
if (coolingUnitGroup != 0x00)
{
properties.Add(DmiProperty.CoolingDevice.CoolingUnitGroup, coolingUnitGroup);
}
properties.Add(DmiProperty.CoolingDevice.OemDefined, SmbiosStructure.GetPropertyValue(SmbiosProperty.CoolingDevice.OemDefined));
object nominalSpeedProperty = SmbiosStructure.GetPropertyValue(SmbiosProperty.CoolingDevice.NominalSpeed);
if (nominalSpeedProperty != null)
{
ushort nominalSpeed = (ushort)nominalSpeedProperty;
if (nominalSpeed != 0x8000)
{
properties.Add(DmiProperty.CoolingDevice.NominalSpeed, nominalSpeed);
}
}
}
if (ImplementedVersion > DmiStructureVersion.v27)
{
properties.Add(DmiProperty.CoolingDevice.Description, SmbiosStructure.GetPropertyValue(SmbiosProperty.CoolingDevice.Description));
}
}
}
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/BaseBoardContainedElementCollection/ToString.md
# BaseBoardContainedElementCollection.ToString method
Returns a class String that represents the current object.
```csharp
public override string ToString()
```
## Return Value
Object String that represents the current AdditionalInformationEntryCollection class.
## Remarks
This method returns a string that includes the number of available items.
## See Also
* class [BaseBoardContainedElementCollection](../BaseBoardContainedElementCollection.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification/DMI/ToString.md
# DMI.ToString method
Returns a String that represents this instance.
```csharp
public override string ToString()
```
## Return Value
A String that represents this instance.
## Remarks
The `ToString` method returns a string that includes the version expresed in hexadecimal format, the number of available structures, and SMBIOS total size occupied by all structures.
## See Also
* class [DMI](../DMI.md)
* namespace [iTin.Hardware.Specification](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.SystemPowerControls.md
# DmiProperty.SystemPowerControls class
Contains the key definitions available for a type 025 [SystemPowerControls] structure.
```csharp
public static class SystemPowerControls
```
## Public Members
| name | description |
| --- | --- |
| static [Day](DmiProperty.SystemPowerControls/Day.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Hour](DmiProperty.SystemPowerControls/Hour.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Minute](DmiProperty.SystemPowerControls/Minute.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Month](DmiProperty.SystemPowerControls/Month.md) { get; } | Gets a value representing the key to retrieve the property value. |
| static [Second](DmiProperty.SystemPowerControls/Second.md) { get; } | Gets a value representing the key to retrieve the property value. |
## See Also
* class [DmiProperty](./DmiProperty.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.IpmiDevice.BaseAdressModifier/RegisterSpacing.md
# DmiProperty.IpmiDevice.BaseAdressModifier.RegisterSpacing property
Gets a value representing the key to retrieve the property value.
Register spacing.
Key Composition
* Structure: IpmiDevice
* Property: RegisterSpacing
* Unit: None
Return Value
Type: String
```csharp
public static IPropertyKey RegisterSpacing { get; }
```
## See Also
* class [BaseAdressModifier](../DmiProperty.IpmiDevice.BaseAdressModifier.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi.Property/DmiProperty.MemoryDeviceMappedAddress/InterleavedDataDepth.md
# DmiProperty.MemoryDeviceMappedAddress.InterleavedDataDepth property
Gets a value representing the key to retrieve the property value.
Maximum number of consecutive rows from the referenced Memory Device that are accessed in a single interleaved transfer. If the device is not part of an interleave, the field contains 0; if the interleave configuration is unknown, the value is FFh.
Key Composition
* Structure: MemoryDeviceMappedAddress
* Property: InterleavedDataDepth
* Unit: None
Return Value
Type: Byte
Remarks
2.1+
```csharp
public static IPropertyKey InterleavedDataDepth { get; }
```
## See Also
* class [MemoryDeviceMappedAddress](../DmiProperty.MemoryDeviceMappedAddress.md)
* namespace [iTin.Hardware.Specification.Dmi.Property](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/SpecificDmiBaseType/ImplementedProperties.md
# SpecificDmiBaseType.ImplementedProperties property
Returns a list of implemented properties for this smbios structure.
```csharp
public IEnumerable<IPropertyKey> ImplementedProperties { get; }
```
## Return Value
A list of implemented properties for this structure.
## See Also
* class [SpecificDmiBaseType](../SpecificDmiBaseType.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
<file_sep>/documentation/iTin.Hardware.Specification.Dmi/DmiBaseType-1/GetProperty.md
# DmiBaseType<TSmbios>.GetProperty method
Returns the value of specified property. Always returns the first appearance of the property.
```csharp
public QueryPropertyResult GetProperty(IPropertyKey propertyKey)
```
| parameter | description |
| --- | --- |
| propertyKey | Key to the property to obtain |
## Return Value
A QueryPropertyResult reference that contains the result of the operation, to check if the operation is correct, the Success property will be true and the Value property will contain the value; Otherwise, the the Success property will be false and the Errors property will contain the errors associated with the operation, if they have been filled in.
The type of the Value property is PropertyItem. Contains the result of the operation.
## See Also
* class [DmiBaseType<TSmbios>](../DmiBaseType-1.md)
* namespace [iTin.Hardware.Specification.Dmi](../../iTin.Hardware.Specification.Dmi.md)
<!-- DO NOT EDIT: generated by xmldocmd for iTin.Hardware.Specification.Dmi.dll -->
|
0eb1aa72f702e0bac0e7ed66959f8af91e918c1d
|
[
"Markdown",
"C#",
"Text"
] | 446 |
C#
|
iAJTin/iSMBIOS
|
4f3803604401b351d137396ccf044edeb1e67b65
|
bbdb60ad11f8a4d7b80c8334006c32beec6ce26c
|
refs/heads/master
|
<repo_name>dpy1123/spring-cloud-basic<file_sep>/yet-another-app/src/main/resources/application.properties
spring.application.name=yet-another-app
server.port=8080<file_sep>/zuul/src/main/java/top/devgo/zuul/EnhanceHttpServletRequest.java
package top.devgo.zuul;
import lombok.Getter;
import lombok.Setter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.util.*;
@Getter
@Setter
public class EnhanceHttpServletRequest extends HttpServletRequestWrapper {
/**
* Constructs a request object wrapping the given request.
*
* @param request The request to wrap
* @throws IllegalArgumentException if the request is null
*/
public EnhanceHttpServletRequest(HttpServletRequest request) {
super(request);
}
private Map<String, String> newHeader = new HashMap<>();
private Set<String> headers2Remove = new HashSet<>();
/**
* 增加自定义header
* @param key
* @param value
*/
public void addHeader(String key, String value) {
newHeader.put(key, value);
}
/**
* 增加待删除的header
* @param key
*/
public void addRemoveHeaders(String... key) {
headers2Remove.addAll(Arrays.asList(key));
}
}
<file_sep>/zuul/README.md
# api-gateway build on zuul

## Feature enhancement
1. Add ability to modify Http Headers before routing to back service
<file_sep>/consul-client/src/main/bash/run_consul_218cluster.sh
#!/usr/bin/env bash
if [ ! -d /tmp/consul-config ]; then
mkdir /tmp/consul-config
fi
cp acl_config.json /tmp/consul-config/
nohup ./consul agent -ui -node=client-dd -data-dir /tmp/consul -config-dir=/tmp/consul-config > /tmp/consul.log 2>&1 &
./consul join 172.16.6.218
tail -f /tmp/consul.log<file_sep>/consul-client/README.md
# consul-client
### consul-server
1.搭建服务端集群环境
搭建一个3节点集群, 172.16.6.112, 172.16.6.113, 172.16.6.218, 其中在218上enable web-ui
* setup 218
```bash
nohup ./consul agent -server -ui -bootstrap-expect=3 -data-dir=/tmp/consul \
-node=agent-218 -bind=172.16.6.218 -enable-script-checks=true \
-config-dir=./consul_conf.d -client=0.0.0.0 > /tmp/consul.log 2>&1 &
```
* setup 112&113
```bash
nohup ./consul agent -server -data-dir=/tmp/consul -node=agent-112 \
-bind=172.16.6.112 -enable-script-checks=true -config-dir=./consul_conf.d \
-client=0.0.0.0 > /tmp/consul.log 2>&1 &
```
* 在112&113上执行join命令,加入到218所在集群
```bash
./consul join 172.16.6.218
```
2.check集群环境
```bash
./consul members
```
```bash
Node Address Status Type Build Protocol DC
agent-112 172.16.6.112:8301 alive server 0.9.0 2 dc1
agent-113 172.16.6.113:8301 alive server 0.9.0 2 dc1
agent-218 172.16.6.218:8301 alive server 0.9.0 2 dc1
```
### consul-client

* Client——一个Client是一个转发所有RPC到server的代理。这个client是相对无状态的。client唯一执行的后台活动是加入LAN gossip池。这有一个最低的资源开销并且仅消耗少量的网络带宽。
* Server——一个server是一个有一组扩展功能的代理,这些功能包括参与Raft选举,维护集群状态,响应RPC查询,与其他数据中心交互WAN gossip和转发查询给leader或者远程数据中心。
因此每个应用server上需要起一个以client方式运行的consul-agent,在本例中通过/src/main/bash/run_xx.sh可以启动client并加入服务端的集群。
### 启用acl
1.首先在server端启动的时候,conf目录下放入acl_config.json,其中只有218配置acl_token,即只能通过218来管理,其他server节点的members和info命令将看不到集群信息。
2.客户端的conf目录下,放置客户端的acl配置文。客户端的acl_token以及该token对应的权限需要先在server上配置。
<file_sep>/README.md
# spring-cloud-basic
|
eec301a1fb441e02c77fa52b0a9337d74baac068
|
[
"Markdown",
"Java",
"Shell",
"INI"
] | 6 |
INI
|
dpy1123/spring-cloud-basic
|
84c62bb989bc3bb520c3351a8d6a3caac64bf0ec
|
ef515cde325f95293e0cc853207ca6cecb1c4645
|
refs/heads/main
|
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Backend_Productos.models.request
{
public class Busquedas
{
public string NombreProductoLargo { get; set; }
}
}
<file_sep>using System;
using System.Collections.Generic;
#nullable disable
namespace Backend_Productos.Models
{
public partial class Producto
{
public Producto()
{
Venta = new HashSet<Venta>();
}
public int IdProductos { get; set; }
public string NombreProducto { get; set; }
public string NombreProductoLargo { get; set; }
public decimal? Precio { get; set; }
public int? CantidadExistencia { get; set; }
public virtual ICollection<Venta> Venta { get; set; }
}
}
<file_sep>using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Backend_Productos.Models;
//Controlador encargado de CRUD Productos
namespace Backend_Productos.Controllers
{
[ApiController]
[Route("[controller]")]
public class ProductosController : Controller
{
//Muestra la data de la base de datos
[HttpGet]
public IActionResult Index()
{
using (ProductosContext db = new ProductosContext())
{
var listaProductos = (from prod in db.Productos
select prod).ToList();
return Ok(listaProductos);
}
}
[Route("product")]
[HttpPost]
public IActionResult product([FromBody] models.request.ProductosDelete modelo)
{
using (ProductosContext db = new ProductosContext())
{
var listaProductos = (from prod in db.Productos
select prod)
.Where(s => s.IdProductos == modelo.IdProducto)
.ToList();
return Ok(listaProductos);
}
}
[Route("busqueda")]
[HttpPost]
public IActionResult busqueda([FromBody] models.request.Busquedas modelo)
{
using (ProductosContext db = new ProductosContext())
{
var busqueda = (from prod in db.Productos
select prod)
.Where(s => s.NombreProducto.Contains(modelo.NombreProductoLargo.ToUpper()))
.ToList();
if (busqueda== null)
{
Index();
}
return Ok(busqueda);
}
}
[Route("create")]
[HttpPost()]
public IActionResult create([FromBody] models.request.ProductosCreate modelo)
{
//Valido que no existan datos vacios
if(!(modelo.Cantidad==0 && modelo.Precio==0 && String.IsNullOrEmpty(modelo.NombreProductoLargo) && String.IsNullOrEmpty(modelo.NombreProducto)))
{
using (ProductosContext db = new ProductosContext())
{
Producto oProducto = new Producto();
oProducto.NombreProducto = modelo.NombreProducto.ToUpper();
oProducto.NombreProductoLargo = modelo.NombreProductoLargo.ToUpper();
oProducto.Precio =modelo.Precio;
oProducto.CantidadExistencia = modelo.Cantidad;
db.Add(oProducto);
db.SaveChanges();
return Ok();
}
}else
return NotFound();
}
[Route("edit")]
[HttpPut()]
public async Task<IActionResult> Update([FromBody] models.request.ProductosEdit modelo)
{
using (ProductosContext db = new ProductosContext())
{
try
{
var oProducto = db.Productos.Find(modelo.IdProducto);
oProducto.NombreProducto = modelo.NombreProducto.ToUpper();
oProducto.NombreProductoLargo = modelo.NombreProductoLargo.ToUpper();
oProducto.Precio = modelo.Precio;
oProducto.CantidadExistencia = modelo.Cantidad;
db.Entry(oProducto).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
db.SaveChangesAsync();
return Ok();
}
catch(Exception e)
{
return NotFound();
}
}
}
[Route("delete")]
[HttpDelete()]
public IActionResult delete([FromBody] models.request.ProductosDelete modelo)
{
using (ProductosContext db = new ProductosContext())
{
try
{
var oProducto = db.Productos.Find(modelo.IdProducto);
db.Remove(oProducto);
db.SaveChanges();
return Ok();
}
catch(ArgumentNullException e)
{
return NotFound();
}
}
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Backend_Productos.models
{
public class VentasProductos
{
public String Nombre { get; set; }
public String NombreLargo { get; set; }
public decimal? Precio { get; set; }
public int? CantidadProductos { get; set; }
//ventas
public DateTime? Fecha { get; set; }
public int? CantidadVentas { get; set; }
}
}
<file_sep>using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.Extensions.Configuration;
#nullable disable
namespace Backend_Productos.Models
{
public partial class ProductosContext : DbContext
{
public ProductosContext()
{
}
public ProductosContext(DbContextOptions<ProductosContext> options)
: base(options)
{
}
public virtual DbSet<Producto> Productos { get; set; }
public virtual DbSet<Venta> Ventas { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
optionsBuilder.UseSqlServer("Server=PC-DESKTOP\\SQLEXPRESS;Database=Productos;Trusted_Connection=True;");
}
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasAnnotation("Relational:Collation", "Modern_Spanish_CI_AS");
modelBuilder.Entity<Producto>(entity =>
{
entity.HasKey(e => e.IdProductos)
.HasName("PK__PRODUCTO__718C7D0788CDBF4B");
entity.ToTable("PRODUCTOS");
entity.Property(e => e.NombreProducto)
.HasMaxLength(50)
.IsUnicode(false);
entity.Property(e => e.NombreProductoLargo).HasColumnType("text");
entity.Property(e => e.Precio).HasColumnType("decimal(18, 0)");
});
modelBuilder.Entity<Venta>(entity =>
{
entity.HasKey(e => e.IdVenta)
.HasName("PK__VENTAS__BC1240BDE75923BE");
entity.ToTable("VENTAS");
entity.Property(e => e.Cantidad).HasColumnName("cantidad");
entity.Property(e => e.Fecha)
.HasColumnType("date")
.HasColumnName("fecha");
entity.Property(e => e.PrecioVenta).HasColumnType("decimal(18, 0)");
entity.HasOne(d => d.IdProductosNavigation)
.WithMany(p => p.Venta)
.HasForeignKey(d => d.IdProductos)
.HasConstraintName("FK__VENTAS__cantidad__267ABA7A");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}
}
<file_sep>using Backend_Productos.models;
using Backend_Productos.Models;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Backend_Productos.Controllers
{
[ApiController]
[Route("[controller]")]
public class VentasController : Controller
{
public IActionResult Index()
{
using (ProductosContext db = new ProductosContext())
{
//El filtro lo hice en JS
var query = from a in db.Productos
join s in db.Ventas on a.IdProductos equals s.IdProductos
select new VentasProductos
{
Nombre = a.NombreProducto,
NombreLargo = a.NombreProducto,
Precio = a.Precio,
CantidadProductos = a.CantidadExistencia,
Fecha = s.Fecha,
CantidadVentas = s.Cantidad
};
return Ok(query.ToList());
}
}
[Route("intervalo")]
[HttpPost()]
public IActionResult IntervalosFecha()
{
//Me falto esta parte, hace tiempo que no usaba Net Core :(
//ahora se llama Net 5!
//Pero en teoria solo seria realizar un beetween entre las fechas y pintarlas en el la interfaz
return Ok();
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Backend_Productos.models.request
{
public class ProductosDelete
{
public int IdProducto { get; set; }
}
}
<file_sep>using System;
using System.Collections.Generic;
#nullable disable
namespace Backend_Productos.Models
{
public partial class Venta
{
public int IdVenta { get; set; }
public int? IdProductos { get; set; }
public DateTime? Fecha { get; set; }
public decimal? PrecioVenta { get; set; }
public int? Cantidad { get; set; }
public virtual Producto IdProductosNavigation { get; set; }
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Backend_Productos.models.request
{
public class ProductosCreate
{
public string NombreProducto { get; set; }
public string NombreProductoLargo { get; set; }
public decimal Precio { get; set; }
public int Cantidad { get; set; }
}
}
<file_sep>--Script base de datos
use Productos;
CREATE TABLE PRODUCTOS (
IdProductos integer primary key identity(1,1),
NombreProducto varchar(50),
NombreProductoLargo text,
Precio decimal,
CantidadExistencia int
)
Create Table VENTAS (
IdVenta integer primary key identity(1,1),
IdProductos integer,
fecha date,
PrecioVenta decimal,
cantidad int
foreign key (IdProductos) references PRODUCTOS(IdProductos)
)
SELECT * FROM PRODUCTOS;
delete from PRODUCTOS;
insert into PRODUCTOS(NombreProducto, NombreProductoLargo,Precio,CantidadExistencia )
VALUES ('XBOX SERIES S','CONSOLA MICROSOFT SERIES S 500 GB DISCO DURO, INCLUYE UN CONTROL CON FORZA HORIZON',9000,1000)
insert into PRODUCTOS(NombreProducto, NombreProductoLargo,Precio,CantidadExistencia )
VALUES ('PLAY STATION 4','CONSOLA SONY DIGITAL EDITION 500 GB DISCO DURO, INCLUYE UN CONTROL CON THE LAST OF US',10000,1500)
insert into PRODUCTOS(NombreProducto, NombreProductoLargo,Precio,CantidadExistencia )
VALUES ('NINTENDO SWICTH','NINTENDO SWITCH CON DOCK',9500,1000)
insert into PRODUCTOS(NombreProducto, NombreProductoLargo,Precio,CantidadExistencia )
VALUES ('NINTENDO 3DS','CONSOLA PORTATIL NINTENDO 3DS EDICION ZELDA MAJORAS MASK',4000,2000)
insert into ventas(IDProductos, fecha, PrecioVenta, cantidad) values (1,GETDATE(),1500, 10);
select * from ventas;
delete from VENTAS;
<file_sep># Prueba Técnica Residencias
Prueba realizada por <NAME>, en este apartado te comento los detalles de esta solución
## Diagrama General Solución

## Tecnologías empleadas
- Framework NET 5.0
- SQL SERVER EXPRESS EDITION
- Entity Framework Core
- Lenguaje C#
## Entorno de desarrollo
- Visual Studio community 2019
- SQL Server Management Studio
- Visual Studio Code (Edición para vistas)
- Postman (Para consultas a la API)
## Estructura de la aplicación
En este repositorio encontrara 3 carpetas:
Backend-Productos: Proyecto WebAPI Net 5.0
views: documentos HTML, CSS y JS
Database Script: El script de la base de datos (Perdon por lo sencillo 😅)
## Operaciones
- La aplicación cuenta con un CRUD completo para la gestion de productos
- La aplicación permite filtrar los mas vendidos y menos vendidos
## End Points
Esta API hace uso de los métodos HTTP para realizar determinadas acciones a continuación se en listan:
www.yourdomain/Productos -> GET {Muestra Productos}
www.yourdomain/create -> POST {Registro de Productos}
www.yourdomain/edit -> PUT {Edición de Productos}
www.yourdomain/delete -> DELETE {Eliminación de Productos}
www.yourdomain/produc -> POST {Búsqueda de productos por ID }
www.yourdomain/busquedas -> POST {Búsquedas por nombres }
www.yourdomain/Ventas -> GET {Muestra las ventas de productos}
- GET: Para consultas de información y en donde no sea necesario enviar algún parámetro en la solicitud.
- POST: Para todas aquellas inserciones que estén enfocadas principalmente en la creación de registros
- PUT: Para acciones de modificación
- DELETE: Como su nombre lo indica es para eliminación de registros
## Limitaciones
- Esta aplicación no puede generar ventas
- Esta aplicación no puede modificar tabla de ventas
- Hay un boton que dice comprar, pero no hace nada mas que mandar una alerta 😞
- Quedo pendiente sobre las existencias (aunque si tiene curiosidad si edita uno y lo pone en cero la tarjeta cambia y se agrega mensaje agotado) y sobre los intervalos
- Internet Explorer no esta soportado (No soporta API FETCH)
## Agregados
- La aplicación esta validada para evitar nulos tanto en el frontend como en el backend
- cuenta con algunas animaciones en las alertas de acción
## Vistas de aplicación


|
63eb3b051dd6606453cd3dc1e8759d27233ce7fc
|
[
"Markdown",
"C#",
"SQL"
] | 11 |
C#
|
wineloy/PruebaTecnica
|
1bb3a1d41d9182a0a7bdefaf8baada31830be41e
|
d1d3e318446310e8a8ee730c43d2fc3c9f647a00
|
refs/heads/master
|
<repo_name>Cornellio/prototypes<file_sep>/algorithms/quicksort_trial4.py
#!/usr/bin/env python
# time: 3:30
def quicksort(values):
if len(values) < 2:
return values
else:
pivot = values[0]
lower = [i for i in values[1:] if i < pivot]
upper = [i for i in values[1:] if i > pivot]
return quicksort(lower) + [pivot] + quicksort(upper)
nums = [1, 3, 44, 34, 23, 77]
sorted_nums = quicksort(nums)
sorted_nums
x = enumerate(sorted_nums)
for id, value in x:
print(id, value)
<file_sep>/algorithms/binary_search_trial0.py
def binary_search(list, target):
low = 0
high = len(list) - 1
while low <= high:
mid = (low + high) // 2
guess = list[mid]
if guess == target:
return '1 hit', str(list[mid])
if guess > target:
high = mid - 1
if guess < target:
low = mid + 1
return None
alist = [1, 3, 4, 5, 7, 8, 9, 10, 11, 14, 18, 32, 55, 57]
blist = [1, 2, 3, 4, 5, 6]
print(binary_search(alist, 11))
<file_sep>/tesla_locales.py
#!/usr/bin/env python3
import requests
import json
'''
Ideas
- get total superchargers worldwide
- get total Tesla stores
- get list of countries with superchargers
'''
URL = 'https://www.tesla.com/all-locations'
HEADERS = {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10; rv:33.0) Gecko/20100101 Firefox/33.0'}
all_locations = json.loads(requests.get(URL, headers=HEADERS).text)
def locations_total(locations):
return len(locations)
def sc_names(locations):
# put response into list of dicts
return [location.get('title') for location in locations]
def info(locations):
return [location.get('location_type') for location in locations if 'supercharger' in location.get(location_type)]
print(locations_total(all_locations))
# print(sc_names(all_locations))
print(info(all_locations))
<file_sep>/p1.py
#!/usr/bin/env python
''' The dictionary will look something like:
{'<NAME>': ['jQuery Basics', 'Node.js Basics'],
'<NAME>': ['Python Basics', 'Python Collections']}
Each key will be a Teacher and the value will be a list of courses.
'''
def num_teachers(**kwargs):
# num_teachers = len(kwargs).keys
items = kwargs
num_teachers = len(items.keys())
return num_teachers
d = {
'<NAME>': ['jQuery Basics', 'Node.js Basics'],
'<NAME>': ['Python Basics', 'Python Collections']
}
print(num_teachers(**{'<NAME>': ['jQuery Basics', 'Node.js Basics'], '<NAME>': ['Python Basics', 'Python Collections']}))
# print(num_teachers(**d))
a = 5
b = 20
a, b = b, a
a
b
def add(*nums):
for n in nums:
total =+ n
return n
list(enumerate("abc"))
for index, letter in enumerate("dexifycation", start=1):
print("%s: %s" % (index, letter))
def string_cases(s):
upper = s.upper()
lower = s.lower()
title = s.title()
reversi = s[-1:0]
return upper, lower, title, reversi
print(string_cases("bxlu oblong stary night"))
<file_sep>/katas/dict_challenges.py
#!/usr/bin/env python
#%%
def packer(name='Peter', **kwargs):
print('name', name)
print(kwargs)
d = {"skill": "scuba", "klass": "master"}
packer(**d)
packer(skill="Scuba", klass="Master")
#%%
print('iii')
def unpacker(fname=None, lname=None):
if fname and lname:
print("hi {} {}".format(fname, lname))
else:
print('no name given')
unpacker(**{'fname': 'Peet', 'lname': 'Cornell'}) # send dict into function
#%%
'''
make a function named word_count. It should accept a single argument which will be a string. The function needs to return a dictionary. The keys in the dictionary will be each of the words in the string, lowercased. The values will be how many times that particular word appears in the string
'''
def word_count(string):
string = string.lower()
d = {}
for word in string.split():
if word in d:
d[word] += 1
else:
d[word] = 1
return d
print(dword_count("I do not like it Sam I Am"))
#%%
'''
This challenge has several steps so take your time, read the instructions carefully, and feel free to experiment in Workspaces or on your own computer.
For this first task, create a function named num_teachers that takes a single argument, which will be a dictionary of Treehouse teachers and their courses.
The num_teachers function should return an integer for how many teachers are in the dict
'''
'''
The dictionary will look something like:
{'<NAME>': ['jQuery Basics', 'Node.js Basics'],
'<NAME>': ['Python Basics', 'Python Collections']}
Each key will be a Teacher and the value will be a list of courses.
'''
def num_teachers(arg):
pass
<file_sep>/p3.py
#!/usr/bin/env python3
import os
import teslajson
USERID = os.environ['TESLA_ID']
PASSWD = <PASSWORD>['<PASSWORD>']
def connect(token=None):
conn = teslajson.Connection(email=USERID, password=<PASSWORD>, access_token=token)
return conn
def get_odometer(conn, car):
odometer = None
for v in conn.vehicles:
if v["display_name"] == car:
d = v.data_request("Vehicle_state")
odometer = int(d["odometer"])
return odometer
conn = connect()
print(get_odometer(conn, "Terrapin Flyer"))
<file_sep>/algorithms/selection_sort_trial0.py
# Selection sort
#
# Time taken to write from scratch:
# - 15 minutes
# given an array/list, return the index of the lowest element
# pop the lowest from list and append to new list_a
def find_smallest(values):
smallest = values[0]
smallest_index = 0
for i in range(1, len(values)):
if values[i] < smallest:
smallest = values[i]
smallest_index = i
return smallest_index
def select_smallest(values):
sorted_values = []
for i in range(len(values)):
smallest_index = find_smallest(values)
sorted_values.append(values.pop(smallest_index))
return sorted_values
print(select_smallest([66, 33, -3, 9, 34, 35, 76, 54, 53, 52, 55, 121]))
<file_sep>/katas/battleship.py
W# You are given a square grid of size N, where N>=3. I have placed a battleship of
# size 3 somewhere in the grid, and you want to sink my battleship by ordering the
# bombing of specified coordinates.
#
# The battleship can only be placed vertically or horizontally, not diagonally.
# Every coordinate which does not contain the battleship is empty. Your task is to
# write a function which takes as input N, and returns the 3 coordinates of the
# battleship.
#
# Assume you have a function, boolean bomb_location(x, y), which will return
# True if (x, y) "hits" the battleship and False if (x, y) misses the battleship.
#
# For example - in the following grid your function find_battleship(grid_size),
# given grid_size of 8, would return ((2,1), (2,2), (2,3)):
#
# . . . . . . . .
# . . X . . . . .
# . . X . . . . .
# . . X . . . . .
# . . . . . . . .
# . . . . . . . .
# . . . . . . . .
# . . . . . . . .
# grid_size=8
def find_battleship(grid_size):
result = []
for x in range(1, grid_size):
for y in range(1, grid_size):
if bomb_location(x, y):
result.append(x, y)
return result
# return ((2,1), (2,2), (2,3))
<file_sep>/algorithms/selection_sort.py
def find_smallest(values):
smallest = values[0]
smallest_index = 0
for i in range(0, len(values)):
if values[i] < smallest:
smallest = values[i]
smallest_index = i
return smallest_index
def selection_sort(values):
sorted_values = []
for i in range(len(values)):
smallest_index = find_smallest(values)
sorted_values.append(values.pop(smallest_index))
return sorted_values
#
print(selection_sort([4, 16, 345, 23, 87, 44, 32]))
print(selection_sort(['abba', 'axxa', 'adda']))
#%%
v = [1, 4, 5, 9]
print(v.pop(1))
#%%
#%%
values = [54, 44, 24, 23, 88, 33, 44, 54, 456, 445, 233]
value = find_smallest(values)
print(value)
#%%
<file_sep>/algorithms/binary_search_trial2.py
# binary_search_trial2
# Time taken to write from scratch:
# - 5 minutes
# divide in half each time
def binary_search(list, target):
low = 0
high = len(list)-1
while low <= high:
mid = (low + high) // 2
guess = list[mid]
if guess == target:
return guess
if guess < target:
low = mid + 1
if guess > target:
high = mid -1
return None
my_list = [1, 2, 4, 5, 7, 9, 15, 21, 23, 25, 33]
print(binary_search(my_list, 9))
<file_sep>/algorithms/breadth-first-search.py
# breadth first search
from collections import deque
graph = {}
graph['you'] = ['bob', 'claire']
graph['bob'] = ['anna', 'pagom']
graph['claire'] = ['tom', 'jamie']
graph['anna'] = []
graph['pagom'] = []
graph['tom'] = []
graph['jamie'] = []
def person_is_seller(name):
return name[-1] == 'm'
def search(name):
search_queue = deque()
search_queue += graph['you']
searched = []
while search_queue:
person = search_queue.popleft()
if not person in searched:
if person_is_seller(person):
print('person is a seller: ', person)
else:
search_queue += graph[person]
searched.append(person)
search("you")
# print(graph['you'])
<file_sep>/algorithms/quicksort_trial0.py
# time: 5 mins
def qsort(array):
if len(array) < 2:
return array
pivot = array[0]
lower = [i for i in array[1:] if i <= pivot]
upper = [i for i in array[1:] if i > pivot]
return qsort(lower) + [pivot] + qsort(upper)
nums = [4, 2, 6, 5, 13, 11, 1, 3, 2]
print(qsort(nums))
<file_sep>/proto.py
#!/usr/bin/env python
class Shapes():
def __init__(self, size="small", color="red"):
self.size = size
self.color = color
def circle(self, size, color):
print("size", size)
print("color", color)
shapes = Shapes()
shapes.circle("big", "red")
<file_sep>/r_sentiment_scraper/senti.py
#!/usr/bin/env python3
import praw
from textblob import TextBlob
import math
import api_secret
reddit = praw.Reddit(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET,
user_agent='subSentiment')
# opens file with subreddit names
with open('subreddit.txt') as f:
for line in f:
subreddit = reddit.subreddit(line.strip())
print(subreddit.submissions())
# write web agent to get converter for datetime to epoch on a daily basis for updates
day_start = 1533950230
day_end = 1534382230
sub_submissions = subreddit.submissions(day_start, day_end)
sub_sentiment = 0
num_comments = 0
for submission in sub_submissions:
if not submission.stickied:
submission.comments.replace_more(limit=0)
for comment in submission.comments.list():
blob = TextBlob(comment.body)
#adds comment sentiment to overall sentiment for subreddit
comment_sentiment = blob.sentiment.polarity
sub_sentiment += comment_sentiment
num_comments += 1
#prints comment and polarity
#print(str(comment.body.encode('utf-8')) + ': ' + str(blob.sentiment.polarity))
print('/r/' + str(subreddit.display_name))
try:
print('Ratio: ' + str(math.floor(sub_sentiment/num_comments*100)) + '\n')
except:
print('No comment sentiment.' + '\n')
ZeroDivisionError
<file_sep>/filter_list.py
def filter_list(l):
'return a new list with the strings filtered out'
alphabet = 'abcdefghijklmnopqrstuvwxyz'
list = [str(i).strip(alphabet) for i in l] # empty elements are left in place of the stripped strings
# Create new list of ints from old list with empty elements skipped
filtered_list = [int(list[i]) for i in range(0, len(list)) if list[i] != ""]
return filtered_list
print(filter_list([1,2,'a', 'b']))
<file_sep>/tostr.py
l = [1,2,'aasf','1','123',123]
l = [1,2,123]
list = [str(c) for c in l]
print(list)
<file_sep>/tail.py
#!/usr/bin/env python
import os
import sys
# def tail(infile, n=int(sys.argv[1])):
def tail(infile, n):
with open(infile) as f:
data = f.read().splitlines()
''' n elements from the end of list up to the end. '''
return "\n".join(data[-n:])
''' Using calculation based on length of list '''
# l = len(data)
# start = l-n
# return data[start:]
infile = "~/code/python/_data/times_values.csv"
print(tail(infile, 5))
<file_sep>/algorithms/pair_match.py
# import pdb
# pdb.set_trace()
def pair_match(nums, sum):
for i in nums:
for j in nums[1:]:
if i + j == sum:
print('YES. comparing', i, j)
nums = [1, 2, 7, 9, 10, 11, 51]
pair_match(nums, 21)
<file_sep>/katas/coding_challenges.md
# things to do
## Commit to memory
* quick sort √
* binary search √
* selection sort √
* bfs √
Big O Times:
* binary search: O(log n)
if n=16, big O time is 4
* quick sort: O(n log n)
* selection sort: O(n squared)
* simple sort: O(n)
* read web page using requests library
requests
.get(url)
.text
.status_code
.headers
.headers['Key']
* extract link from a web page √
import re then use re.findall(pattern, text)
extract links regex: (?<=<a href=).+(?=</a>)
* Fizz buzz √
* print stuff from json √
* use sorted() function with custom key (key= function) √
* list comprehensions √
* filesystem traversal
os.walk, os.getcwd, os.mknod, os.makedir(s)
* log processing
* application deployment
## Puzzles
### Generate numbers
Print numbers in range(1, 1000) but not in given list. √
### Sum of pairs in a List √
* Given a list of numbers, find the 2 that add up to a given sum like:
[1, 2, 3, 5] => sum 8
[1, 2, 3, 6] => sum 8
[1, 2, 3, 6] => sum 8
### phone number alpha
* Given a phone number, write an algorithm to print all possible alpha-codes that correspond to it.
(From Glassdoor, possible answers here https://www.glassdoor.com/Interview/Given-a-phone-number-write-an-algorithm-to-print-all-possible-alpha-codes-that-correspond-to-it-QTN_171562.htm)
<file_sep>/algorithms/quicksort_trial3.py
# time: 4 mins
def qsort(values):
if len(values) < 2:
return values
else:
pivot = values[0]
lower = [i for i in values[1:] if i < pivot]
upper = [i for i in values[1:] if i > pivot]
return qsort(lower) + [pivot] + qsort(upper)
n = [1, 5, 3, 2, 8, 34, 55, 33, 22, 11, 87]
print(qsort(n))
<file_sep>/algorithms/breadth_first_search_trial2.py
from collections import deque
graph = {}
graph['you'] = ['bob', 'claire']
graph['bob'] = ['anna', 'pagom']
graph['claire'] = ['tom', 'jamie']
graph['anna'] = []
graph['pagom'] = []
graph['tom'] = []
graph['jamie'] = []
def search(name):
search_queue = deque()
search_queue += graph[name]
while search_queue:
person = search_queue.popleft()
if is_seller(person):
print('seller: ', person)
else:
search_queue += graph[person]
def is_seller(person):
return person[-1] == 'm'
search('you')
<file_sep>/algorithms/quicksort_trial2.py
# quicksort
# time: 3 mins
# O(n log n)
# if n = 16: 16 * 4 = 64
def qsort(values):
if len(values) < 2:
return values
else:
pivot = values[0]
lower = [ i for i in values[1:] if i <= pivot ]
upper = [ i for i in values[1:] if i > pivot ]
return qsort(lower) + [pivot] + qsort(upper)
print(qsort([5, 3, 6, 2, 9, 22, 15]))
<file_sep>/algorithms/quicksort_trial1.py
# time:
def qsort(array):
if len(array) < 2:
return array
else:
pivot = array[0]
lower = [ i for i in array[1:] if i <= pivot ]
upper = [ i for i in array[1:] if i > pivot ]
print('current result: ',lower + [pivot] + upper)
return qsort(lower) + [pivot] + qsort(upper)
print(qsort([5, 4, 9, 3, 14, 12]))
<file_sep>/katas/chatroom.py
class Message():
def __init__(self, author, recipient, message_text):
self.author = author
self.recipient = recipient
self.message_text = message_text
class Chatroom():
"""
Represents a chatroom allowing you to record messages and show them to users.
"""
def __init__(self):
self.messages = []
def record_message(self, author, recipient, message_text):
"""
Record a mesage in the chatroom, should have format of:
{author, recipient, message_text, time}
"""
message = Message(author, recipient, message_text)
self.messages.append(message)
def get_messages(self):
"""
Return a list of all messages in the chatroom in reverse chronological order.
"""
return self.messages[::-1]
def count_messages_for_recipient(self, recipient):
"""
Return the count of the number of messages to a recipient.
"""
count = 0
for message in self.messages:
if message.recipient == recipient:
count += 1
return count
if __name__ == "__main__":
chatroom = Chatroom()
# record messages
chatroom.record_message("Jack", "Sam", "Hey buddy!")
chatroom.record_message("Sam", "Jack", "Hi there!")
chatroom.record_message("Sam", "Jack", "How much longer do you think that report will take?")
# there should now be three messages
messages = chatroom.get_messages()
assert len(messages) == 3
# the last message should be from Jack
assert messages[-1].author == "Jack"
# two of the messages should be addressed to Jack
assert chatroom.count_messages_for_recipient("Jack") == 2
print("OK")
<file_sep>/algorithms/quicksort.py
c = 0
def qsort(array):
global c
c += 1
print('c', c)
if len(array) < 2:
print('base case:', array)
return array
else:
pivot = array[0]
less = [ i for i in array[1:] if i <= pivot ]
greater = [ i for i in array [1:] if i > pivot ]
return qsort(less) + [pivot] + qsort(greater)
print(qsort([5, 7, 6, 4]))
<file_sep>/katas/dinosaurs.py
import os
'''
You will be supplied with two data files in CSV format. The first file ontains
statistics about various dinosaurs. The second file contains additional data.
Given the following formula,
speed = ((STRIDE_LENGTH / LEG_LENGTH) - 1) * SQRT(LEG_LENGTH * g)
Where g = 9.8 m/s^2 (gravitational constant)
Write a program to read in the data files from disk, it must then print the ames
of only the bipedal dinosaurs from fastest to slowest. Do not print any other nformation.
'''
#%%
def load(file1="dino_set1.csv", file2="dino_set2.csv"):
with open("_data/" + file1) as dataset1:
fields = dataset1.readline()
data = dataset1.read().splitlines()
dino = []
for line in data:
line = line.split(',')
name, leg_length, diet = line
# print(name, leg_length, diet)
print('doing', name)
dino.apend(name)
load()
#%%
# nested dictionary
dinox = {
'Euoplocephalus': { 'stride_length': 1.87, 'stance': 'quadrupedal' },
'Stegosaurus': { 'stride_length': 1.90, 'stance': 'quadrupedal'}
}
dinox
#%%
# combine both data sets into one list
def load(file1="dino_set1.csv", file2="dino_set2.csv"):
with open("_data/" + file1) as dataset1:
field_set1 = dataset1.readline()
data_set1 = dataset1.read().splitlines()
with open("_data/" + file2) as dataset2:
field_set2 = dataset2.readline()
data_set2 = dataset2.read().splitlines()
dinos = []
for set1, set2 in zip(sorted(data_set1), sorted(data_set2)):
stride_length, stance = set2.split(',')[1:]
set2 = ''.join(stride_length + ',' + stance)
line = set1 + ',' + set2
dinos.append(line)
for d in dinos:
print(d)
load()
#%%
def load_data(file1='dino_set1.csv', file2='dino_set2.csv'):
with open("_data/" + file1) as dataset1:
'''
Construct dictionary
'''
fields = dataset1.readline()
data = dataset1.read().splitlines()
dino = {}
for line in data:
line = line.split(',')
name, leg_length, diet = line
dino[name] = {}
dino
dino[Hadrosaurus]['leg_length'] = 3.4
dino[Hadrosaurus]['leg_length'] = 3.4
for field in data:
field = field.split(',')
name = field[0]
leg_length = field[1]
diet = field[2]
print(name, leg_length)
dino[name]['leg_length'] = leg_length
# dino[name]['diet'] = diet
dino['Hadrosaurus'][diet]
# dino['Hadrosaurus']['stance']
load_data('dino_set1.csv', 'dino_set1.csv')
#%%
'''
dinosaurs = {}
for line in data:
dinosaurs[name] = line[0]
dinosaurs[name][leg_length] = line[1]
dinosaurs[name][diet] = line[2]
with open(file2) as dataset2:
dataset2.readline()
data2 = dataset2.read().splitlines()
for line in data:
data = dataset1.split(',')
name = data[0]
leg_length = data[1]
diet = data[2]
speed[name] = ((stride_length / leg_length)-1) * sqr(leg_length * g)
dataset2.readline() # skip header
data = dataset2.read().splitlines()
for line in data:
data = dataset2.split(',')
name = data[0]
stride_length = data[1]
stance = data[2]
result_dict = {}
g = 9.8 m/s^2
speed = ((stride_length / leg_length) - 1) * sqr(leg_length * g)
result_dict[name]=speed
'''
# speed = ((STRIDE_LENGTH / LEG_LENGTH) - 1) * SQRT(LEG_LENGTH * g)
file1 = 'dino_set1.csv'
file2 = 'dino_set2.csv'
load_data(file1, file2)
<file_sep>/algorithms/binary_search_try.py
# time: 8 mins
def bin_search(values, target):
low = 0
high = len(values)-1
while low <= high:
mid = (low + high) // 2
guess = values[mid]
if guess == target:
return guess
if guess < target:
low = mid + 1
if guess > target:
high = mid - 1
return None
nums = [1, 3, 4, 6, 7, 9, 11, 21, 22, 23, 33, 44, 55, 65, 76, 88]
print(bin_search(nums, 65))
<file_sep>/algorithms/binary_search_try1.py
# binary search
# time: 4 mins
# O(log n)
def bin_search(values, target):
low = 0
high = len(values)
while low <= high:
mid = (low + high) // 2
guess = values[mid]
if guess == target:
return guess
if guess < target:
low = mid + 1
if guess > target:
high = mid - 1
return None
nums = [1, 3, 4, 6, 7, 9, 11, 15, 21, 45]
print(bin_search(nums, 3))
<file_sep>/README.md
## Various Endeavors and Prototypes with Python
Or, lessons, katas and experiments–– in no particular order.
*Endeavor:* *n*. An exertion of physical or intellectual strength toward the attainment of an object; a systematic or continuous attempt; an effort; a trial.
*-- from the GNU version of the Collaborative International Dictionary of English*
<file_sep>/algorithms/binary_search_trial1.py
# time: 3 mins
def search(values, target):
low = values[0]
high = len(values)
while low <= high:
mid = (low + high) // 2
guess = values[mid]
if guess == target:
return guess
if guess < target:
low = mid + 1
if guess > target:
high = mid -1
nums = [1, 4, 7, 8, 9, 11, 12, 15]
print(search(nums, 4))
<file_sep>/reloadr.py
#!/usr/bin/env python
from reloadr import autoreload
@autoreload
def function(planets):
print(list)
planets = ['earth', 'mars', 'venus']
while True:
function(planets)
<file_sep>/katas/katas.py
#%%
import os
import datetime
d = datetime
def print_name(name=None):
return name
print(print_name('ALIANA'))
names = ['zela', 'ellen', 'rick', 'jerry']
print(names)
for x in names:
print('hello ',x)
print(len(names))
now = datetime.datetime.utcnow()
print(now)
time1 = '2016-05-30 4:12'
time2 = '2016-05-31 21:12'
time_diff = datetime.timedelta(1, 5)
print(time_diff)
# %%
# Interactive JSON Objects
from IPython.display import JSON
data = {"foo": 1, "bar": 3}
JSON(data)
'a b'.swapcase()
# %%
#%%
book = {'kali': 'girl', 'jayden': 'boy'}
print(book['kali'])
#%%
# print sum of values in dict
ages = {'peter': 46, 'jayden': 6, 'ali': 8}
print(sum(ages[k] for k in ages))
#%%
# Fizzbuzz:
# match numbers that are evenly divisible by 3, by 5, and by both 3 and 5
for i in range(1, 55):
if i % 5 == 0 and i % 3 == 0:
print(i, 'fizzbuzz')
if i % 3 == 0:
print(i, 'fizz')
if i % 5 == 0:
print(i, 'buzz')
#%%
# read json
import json
with open('/Users/cornell.io/code/python/prototypes/_data/config.json') as fname:
data = json.loads(fname.read())
# print("\n".join(json))
# print(json['airports'].keys())
# print(json['airports'])
print(data['airports']['ORD'])
print(data['countries'])
#%%
# Print nums in a range but not nums in a given list
nums = range(1, 21)
list = [2, 5, 9, 6]
print([num for num in nums if num not in list])
#%%
'''
Find 2 numbers in a list that add up to a given number
[1, 2, 3, 5] => sum 8, yes
[1, 2, 3, 6] => sum 8, yes
[1, 2, 3, 6] => sum 10, no
'''
def pair_sum(nums, sum):
for i in nums:
for j in nums:
if i + j == sum:
print('%i + %i matches sum %i' % (i, j, sum))
return True
# nums = [-4, 4, 1, 2, 5, 7, 9, 10, 15, 5]
nums = [-4, 1, 3, 4, 5, 7, 9, 10, 15, 20]
pair_sum(nums, -8)
#%%
''' This solution avoids adding a number to itself '''
def pair_sum(nums, sum):
result = []
for a, b in enumerate(nums):
for x, y in enumerate(nums):
if a != x:
if b + y == sum:
result.append('%i + %i = %i' % (b, y, sum))
return result
nums = [-4, 1, 3, 4, 5, 7, 9, 10, 15, 20]
pair_sum(nums, 6)
#%%
match = False
def three_sum(nums, sum):
for _i, i in enumerate(nums):
for _j, j, in enumerate(nums):
for _k, k in enumerate(nums):
if (_i != _j != _k):
if i + j + k == sum:
match == True
print('%i + %i + %i matches sum %i' % (i, j, k, sum))
return True
nums = [-4, 3, 1, 2, 5, 9, 10, 30]
nums.index
three_sum(nums, 0)
#%%
list = [1, 3, 6, 7]
print(list.index(3))
#%%
# Use a set to remove duplicates
lst = [1, 2, 2, 3, 4, 4, 6, 7]
print(lst)
lst = set(lst)
print(lst)
#%%
''' working with files'''
import os
d = '/Users/cornell.io/code/python/_data'
print(os.listdir(d))
# d = os.listdir(d)
for a, b, c in os.walk(d):
x = [a] + [b] + [c]
for i in x:
print(i)
os.chdir(d)
print(os.stat('flights.json'))
#%%
''' List just .log files in cwd'''
import os
def list_ext(path=None):
if path == None:
path = os.getcwd()
return [ fname for fname in os.listdir(path)
if os.path.isfile(fname)
if fname.endswith('.log') ]
print(list_ext())
# print(list_py('/Users/cornell.io/code/python/_data'))
#%%
'''
Find the int that appears an odd number of times.There will always beonly one integer that appears an odd number of times.
'''
def find_it(seq):
freq = {}
for n in seq:
if n in freq:
freq[n] += 1
else:
freq[n] = 1
result = 0
for k, v in freq.items():
if v % 3 == 0:
result += k
return freq, result
arr = [20,1,-1,2,-2,3,3,5,5,1,2,20,4,-1,-2,5]
find_it(arr)
#%%
# better solution
def find_it(array):
odds = []
for i in array:
if array.count(i) % 3 == 0:
odds.append(i)
return sorted(odds)
arr = [7,7,20,1,-1,2,-2,3,3,5,5,1,2,4,4,4,20,4,-1,-2,5,3]
find_it(arr)
#%%
'''
take any non-negative integer as a argument and return it with it's digits in descending order. Essentially, rearrange the digits to create the highest possible number.
'''
def Descending_Order(num):
return "".join(sorted(str(num), reverse=True))
num = 13454
print(Descending_Order(num))
#%%
def longest(s1, s2):
if len(s1) > len(s2):
string = s1
else:
string = s2
list = [s for s in sorted(string)]
return ''.join(set(list))
print(longest("aretheyhere", "yestheyarehere"))
print(longest("loopingisfunbutdangerous", "lessdangerousthancoding"))
print(longest("inmanylanguages", "theresapairoffunctions"))
#%%
'''Given two arrays a and b write a function comp(a, b) (compSame(a, b) in Clojure) that checks whether the two arrays have the "same" elements, with the same multiplicities. "Same" means, here, that the elements in b are the elements in a squared, regardless of the order.
'''
def comp(array1, array2):
array1_sq = [ e ** 2 for e in array1 ]
array1 = sorted(array1_sq)
array2 = sorted(array2)
return array1 == array2
a1 = [4, 3, 9]
a2 = [9, 16, 81]
print(comp(a1, a2))
#%%
'''
return a new list with strings filtered out
'''
def filter_list(list):
alphabet = 'abcdefghijklmnopqrstuvwxyz'
list = [str(i).strip(alphabet) for i in list] # empty elements are left in place of the stripped strings
# Create new list of ints from old list with empty elements skipped
filtered_list = [int(list[i]) for i in range(0, len(list)-1) if list[i] != ""]
return filtered_list
print(filter_list([1,2,5,'a', 'b', 'def', 8]))
#%%
l = [1,2,'aasf','1','123',123]
l = [1,2,123]
for c in l:
print(c)
alist = []
for e in l:
x = str(e)
alist.append(x)
# alist = [ str(e.strip('abcdefg')) for e in l]
alist
#%%
def add_binary(a,b):
return bin(a + b).lstrip('0b')
print(add_binary(21, 34))
#%%
def maskify(cc):
''' change all but the last four characters into '#' '''
slice1 = cc[0:-4]
slice2 = cc[-4:]
masked_slice = ""
for c in slice1:
masked_slice += '#'
return masked_slice + slice2
maskify("1234533322233")
#%%
''' better solution '''
def maskify(cc):
return "#"*(len(cc)-4) + cc[-4:]
maskify("1332766-34-22233")
#%%
def small(numbers):
return sorted(numbers)[:2]
print(small([3, 9, 21,5,4,8]))
#%%
'''Accumulator. Multiply chars of a given string and add dashes'''
def accum(s):
# Create list with repeated chars
result = [ s[i]*(i+2) for i in range(0, len(s)) ]
result = [ i.title() for i in result ]
return "-".join(result)
accum("OPTIMIZE") # "A-Bb-Ccc-Dddd"
accum("RqaEzty") # "R-Qq-Aaa-Eeee-Zzzzz-Tttttt-Yyyyyyy"
accum("pussyf") # "C-Ww-Aaa-Tttt"
#%%
'''Weird Case. Every other char is capitalized'''
def weird_case(string):
lst = [c for c in string]
result = []
for i in range(0, len(lst)):
if i % 2 == 0:
result.append(lst[i].upper())
else:
result.append(lst[i])
return "".join(result)
print(weird_case('Martinis and skirts'))
#%%
''' Sort words by the number inside the words '''
def order(sentence):
result = sorted(sentence.split(),
key=lambda word: [c for c in word if c.isdigit()])
return " ".join(result)
order("is6 Thi1s Tre55le 7elevator 31Einstein")
#%%
'''Complete the method/function so that it converts dash/underscore delimited words into camel casing. The first word within the output should be capitalized only if the original word was capitalized.'''
import re
def to_camel_case(words):
if words == "":
return ""
else:
words = re.split("[-_]", words)
# Convert words to title case, slicing [1:] to skip first element
return words[0] + ''.join([i.title() for i in words[1:]])
to_camel_case("The-Stealth_Warrior")
# to_camel_case("the_stealth_warrior"), "theStealthWarrior"
# to_camel_case("The-Stealth-Warrior"), "TheStealthWarrior"
#%%
'''
Alpha Map
Given a string, replace every letter with its position in the alphabet.
If anything in the text isn't a letter, ignore it and don't return it. '''
# Create hash of letters to numbers for the alphabet
def alpha_map(letter):
count = 0
letter_map = {}
alpha = 'abcdefghijklmnopqrstuvwxyz'
for c in alpha:
count += 1
letter_map[c] = count
return letter_map[letter]
def alphabet_position(text):
positions = [str(alpha_map(c)) for c in text.lower() if c.isalpha()]
return " ".join(positions)
print(alphabet_position("alphax0x0x0beta"))
#%%
''' Shorter solution to above using the ord() function to get ordinal value'''
def alphabet_position(text):
return ' '.join(str(ord(c) - 96) for c in text.lower() if c.isalpha())
print(alphabet_position("t'_+sabeta"))
#%%
def sort_by_num(words):
return sorted(words.split(), key=lambda w:[c for c in w if c.isdigit()])
print(sort_by_num('all3 four4 th2e r1ace'))
#%%
'''
Count the number of Duplicates
Write a function that will return the count of distinct case-insensitive alphabetic characters and numeric digits that occur more than once in the input string. The input string can be assumed to contain only alphabets (both uppercase and lowercase) and numeric digits.
'''
def wcount(word):
letters = {}
result = []
for c in word.lower():
if c in letters:
letters[c] += 1
else:
letters[c] = 1
for k, v in letters.items():
if v > 1:
result.append("'%s' occurs %i times" % (k, v))
return "\n".join(result)
print(wcount("Indivisibilities"))
# print('gamma'.count('g'))
#%%
def word_count(word):
letters = {}
result = []
for c in word.lower():
if c in letters:
letters[c] += 1
else:
letters[c] = 1
for k, v in letters.items():
if v > 1:
result.append((k, v))
return result
print(word_count("sexx"))
#%%
'''Middle Earth is about to go to war. The forces of good will have many battles with the forces of evil. Different races will certainly be involved. Each race has a certain 'worth' when battling against others. On the side of good we have the following races, with their associated worth:
Hobbits - 1
Men - 2
Elves - 3
Dwarves - 3
Eagles - 4
Wizards - 10
evil:
Orcs - 1
Men - 2
Wargs - 2
Goblins - 2
Uruk Hai - 3
Trolls - 5
Wizards - 10
Input:
The function will be given two parameters. Each parameter will be a string separated by a single space. Each string will contain the count of each race on the side of good and evil.
ex: goodVsEvil('0 0 0 0 0 10', '0 1 1 1 1 0 0')
Return ""Battle Result: Good triumphs over Evil" if good wins, "Battle Result: Evil eradicates all trace of Good" if evil wins, or "Battle Result: No victor on this battle field" if it ends in a tie.
'''
ref goodVsEvil(good, evil):
good = good.split()
values_good = [1, 2, 3, 3, 4, 10]
evil = evil.split()
values_evil = [1, 2, 2, 2, 3, 5, 10]
points_good = 0
for i in range(0, len(good)):
points_good += int(good[i]) * values_good[i]
points_evil = 0
for i in range(0, len(evil)):
points_evil += int(evil[i]) * values_evil[i]
if points_good > points_evil:
return "Battle Result: Good triumphs over Evil"
elif points_good < points_evil:
return "Battle Result: Evil eradicates all trace of Good"
else:
return "Battle Result: No victor on this battle field"
print(goodVsEvil('0 0 0 0 0 1', '0 0 0 0 0 3'))
#%%
# Alternate solution using zip():
def good_evil(good, evil):
points_good = [1, 2, 3, 3, 4, 10]
points_evil = [1, 2, 2, 2, 3, 5, 10]
good = sum([int(x)*y for x, y in zip(good.split(), points_good)])
evil = sum([int(x)*y for x, y in zip(evil.split(), points_evil)])
result = 'Battle Result: '
evil_wins = result + 'Evil eradicates all trace of Good'
good_wins = result + 'Good triumphs over Evil'
draw = result + 'No victor on this battle field'
# return good_wins if good > evil evil_wins if good < evil else draw
if good < evil:
return result + 'Evil eradicates all trace of Good'
elif good > evil:
return result + 'Good triumphs over Evil'
else:
return result + 'No victor on this battle field'
print(good_evil('0 0 0 0 0 1', '0 0 0 0 0 3'))
#%%
# using zip function
x = [1, 2, 3]
y = [4, 5, 6]
z = [7, 8, 9]
# z = zip(x, y)
zsum = [i for i in z]
print(zsum)
zzsum = [x+y+z for x, y, z in zip(x, y, z)]
print(zzsum)
#%%
xsum = [x+y for x, y in zip(x, y)]
print(xsum)
# for i in z:
# print(i)
#%%
'''Write some pseudo code to raise a number to a power.'''
def power(xx, y):
return xx ** y
print(power(12, 4))
#%%
'''
Write a function that accepts an array of 10 integers (between 0 and 9), that returns a string of those numbers in the form of a phone number.
create_phone_number([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) # =>
returns "(123) 456-7890"'''
def create_phone_number(n):
g1 = ""
g2 = ""
g3 = ""
for i in n[0:3]:
g1 += str(i)
for i in n[3:6]:
g2 += str(i)
for i in n[6:10]:
g3 += str(i)
return '(' + g1 + ') ' + g2 + '-' + g3
# print(g1 + g2 + g3)
create_phone_number([1, 2, 3, 4, 5, 6, 7, 8, 9, 0])
#%%
'''Algorithm to find 3 integers adding up to 0'''
def zero_sum(values):
values = sorted(values)
for i in range(0, len(values)-2):
print(values[i], values[i+1], values[i+2])
if values[i] + values[i+1] + values[i+2] == 0:
return True
print(zero_sum([-4, 13, 3, 4, 1, 8, 21]))
#%%
|
f21e93208e268c831b44645561e5525236bb2399
|
[
"Markdown",
"Python"
] | 32 |
Python
|
Cornellio/prototypes
|
07f2c0b154b086386e54194123fbbd96b998eadd
|
5f893e33a62489eb0fb3bc555609645a68113991
|
refs/heads/master
|
<repo_name>EpicCrisis/GPS1-534<file_sep>/README.md
# GPS1-534
//Cool sample text
<file_sep>/Assets/Scripts/Spaceship.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Spaceship : MonoBehaviour {
public GameObject bullet; //reference to bullet prefab
public Vector3 velocity;
public float shipSpeed = 8f;
public float rotSpeed = 15f;
public Crosshair crosshair;
public Vector3 direction;
void Awake()
{
Debug.Log ("I Have Awaken");
}
void OnEnable()
{
Debug.Log ("Activating Systems");
}
// Use this for initialization
void Start () {
Debug.Log ("Let's Get Started!");
}
// Update is called once per frame
void Update () {
Orientation ();
Movement ();
Firing ();
/*
if (Input.GetKey (KeyCode.UpArrow)) {
this.transform.Translate (Vector3.up * Time.deltaTime * shipSpeed);
}
if (Input.GetKey (KeyCode.DownArrow)) {
this.transform.Translate (Vector3.down * Time.deltaTime * shipSpeed);
}
if (Input.GetKey (KeyCode.LeftArrow)) {
this.transform.Translate (Vector3.left * Time.deltaTime * shipSpeed);
}
if (Input.GetKey (KeyCode.RightArrow)) {
this.transform.Translate (Vector3.right * Time.deltaTime * shipSpeed);
}
if (Input.GetKeyDown (KeyCode.Space)) {
Instantiate (bullet, this.transform.position, this.transform.rotation);
}
*/
}
void Orientation()
{
Vector3 direction = crosshair.worldMousePos - this.transform.position;
direction.z = 0f;
transform.LookAt (transform.forward + transform.position, direction);
/*
direction = crosshair.transform.position - this.transform.position;
direction.Normalize ();
float angle = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg;
this.transform.rotation = Quaternion.Lerp (transform.rotation, Quaternion.Euler (0, 0, angle - 90), Time.deltaTime * rotSpeed);
*/
}
void Movement()
{
velocity.x = Input.GetAxis ("Horizontal");
velocity.y = Input.GetAxis ("Vertical");
this.transform.Translate (velocity * Time.deltaTime * shipSpeed, Space.World);
//this.transform.Translate(Input.GetAxis ("Horizontal"));
}
void Firing()
{
if (Input.GetButton ("Fire1")) {
Instantiate (bullet, this.transform.position, this.transform.rotation);
}
}
}
|
e09693bfcad393584260de5452fa3d6ae43ee112
|
[
"Markdown",
"C#"
] | 2 |
Markdown
|
EpicCrisis/GPS1-534
|
cca11bdac413d73730b99eb42d5e91f983eda65c
|
dd55989346c4ec5de8c3153f77403b39c9b9a37e
|
refs/heads/master
|
<file_sep>import React, {useEffect, useState} from "react";
import Card from "@material-ui/core/Card/Card";
import CardContent from "@material-ui/core/CardContent/CardContent";
import Typography from "@material-ui/core/Typography/Typography";
import CardActions from "@material-ui/core/CardActions/CardActions";
import Button from "@material-ui/core/Button/Button";
import styled from "styled-components";
import {navigate} from "@reach/router";
import {getAllCourses} from "../../services/CoursesApi";
import ControlPoint from "@material-ui/icons/ControlPoint";
import Container from "../../components/Container";
import ArrowForward from "@material-ui/icons/ArrowForward";
const ContainerDiv = styled.div`
&& {
display: flex;
justify-content: center;
flex-wrap: wrap;
}
`;
const StyledCardContent = styled(CardContent)`
&&{
display:flex;
justify-content: stretch;
flex: 1 0 auto;
align-items: center;
flex-direction: column;
}
`;
const AddCourseCard = styled(Card)`
&& {
flex:1 0 26%;
margin-right: 20px;
margin-top: 20px;
border: 0.5px solid orange;
background-color: lightgoldenrodyellow;
display: flex;
align-items: center;
justify-content: center;
}
`;
const StyledCard = styled(Card)`
&& {
flex:1 0 26%;
margin-right: 20px;
margin-top: 20px;
border: 0.5px solid orange;
background-color: lightgoldenrodyellow;
height: 160px;
position: relative;
}
`;
function Courses(props) {
const [courses, setCourses] = useState(null);
useEffect(() => {
getAllCourses("").then(res => setCourses(res))
}, []);
console.log(courses);
const handleClick = event => {
event.preventDefault();
navigate('/courses/create');
};
return (
<div style={{width: 960}}>
<Container>
<h2 style={{fontFamily: 'arial'}}> COURSES </h2>
<ContainerDiv>
{props.value && <AddCourseCard onClick={handleClick}>
<StyledCardContent>
<Typography variant={"title"} gutterBottom>
Add Course
</Typography>
<ControlPoint width={40} height={40}/>
</StyledCardContent>
</AddCourseCard>}
{courses && courses.map((course, key) =>
<StyledCard key={key}>
<CardContent>
<Typography variant={"title"} gutterBottom>
{course.name}
</Typography>
<Typography style={{paddingTop:5}} component="p" noWrap>
{course.description}
</Typography>
</CardContent>
<CardActions style={{position:'absolute',bottom:'0'}}>
<Button style={{color:'orange', fontWeight:'bold'}} size="small" onClick={() => navigate(`courses/${course.id}`)}>Details <ArrowForward/> </Button>
</CardActions>
</StyledCard>
)}
</ContainerDiv>
</Container>
</div>
)
}
export default Courses<file_sep>package com.awd.courses.courses_backend.repository;
import com.awd.courses.courses_backend.model.Course;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface CourseRepository extends JpaRepository<Course, Integer> {
List<Course> findByNameContaining(String name);
}
<file_sep>import axios from 'axios'
async function attachFile(data) {
return axios.post(`/api/courseFiles`, data)
}
async function downloadFile(id){
return axios.get(`/api/courseFiles/${id}`)
}
export {attachFile, downloadFile}<file_sep>import React from "react";
import {navigate} from "@reach/router";
function pom(props) {
navigate(`/courses/${props.courseId}`);
return (
<div>
<h1>hi</h1>
</div>
)
}
export default pom<file_sep>package com.awd.courses.courses_backend.model.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CommentDetailsDto {
private String comment;
private String author;
private int courseId;
}
<file_sep>import styled from 'styled-components'
import React from "react";
const ContainerDiv = styled.div`
&& {
display: flex;
justify-content: center;
align-self: center;
flex-direction: column;
height: 78vh;
}
`;
function Container(props) {
return (
<ContainerDiv>
{props.children}
</ContainerDiv>
)
}
export default Container<file_sep>import axios from 'axios';
async function getAllCourses(query) {
return axios.get(`/api/courses?query=${query}`)
.then(response => {
return response.data
})
.catch(error => console.log(error))
}
async function getCoursesByName(name) {
return axios.get(`/api/courses/${name}`, name)
.then(response => {
return response.data
})
.catch(err => console.log(err))
}
async function getCourseById(id) {
return axios.get(`/api/courses/${id}/details`)
.then(res => res.data)
.catch(err => console.log(err));
}
async function createCourse(course) {
return axios.post(`/api/courses`, course)
.then(res => {
return res.data
})
.catch(err => console.log(err))
}
export {getAllCourses, getCoursesByName, getCourseById,createCourse}<file_sep>import React, {Component} from 'react';
import './App.css';
import {LocationProvider, Router} from "@reach/router";
import Dashboard from "./pages/Dashboard";
import Footer from "./components/Footer";
import styled from "styled-components";
import Header from "./components/Header";
import RegisterPage from "./pages/RegisterPage";
import LoginPage from "./pages/LoginPage";
import Courses from "./pages/courses/CoursesPage";
import CreateCourse from "./pages/courses/CreateCoursePage";
import CourseDetails from "./pages/courses/CourseDetailsPage";
import POm from "./pages/courses/POm";
const Container = styled.div`
&& {
margin: 0 auto;
display: flex;
justify-content: center;
max-width: 960px;
padding-top: 20px;
padding-bottom: 20px;
}
`;
class App extends Component {
constructor(props) {
super(props);
this.state= {
loginData: undefined
};
this.setLoginStatus = this.setLoginStatus.bind(this);
}
setLoginStatus(data) {
this.setState({loginData: data});
console.log(this.state.loginData);
}
render() {
console.log("Testing", this.state.loginData);
return (
<div className="main-container">
<Header value={this.state.loginData} logout={this.setLoginStatus} />
<Container>
<LocationProvider>
<Router>
<Dashboard value={this.state.loginData} path="/"/>
<RegisterPage path="/register"/>
<LoginPage login={this.setLoginStatus} path="/login"/>
<Courses value={this.state.loginData} path="/courses"/>
<CourseDetails value={this.state.loginData} path="/courses/:courseId"/>
<CreateCourse value={this.state.loginData} path="/courses/create"/>
<POm path="/pom/:courseId"/>
</Router>
</LocationProvider>
</Container>
<Footer/>
</div>
);
}
}
export default App;
<file_sep>package com.awd.courses.courses_backend.service.converter;
import com.awd.courses.courses_backend.model.Comment;
import com.awd.courses.courses_backend.model.Course;
import com.awd.courses.courses_backend.model.dto.CommentDetailsDto;
import com.awd.courses.courses_backend.model.dto.CourseDetails;
import com.awd.courses.courses_backend.model.dto.CourseFileDto;
import com.awd.courses.courses_backend.service.CourseFileService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class CourseConverter {
private final CommentConverter commentConverter;
private final CourseFileService courseFileService;
public CourseConverter(CommentConverter commentConverter, CourseFileService courseFileService) {
this.commentConverter = commentConverter;
this.courseFileService = courseFileService;
}
public CourseDetails toCourseDetails(Course course, List<Comment> comments) {
List<CommentDetailsDto> commentDetailsDtos = comments.stream()
.map(commentConverter::toCommentDetails)
.collect(Collectors.toList());
List<CourseFileDto> courseFiles = courseFileService.getFiles(course.getId());
return CourseDetails.builder()
.id(course.getId())
.name(course.getName())
.description(course.getDescription())
.year(course.getYear())
.comments(commentDetailsDtos)
.courseFiles(courseFiles)
.build();
}
}
<file_sep>import React, {useState} from "react";
import TextField from "@material-ui/core/TextField/TextField";
import Button from "@material-ui/core/Button/Button";
import styled from 'styled-components';
import Container from "../components/Container";
import Fieldset from "../components/Fieldset";
import {loginStudent} from "../services/StudentApi";
import {Link, navigate} from "@reach/router";
const Field = styled(TextField)`
&& {
margin-top: 20px;
}
`;
function LoginPage(props) {
const [loginValues, setLoginValues] = useState({
username:'',
password:'',
});
const handleChange = name => event => {
setLoginValues({...loginValues, [name]: event.target.value});
};
const handleSubmit = event => {
event.preventDefault();
loginStudent(loginValues.username, loginValues.password)
.then(res=> {
console.log(res);
props.login(loginValues.username);
navigate('/');
});
};
return (
<Container>
<h3 style={{fontFamily: 'arial', textAlign: 'center'}}>LOGIN</h3>
<form onSubmit={handleSubmit}>
<Fieldset>
<legend>Credentials</legend>
<TextField fullWidth label="Username" value={loginValues.username} style={{marginTop:10}} onChange={handleChange('username')}/>
<Field fullWidth label="Password" value={loginValues.password} type="password" onChange={handleChange('password')}/>
<div style={{display: 'flex', justifyContent: 'center', marginTop: 15}}>
<Button variant="contained" color="primary" type="submit"> Login </Button>
</div>
</Fieldset>
</form>
<p style={{paddingTop:10}}>Dont have an account, Register <Link to='/register' style={{color:'blue', cursor:'pointer'}}> here </Link></p>
</Container>
)
}
export default LoginPage;<file_sep>package com.awd.courses.courses_backend.controller;
import com.awd.courses.courses_backend.model.Comment;
import com.awd.courses.courses_backend.model.dto.CommentDetailsDto;
import com.awd.courses.courses_backend.model.dto.CommentDto;
import com.awd.courses.courses_backend.service.CommentService;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
@RestController
@RequestMapping("/api/comments")
public class CommentController {
private final CommentService commentService;
public CommentController(CommentService commentService) {
this.commentService = commentService;
}
@GetMapping
public List<Comment> getCommentsForCourse(@RequestParam("courseId") int courseId) {
return commentService.getCommentsByCourse(courseId);
}
@PostMapping
public CommentDetailsDto postComment(@RequestBody @Valid CommentDto commentDto, Authentication authentication) {
return commentService.postComment(commentDto, authentication);
}
}
<file_sep>package com.awd.courses.courses_backend.service;
import com.awd.courses.courses_backend.model.Comment;
import com.awd.courses.courses_backend.model.Course;
import com.awd.courses.courses_backend.model.dto.CourseDetails;
import com.awd.courses.courses_backend.repository.CourseRepository;
import com.awd.courses.courses_backend.service.converter.CourseConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
@Service
public class CourseService {
private final Logger log = LoggerFactory.getLogger(CourseService.class);
private final CourseRepository repository;
private final CourseConverter courseConverter;
private final CommentService commentService;
public CourseService(CourseRepository repository, CourseConverter courseConverter, CommentService commentService) {
this.repository = repository;
this.courseConverter = courseConverter;
this.commentService = commentService;
}
public Optional<Course> getCourse(int id) {
log.info("Getting course with id: [{}]", id);
return repository.findById(id);
}
public Optional<CourseDetails> getCourseDetails(int id) {
List<Comment> comments = commentService.getCommentsByCourse(id);
return getCourse(id).map(course -> courseConverter.toCourseDetails(course, comments));
}
public List<Course> getCoursesByName(String name) {
log.info("Finding courses by name query: [{}]", name);
return repository.findByNameContaining(name);
}
public Course addCourse(Course course) {
log.info("Saving course: [{}]", course.getName());
return repository.save(course);
}
}
<file_sep>package com.awd.courses.courses_backend.model;
import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.Collection;
import java.util.Collections;
@Getter
public class StudentUserDetails implements UserDetails {
private final Student student;
public StudentUserDetails(Student student) {
this.student = student;
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return Collections.singletonList(new SimpleGrantedAuthority("STUDENT"));
}
@Override
public String getPassword() {
return student.<PASSWORD>();
}
@Override
public String getUsername() {
return student.getUsername();
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return true;
}
}
<file_sep>import axios from 'axios'
async function createComment(comment) {
axios.post(`/api/comments`, comment)
.then(res=> res.data)
.catch(err => console.log(err))
}
export {createComment}<file_sep>package com.awd.courses.courses_backend.model.dto;
import com.awd.courses.courses_backend.annotations.PasswordConfirmed;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@PasswordConfirmed
public class RegisterStudentDto {
@NotNull
@NotEmpty
private String username;
@NotNull
@NotEmpty
private String password;
@NotNull
@NotEmpty
private String confirmPassword;
@NotNull
@NotEmpty
private String firstName;
@NotNull
@NotEmpty
private String lastName;
}
<file_sep>package com.awd.courses.courses_backend.config;
import com.awd.courses.courses_backend.service.StudentService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@Configuration
public class SecurityConfig {
@Configuration
public static class StudentSecurityConfig extends WebSecurityConfigurerAdapter {
private final AuthenticationSuccessHandler successHandler;
private final AuthenticationFailureHandler failureHandler;
private final LogoutSuccessHandler logoutSuccessHandler;
private final AuthenticationEntryPoint authenticationEntryPoint;
private final PasswordEncoder passwordEncoder;
private final StudentService studentService;
public StudentSecurityConfig(AuthenticationSuccessHandler successHandler,
AuthenticationFailureHandler failureHandler,
LogoutSuccessHandler logoutSuccessHandler,
AuthenticationEntryPoint authenticationEntryPoint,
PasswordEncoder passwordEncoder, StudentService studentService) {
this.successHandler = successHandler;
this.failureHandler = failureHandler;
this.logoutSuccessHandler = logoutSuccessHandler;
this.authenticationEntryPoint = authenticationEntryPoint;
this.passwordEncoder = passwordEncoder;
this.studentService = studentService;
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(studentService).passwordEncoder(passwordEncoder);
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.httpBasic().disable()
.exceptionHandling()
.authenticationEntryPoint(authenticationEntryPoint);
http.authorizeRequests()
.antMatchers(HttpMethod.POST, "/api/courses").hasAuthority("STUDENT")
.antMatchers(HttpMethod.POST, "/api/comments").hasAuthority("STUDENT")
.antMatchers(HttpMethod.POST, "/api/courseFiles").hasAuthority("STUDENT")
.antMatchers("/api/**").permitAll()
.anyRequest().authenticated()
.and()
.formLogin()
.loginProcessingUrl("/api/students/login")
.successHandler(successHandler)
.failureHandler(failureHandler)
.usernameParameter("username")
.passwordParameter("<PASSWORD>")
.permitAll()
.and()
.logout()
.logoutUrl("/api/students/logout")
.logoutSuccessHandler(logoutSuccessHandler)
.deleteCookies("JSESSIONID")
.permitAll()
.and()
.headers().frameOptions().disable();
}
}
@Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@Bean
public AuthenticationSuccessHandler getSuccessHandler() {
return (request, response, authentication) -> response.setStatus(HttpStatus.OK.value());
}
@Bean
public AuthenticationFailureHandler failureHandler() {
return (request, response, exception) -> response.setStatus(HttpStatus.UNAUTHORIZED.value());
}
@Bean
public LogoutSuccessHandler logoutSuccessHandler() {
return (request, response, authentication) ->
response.setStatus(HttpStatus.OK.value());
}
@Bean
public AuthenticationEntryPoint authenticationEntryPoint() {
return new AuthenticationEntryPoint() {
/**
* Always returns a 401 error code to the client.
*/
@Override
public void commence(HttpServletRequest request,
HttpServletResponse response,
AuthenticationException authenticationException) throws IOException {
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Access Denied");
}
};
}
}
<file_sep>package com.awd.courses.courses_backend.service.validator;
import com.awd.courses.courses_backend.annotations.PasswordConfirmed;
import com.awd.courses.courses_backend.model.dto.RegisterStudentDto;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.util.Objects;
public class PasswordConfirmedValidator implements ConstraintValidator<PasswordConfirmed, RegisterStudentDto> {
@Override
public void initialize(PasswordConfirmed constraintAnnotation) {
}
@Override
public boolean isValid(RegisterStudentDto registerStudentDto, ConstraintValidatorContext constraintValidatorContext) {
return registerStudentDto != null &&
Objects.equals(registerStudentDto.getPassword(), registerStudentDto.getConfirmPassword());
}
}
<file_sep>import React from "react";
import {Nav, Navbar, NavDropdown} from "react-bootstrap";
import Logo from '../assets/20170919-kako-da-se-snajdete-na-finki-m.jpg';
import styled from 'styled-components';
import {Link, navigate} from "@reach/router";
import {logout} from "../services/StudentApi";
import Account from "@material-ui/icons/AccountCircle";
const RoundedImage = styled.img`
&&{
border-radius: 50px;
cursor: pointer;
}
`;
function Header(props) {
const userLogut = () => {
logout().then(res => {
props.logout(undefined);
navigate('/');
})
};
return (
<Navbar collapseOnSelect expand="lg" bg="dark" variant="dark">
<Link to="/"><RoundedImage src={Logo} width={34} height={30} alt="logo"/> </Link>
<Navbar.Brand style={{fontFamily: 'arial', cursor: 'pointer', paddingLeft: 5}}
onClick={() => navigate('/')}>
COURSES
</Navbar.Brand>
<Navbar.Toggle aria-controls="respon>
av"/>
<Navbar.Collapse id="responsive-navbar-nav">
<Nav className="mr-auto">
<Link className="nav-link" to="/"> Home </Link>
<Link className="nav-link" to="/courses"> Courses </Link>
<NavDropdown title="Links" id="collasible-nav-dropdown">
<NavDropdown.Item href="https://finki.ukim.mk/">Finki Site</NavDropdown.Item>
<NavDropdown.Item href="http://courses.finki.ukim.mk/">Finki Courses</NavDropdown.Item>
<NavDropdown.Item href="http://finki.iknow.ukim.edu.mk/">Finki Iknow</NavDropdown.Item>
<NavDropdown.Divider/>
<NavDropdown.Item href="https://stackoverflow.com/">Stack Overflow</NavDropdown.Item>
</NavDropdown>
</Nav>
<Nav>
{props.value ? <>
<Nav.Link> <Account/><span
style={{paddingLeft: 3}}>{props.value.toUpperCase()}</span></Nav.Link>
<Nav.Link onClick={userLogut}> Logout </Nav.Link>
</> :
<>
<Link to='/login' className="nav-link"> Login</Link>
<Link to='/register' className="nav-link"> Register</Link>
</>}
</Nav>
</Navbar.Collapse>
</Navbar>
)
}
export default Header<file_sep>import React from "react";
import {Navbar} from "react-bootstrap";
import styled from 'styled-components';
import Logo from '../assets/finki_52_1_2_1_62_0.png';
const StyledFooter = styled.div`
position: absolute;
bottom: 0;
width: 100%;
`;
const StyledNavbar = styled(Navbar)`
&& {
height: 60px;
}
`
function Footer() {
return (
<StyledFooter>
<StyledNavbar collapseOnSelect expand="lg" bg="dark" variant="dark">
<Navbar.Brand href="/" style={{paddingLeft:10, fontFamily:'arial'}}><NAME> <br/> <span style={{textAlign:'center'}}><NAME></span></Navbar.Brand>
<Navbar.Brand className="mx-auto" style={{paddingLeft:10}}>
<img src={Logo} height={140} width={220} alt="Finki"/>
</Navbar.Brand>
<div className="mr-2">
<a style={{paddingRight: '7px'}} href="/"><i className="fa fa-facebook-official fa-2x"/></a>
<a style={{paddingRight: '7px'}} href="/"><i className="fa fa-pinterest-p fa-2x"/></a>
<a style={{paddingRight: '7px'}} href="/"><i className="fa fa-twitter fa-2x"/></a>
<a style={{paddingRight: '7px'}} href="/"><i className="fa fa-flickr fa-2x"/></a>
<a style={{paddingRight: '7px'}} href="/"><i className="fa fa-linkedin fa-2x"/></a>
</div>
</StyledNavbar>
</StyledFooter>
)
}
export default Footer;<file_sep>import React, {useEffect, useState} from "react";
import styled from 'styled-components';
import {getCourseById} from "../../services/CoursesApi";
import TextField from "@material-ui/core/TextField/TextField";
import Button from "@material-ui/core/Button/Button";
import {createComment} from "../../services/CommentsApi";
import AddComment from "@material-ui/icons/AddComment"
import CommentIcon from "@material-ui/icons/Comment"
import List from "@material-ui/core/List/List";
import ListItem from "@material-ui/core/ListItem/ListItem";
import ListItemAvatar from "@material-ui/core/ListItemAvatar/ListItemAvatar";
import Avatar from "@material-ui/core/Avatar/Avatar";
import ListItemText from "@material-ui/core/ListItemText/ListItemText";
import {Link, navigate} from "@reach/router";
import AttachFile from "@material-ui/icons/AttachFile";
import Attachment from "@material-ui/icons/Attachment";
import {attachFile} from "../../services/CourseFilesApi";
import {Paper} from "@material-ui/core";
import ArrowBack from "@material-ui/icons/ArrowBack";
const ContainerDiv = styled.div`
display: flex;
width: 1000px;
min-height: 75vh;
font-family: Arial;
flex-direction: column;
`;
const Left = styled(Paper)`
&& {
padding-top: 20px;
padding-left: 20px;
width: 70%;
}
`;
const BackButton = styled(Button)`
&& {
border-radius: 25px;
background-color: orange;
min-width:30px !important;
height: 30px;
padding:5px;
color: white;
}
&:hover {
color: orange;
background-color: white;
}
`;
const Right = styled(Paper)`
&& {
background-color: lightgoldenrodyellow;
padding-top: 20px;
padding-left: 20px;
width: 30%;
}
`;
function CourseDetails(props) {
const [course, setCourse] = useState({});
const [comment, setComment] = useState({
comment: '',
courseId: props.courseId,
}
);
const [file, setFile] = useState(null);
useEffect(() => {
getCourseById(props.courseId)
.then(res => setCourse(res))
}, []);
const handleChange = name => event => {
setComment({...comment, [name]: event.target.value});
};
const postComment = event => {
event.preventDefault();
createComment(comment).then(res => {
navigate(`/pom/${props.courseId}`);
})
};
const postFile = event => {
event.preventDefault();
const data = new FormData();
data.append('file', file);
data.append('courseId', props.courseId);
attachFile(data, props.courseId).then(res => {
navigate(`/pom/${props.courseId}`);
})
};
const handleFileChange = event => {
event.preventDefault();
setFile(event.target.files[0])
};
const handleBack = event => {
event.preventDefault();
navigate('/courses')
};
return (
<ContainerDiv>
<div style={{display: 'flex'}}><BackButton variant="contained" onClick={handleBack}>
<ArrowBack/></BackButton> <h3
style={{fontFamily: 'arial', paddingLeft:10}}>CREATE COURSE</h3></div>
{course && <div style={{display: 'flex'}}>
<Left>
<h3 style={{textAlign: 'center'}}>{course.name}</h3>
<hr width="35%"/>
<div style={{ fontFamily:'arial', wordWrap: 'break-word', paddingTop:20}}><p>{course.description}</p> <hr/></div>
<div>
<h4>Comment Section</h4>
<List>
{course.comments && course.comments.map((e, key) =>
<ListItem key={key}>
<ListItemAvatar>
<Avatar>
<CommentIcon/>
</Avatar>
</ListItemAvatar>
<ListItemText
primary={e.comment}
secondary={`Author: ${e.author}`}
/>
</ListItem>
)}
</List>
</div>
{props.value ? <form style={{width: 610}}>
<p> Write something for this course </p>
<TextField fullWidth label={"Comment"} variant={"outlined"} multiline rows={4}
onChange={handleChange('comment')}/>
<Button type="submit" onClick={postComment}> <AddComment/> Send Comment </Button>
</form> : <h4><Link to='/login'>Login</Link> to insert a comment</h4>}
</Left>
<Right>
<div>
<h4>Files</h4>
{course.courseFiles && course.courseFiles.length === 0 ? <p style={{paddingTop:10}}>No Files for this Course</p> : "" }
<List style={{wordWrap: 'break-word'}}>
{course.courseFiles && course.courseFiles.map((e, key) =>
<ListItem>
<ListItemAvatar>
<Avatar>
<Attachment/>
</Avatar>
</ListItemAvatar>
<a style={{paddingLeft: 5, wordWrap: 'break-word', width: 215}}
href={`api/courses/${e.fileId}`} download={e.fileName}> {e.fileName}</a>
</ListItem>
)}
</List>
</div>
{props.value && <form>
<p> Add Attachment for this Course</p>
<input type="file" onChange={handleFileChange} style={{width:215}}/>
<Button type="submit" onClick={postFile}> <AttachFile/> Send Attachment </Button>
</form>}
</Right>
</div>}
</ContainerDiv>
)
}
export default CourseDetails;<file_sep>import React, {useState} from "react";
import Fieldset from "../components/Fieldset";
import TextField from "@material-ui/core/TextField/TextField";
import Button from "@material-ui/core/Button/Button";
import styled from "styled-components";
import {registerStudent} from "../services/StudentApi";
import {navigate} from "@reach/router";
const StyledTextField = styled(TextField)`
&& {
margin-top: 20px;
}
`;
function RegisterPage() {
const [registerValues, setRegisterValues] = useState({
username: '',
password: '',
confirmPassword:'',
firstName: '',
lastName: '',
});
const [error, setError] = useState(false);
const handleChange = name => event => {
setRegisterValues({...registerValues, [name]: event.target.value});
};
const handleSubmit = event => {
event.preventDefault();
if (registerValues.password === registerValues.confirmPassword){
registerStudent(registerValues)
.then(res => console.log(res))
.catch(err => console.log(err))
navigate('/login')
}
else setError(true)
};
console.log(registerValues);
return (
<div style={{width:360}}>
<h3 style={{fontFamily: 'arial', textAlign: 'center'}}>REGISTER USER</h3>
{error && <div> <p>Password does not match</p></div>}
<form onSubmit={handleSubmit}>
<Fieldset>
<legend>Credentials</legend>
<StyledTextField fullWidth label="Username" value={registerValues.username}
onChange={handleChange("username")}/>
<StyledTextField fullWidth label="Password" type="<PASSWORD>" value={registerValues.password}
onChange={handleChange("password")}/>
<StyledTextField fullWidth label="Confirm Password" type="password" value={registerValues.confirmPassword}
onChange={handleChange("confirmPassword")}/>
<StyledTextField fullWidth label="First Name" value={registerValues.firstName}
onChange={handleChange("firstName")}/>
<StyledTextField fullWidth label="Last Name" value={registerValues.lastName}
onChange={handleChange("lastName")}/>
<div style={{display: 'flex', justifyContent: 'center', marginTop: 15}}>
<Button variant="contained" color="primary" type="submit"> Register</Button>
</div>
</Fieldset>
</form>
</div>
)
}
export default RegisterPage<file_sep>import React, {useState} from "react";
import Container from "../../components/Container";
import TextField from "@material-ui/core/TextField/TextField";
import Fieldset from "../../components/Fieldset";
import Button from "@material-ui/core/Button/Button";
import styled from "styled-components";
import {navigate} from "@reach/router";
import {createCourse} from "../../services/CoursesApi";
import ArrowBack from "@material-ui/icons/ArrowBack";
const StyledTextField = styled(TextField)`
&& {
margin-top: 20px;
}
`;
const BackButton = styled(Button)`
&& {
border-radius: 25px;
background-color: orange;
min-width:30px !important;
height: 30px;
padding:5px;
color: white;
}
&:hover {
color: orange;
background-color: white;
}
`;
function CreateCourse() {
const [courseValues, setCourseValues] = useState({
name: '',
description: '',
year: ''
});
const handleChange = name => event => {
setCourseValues({...courseValues, [name]: event.target.value});
};
const handleSubmit = event => {
event.preventDefault();
createCourse(courseValues)
.then(res => console.log(res))
.catch(err => console.log(err))
navigate('/courses')
};
const handleBack = event => {
event.preventDefault();
navigate('/courses')
};
return (
<Container>
<div style={{display: 'flex'}}><BackButton variant="contained" onClick={handleBack}>
<ArrowBack/></BackButton> <h3
style={{fontFamily: 'arial', paddingLeft:10}}>CREATE COURSE</h3></div>
<form onSubmit={handleSubmit}>
<Fieldset>
<legend>Details</legend>
<StyledTextField fullWidth label="Name" variant="outlined" value={courseValues.name} onChange={handleChange("name")}/> <br/>
<StyledTextField fullWidth label="Year" variant="outlined" value={courseValues.year}
onChange={handleChange("year")}/>
<StyledTextField fullWidth multiline variant="outlined" rows="4" label="Description" value={courseValues.description}
onChange={handleChange("description")}/>
<div style={{display: 'flex', justifyContent: 'center', marginTop: 15, marginBottom:15}}>
<Button variant="contained" color="primary" type="submit"> Create Course</Button>
</div>
</Fieldset>
</form>
</Container>
)
}
export default CreateCourse;<file_sep>import axios from 'axios';
async function registerStudent(student) {
return axios.post(`api/students`, student)
.then(res => {
console.log(res);
return res
})
.catch(err => console.log(err))
}
async function loginStudent(username, password) {
const data = new FormData();
data.append("username", username);
data.append("password", <PASSWORD>);
return axios.post(`api/students/login`, data)
}
async function logout() {
return axios.get('/api/students/logout')
}
export {registerStudent, loginStudent, logout}
|
f5c1cda0226359ebfb5751af3dba433b4f1a0ce3
|
[
"JavaScript",
"Java"
] | 23 |
JavaScript
|
KristijanPostolov/Courses
|
5198bf14ec74e35dda58dd4edeb7f73027fe15bd
|
4a3fe6b46905d983f8599bab19c8e1d5497c73f3
|
refs/heads/master
|
<file_sep>---
title: "Basics of R"
author: "<NAME>"
date: "May 20, 2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, error=TRUE)
```
# Chapter 1: Basics of R
## 1.1 Orientation
There are three things we need to be able to use in R:
* Stuff
* Organized stuff
* Ways of doing things to stuff
"Stuff" in R is called _variables_. These are all the individual sciencey numbers you have from whatever sciencey business you've been up to. They're kinda like nouns.
"Ways to do stuff" are called _functions_. These always have parentheses following, like "getwd()" or "log()." These are your verbs; the noun goes in the parentheses.
There are many ways to organize stuff, but the two we'll be starting with are _data frames_ and _vectors_. The first is like a table, and the second is like a single column in a table. These are your... noun phrases? Ok, I'm stretching the analogy, but you put them inside parentheses too, when you want to do something to them.
We'll start with functions, because just like verbs, they're what the rest is built around.
## 1.2 Doing Things (Functions)
Functions do something. That's pretty broad, so let's have an examples. Some functions do math:
```{r ex001}
sqrt(289)
```
The function here is "sqrt()" (stands for "square root"). The number, "289," is called the _argument_ of the function: the stuff that needs to be in the parenthesis for it to work properly. For this function, there has to be some number in the parentheses. You can take the square root of zero, but you can't take the square root of nothing!
```{r ex002}
sqrt(0)
sqrt()
```
The argument for a mathy function is usually a number or a set of numbers. Some other functions do more programming things that interact with your computer. For example, this function tells you the working directory you're currently in, which means basically the folder that R is looking at:
```{r ex003}
getwd()
```
If you set the working directory to a particular folder, you can access anything in that folder more easily. I usually make a folder for each project with whatever data I'm using in it, save my R script there, and make it my working directory. This next line sets the working directory, and it's the first line of every script I write:
```{r ex004}
setwd("C:/Users/Leah/Desktop/RforLing")
```
Well, obviously I don't put everything in a file called "RforLing," I change that to whatever file I'm using. And since your name probably isn't Leah, you'll need to change that too. (Though if it is -- hey, sup? Killer name, amirite?)
If you've already made a folder, you can get the path to that folder by right-clicking it and looking for "properties." Be careful of slashes, though -- if you copy and paste you'll need to go through and change the \'s to /'s.
Here's at another really important function: the function for getting more functions. See, one rad thing about R is that since it's free and open-source, all kinds of people make all kinds of functions for it. In fact, there are way more functions than any one person could possibly use. I mean, we'll want specialized linguistics-related functions later, but we won't be looking at functions made for meteorologists or astronomers or haberdashers, and the person who would want all of those is pretty rare. Besides, trying to download every possible function would eat up a mountain of computer space. So instead, when we download R, we get the fairly minimal "base R," and from there we bring in the packages we want for the specific work we're doing.
There are two steps to using a package: first downloading it to your computer from the internet, and second taking it into R from your computer. You only need to download it once, but you'll need to reload it into R every time you close R and then open it again.
Let's go ahead and download the "tidyverse" package, which is a generally handy package full of functions for working with data. It'll make our lives easier later.
```{r ex005}
install.packages("tidyverse")
library(tidyverse)
```
Yes, that's right -- you are required to include quote marks around the package name for the first one, and required to have no quotes around the name for the second one. This is just to be irritating, afaik. But there are more general rules about quote marks, and we'll get into those in the next section.
## 1.3 Stuff (Variables)
A variable is a name for a blob of data. One of the simplest possible things you can save as a variable is a word, which is the "character" data type. You show that something is a word by putting it in quote marks. You can just write out a word in quote marks, and that will print it in the console, but won't save it as a variable:
```{r ex006}
"metathesis"
```
To save it as a variable, you need to assign it a name. This _won't_ print the variable out, it'll just save it. If you go look in the "environment" window in the upper right corner of RStudio, though, you should see it pop up there.
```{r ex 007}
nerdword <- "metathesis"
```
The "<-" there is the symbol that tells R "hey slap this name on this thing." If we want to see the actual thing, we just type in the name, and R connects the dots.
```{r ex008}
nerdword
```
Once we have a word saved as a variable, we can use that variable as an argument for functions. For example, the first function below counts how many letters there are in a variable, and the second repeats the variable however many times. (That means that the first function has just one argument, the variable, while the second fuction takes two, the variable and the number of times you want it repeated.)
```{r ex009}
str_count(nerdword)
rep(nerdword, 7)
```
We can change the thing saved under a particular name anytime.
```{r ex010}
nerdword <- "monophthongization"
nerdword
str_count(nerdword)
rep(nerdword, 7)
```
Note that R is not bright enough to actually understand these variable names itself. You can totally name a number "nerdword," and R would be fine with that. The names are just to help us humans follow along.
Speaking of numbers, the way you tell R that incoming data is a numeric data is by _not_ putting it in quotes. This works much the same way as words above: if you just type the number, it gets printed out but not saved. To save a number as a variable, assign it a name with "<-".
```{r ex011}
nerdnumber <- 2.718
nerdnumber
```
Then it's easy to stick in as the argument for a function.
```{r ex012}
log(nerdnumber)
```
## 1.4 Organized Stuff (Vectors and Dataframes)
That's all well and good, but I'd say it's damn rare for anyone to have a research project involving a single word or number. We generally have a slew of 'em. For now, let's examine an extremely simple mini dataset that I constructed by asking my mom, dad, and cat to each name a song and rate it.
* Mom selects "You are My Sunshine" and rates it 6/10.
* Dad selects "The MASH Theme" and rates it 7/10.
* Fred selects "I Did It My Way" and rates it 9/10.
Now, we could put these into individual variables. I'll start at "a" for songs, and "q" for ratings.
```{r ex013}
a <- "You are My Sunshine"
b <- "The MASH Theme"
c <- "I Did It My Way"
q <- 6
r <- 7
s <- 9
```
But this is not really a helluva lot better. I mean, if you look up in that environment pane, you'll have six new variables there, but they're all disconnected. There's no indication that any of these go together.
So I'd like to introduce you to a Very Important Function: **c()**. That stands for "concatenate," which is a fancy way of saying "stick these in a group together." The name of that group is a _vector_ -- it's an ordered list of items. Once again, we'll need to save that vector by assigning it its own name.
```{r ex014}
songs <- c(a, b, c)
ratings <- c(q, r, s)
```
Now we have the slightly magical ability to do things to every variable in the vector at once.
```{r ex015}
ratings*100
rep(songs,3)
```
You don't have to go through the intermediate step of assigning each individual data point a name. Say I want to create a vector of nominators. I can just concatenate the names directly.
```{r ex016}
nominator=c("Mom","Dad","Fred")
paste0(songs," is ",nominators,"'s selected song.")
```
Now, of course, the next thing we want to do is get all these vectors -- which are essentially columns -- organized into one big dataframe. The specific kind of dataframe we're using here is called a _tibble_, and we got it from that "tidyverse" package we downloaded back at the beginning of this chapter.
```{r ex017}
music=tibble(songs,ratings,nominator)
music
```
Ta daa! Note that the songs, ratings, and nominator line up correctly. That's because, like I said, vectors are _ordered_. If you're putting vectors together in a table like this, be careful that you keep them in the right order.
Admittedly, you're probably not gonna end up building dataframes in R like this. It's too pesky. But it's important to understand how they're constructed before we go fiddling with them. (Which we will in the next chapter, on importing data from elsewhere and cleaning it up.)
Once you have some data, whether you made it or imported it, the first thing you wanna do is look at it. F'real. Especially if it's some big dataset, or it's the first time you're working with it. Always check that your data is loaded in correctly before, say, doing a bunch of complicated stats on it.
The functions "head()" and "tail()" are a bit silly here, because the dataset is so small. Later we'll look at a bigger dataset, and see that those show us the first six and last six rows, respectively.
```{r ex018}
summarize(music)
str(music)
head(music)
tail(music)
music$songs
```
## 1.5 Some Tips
Programming languages are persnickety. As you get started on your R journey, know this: you're going to see a LOT of error messages. Going back to figure out what exactly went wrong for the twelfth time is exhausting, but it's worth it for the sweet sweet feeling of victory that comes when it does finally work.
Two things that are liable to trip you up are punctuation and capitalization. Here's a list of things that are not the same in R:
* thisthing
* this.thing
* this_thing
* ThisThing
* ThIsThInG
Check exact spelling, especially of abbreviations, and whether the thing you want was written with under_scores or CamelCaps or something else. This is another reason to use RStudio: it will offer suggestions for what you might be typing. You can just go to the right one and hit "enter" and have the exact spelling filled out for you.
There are two different ways to say "help me" in R: "?" and "??" (yes, really). The first is if you know the name of the function you're interested in, but you're not sure of maybe what exactly it does or what arguments it takes. The two-question-mark version is if you're not sure about what function you want -- you put in the topic you're interested in, and it'll give you functions that match that topic. Both of these pop up in the lower right pane in RStudio.
There's also apropos(), which gives you every function that starts with whatever letters you mention. Super handy.
```{r ex020}
?head()
??permutations
apropos(sum)
```
A final quick tip: google your error messages! Trust me, _someone_ else out there has had the same problem, and usually the internet has already taken a stab at it. <file_sep>getwd()
setwd("C:/Users/Leah/Desktop/RforLing")
library(tidyverse)
library(languageR)
### THE BASICS: MEAN AND VARIANCE
english %>% summarize(mean(RTlexdec))
english %>% summarize(sd(RTlexdec))
#other useful summarize() statistics: var, min, max, median, range, quantile
#can get those one at a time, as above
#or "summary()" gives several:
summary(english$RTlexdec)
sapply(english, mean) #where do the NA's appear?
###BASICS: DISTRIBUTIONS
#A "distribution" is the pattern of what results you get following certain probability rules
#For example, say your experiment is "flip a fair coin 100 times and count the number of heads." The first time you do that, you get 47 heads. The second time, 60 heads. The third time, 54 heads. The fourth time, 32 heads. And so on.
#If you repeat this experiment many many times, most of the results are going to be near 50 heads. It has a binomial distribution -- this kind of experiment follows the binomial rules. But we usually approximate this with a normal distribution. That's the hill-shaped one. We expect most of the results to be near 50, some of the results to be a little further away from 50, and very few results to be far away from 50.
rbinom(n=1, size=100, prob=0.5) #one experiment of 100 flips
rbinom(n=1000, size=100, prob=0.5) #one thousand experiments of 100 flips each
hist(rbinom(n=1000, size=100, prob=0.5))
#Say your second experiment is "roll a fair six-sided die 60 times and tally what numbers come up." You'd expect each number to come up around (but probably not exactly) 10 times.
sample(x=1:6, size=60, replace=TRUE) #one experiment with 60 rolls -- indiv rolls
table(sample(x=1:6, size=60, replace=TRUE)) #one experiment with 60 rolls -- table
plot(table(sample(x=1:6, size=60, replace=TRUE)), type="h")
#Trying to make R save 1,000 die-rolling experiments of 60 throws each is surprisingly annoying
#We'll do not-quite-the-same-thing and just roll 60,000 times
plot(table(sample(x=1:6, size=60000, replace=TRUE)), type="h")
#So this is not at all like normal distribution -- it's six numbers that are all equally likely, so it's a flat line, not a bell shape. We can use a uniform distribution to model this (a flat-line model). But if we don't think about that and use tests that are for normal distributions, our statistics won't make any sense.
#Here's the really important (and tricky) part: it's not the situation, the rolling of dice or flipping of coins, that matters. It's the question you're asking ABOUT that situation.
#With the die roll, I can change my question to "how often do I roll a 1"? And THAT is a binomial question again
hist(rbinom(n=1000, size=60, prob=(1/6)))
#We get a 1 around 10 times in every 60 rolls. Sometimes we get more than 10, sometimes less, but it's around 10.
#Probability people are always talking about flipping coins and rolling dice and throwing darts and stuff like that. The reason is that these are very very controlled situation. You might flip a coin and have it land in a crack in the table and stick up exactly on its edge. But this is so phenomenally unlikely that for all practical purposes heads and tails are 50/50 chances. We can use abstract, perfectly fair coins and dice to get an idea of what the probability distributions look like under abstract, perfectly fair conditions.
#The point of stats is using this abstract information to understand messy, complicated real-world data, instead of imaginary perfect coins. Statistical questions involve figuring out which of these theoretical distributions is the right one for your question (so if it was a pure probability problem, what distribution would we expect) and then comparing your actual data to that distribution.
### TEST 1: T-TEST
#A t-test compares data to "Student's t" distibution (not just for students, the guy who invented it was named Student). This is like a normal distribution but has fatter tails, which means it's more likely than in a normal distribution to sometimes get results far away from the mean.
hist(rnorm(100, mean=0, sd=1))
hist(rt(n=100, df=5))
#We use the Student's t-distribution when we think the data is probably normal, but we're sampling from something complicated so we can't be 100% sure.
#The main way we use this is for the t-test. If we have two normally distributed variables and they have different means, the t-test tells us whether it's likely that the difference in their means is just random chance.
#The t-test has three assumptions:
# 1. The data is normally distributed
# 2. The two groups have the same variances
# 3. The different results are independent.
#Let's stay with coin flips for an example. Say we have a new coin, Coin X, and we don't know if it's fair or not. We do one hundred experiments where we flip it 100 times and we get this results for the number of heads:
CoinX <- c(41, 37, 38, 37, 32, 25, 28, 38, 40, 28, 32, 41, 30, 37, 33, 38, 36, 33, 28, 33, 39, 35, 30, 38, 36, 41, 30, 33, 27, 31, 34, 43, 30, 37, 48, 32, 39, 38, 38, 36, 35, 41, 32, 42, 35, 38, 35, 34, 29, 38, 30, 36, 35, 45, 32, 36, 34, 35, 36, 44, 42, 33, 37, 34, 35, 30, 26, 32, 33, 37, 31, 48, 38, 36, 38, 42, 34, 34, 42, 31, 34, 35, 37, 34, 31, 32, 29, 39, 37, 36, 33, 36, 34, 32, 35, 36, 45, 42, 39, 34)
#What's the mean here?
mean(CoinX)
#Is Coin X likely to be a fair coin? Well, a fair coin would have a mean around 0.5, so in a hundred flips there would be about 50 heads. It's possible for us to get the mean we got here with a fair coin. And that's our null hypothesis: Coin X is *really* a fair coin (mean=0.5), and the results we got (mean=0.35) are from chance. But is that very likely?
#We're gonna t-test to find out. But first, let's check our three assumptions.
# 1. Is the data normally distributed?
qqnorm(CoinX)
#Looks ok. We're using discrete data and not enough of it to get a real "line," it's more a "stairstep," but that's not the end of the world. Wobbly at the edges, again that's alright. And we know our "fair coin" comparison will be normal because we're gonna generate that ourselves.
qqnorm(rbinom(n=100,size=100,prob=0.5))
# 2. Are the variances the same?
var.test(CoinX, rbinom(n=100,size=100,prob=0.5))
#The variance differences are NOT statistically significant, which is what we want.
# 3. Are the tests independent?
#Well, sure. We already know that these are coin flips. Getting "heads" on flip #4 doesn't affect whether we get "heads" on flip #5, or #12, or #47. No problem there.
#So t-test is go. Are these two means different from each other in a statistically significant way?
t.test(CoinX, rbinom(n=100,size=100,prob=0.5))
#The p-value is extremely small. So there's only a very very small chance that we would get in a hundred experiments a mean of 35 heads if the coin that was really fair. Coin X is very unlikely to be a fair coin. We can reject the null hypothesis that Coin X has the same mean as a fair coin.
#Now let's try it with linguistics data. Going back to the "english" dataset, there are are two groups of subjects: young and old. Do their reaction times have different means?
mean(english$RTlexdec[english$AgeSubject=="young"])
mean(english$RTlexdec[english$AgeSubject=="old"])
#They're a little different. Is that difference more likely to mean something real, or are the two groups probably really the same and the difference is due to chance?
#A t-test will help us, but first we need to make sure that the three basic assumptions holds.
#1. Are the reaction times of the "young" group and the reaction times of the "old" group approximately normally distributed?
hist(english$RTlexdec[english$AgeSubject=="young"])
hist(english$RTlexdec[english$AgeSubject=="old"])
#Hmm, they're a little bit skewed. That is, the mean isn't right in the middle, it's to the left. Let's look at a Q-Q plot to get a better idea of how far this is from a normal distribution.
qqnorm(english$RTlexdec[english$AgeSubject=="young"])
qqnorm(english$RTlexdec[english$AgeSubject=="old"])
#A little curvy, but not terrible. The t-test can still handle this okay, as long as we're working with enough data. Are we?
table(english$AgeSubject)
#Oh, yeah, that's plenty. If we only had like 30 observations, the skew would be a big problem, but with 2,000+ observations for each group, we're okay.
#That means we can go to assumption #2: that the variances in the two groups are roughly the same. This is important because if like the young group is almost all between 6.41 and 6.45, to get a mean of 6.43, but the old group is anywhere from 6.0 to 7.32 to get the mean of 6.66, then there's something more weird going on and the t-test isn't going to notice it. R mostly handles this itself, but let's take a look.
var(english$RTlexdec[english$AgeSubject=="young"])
var(english$RTlexdec[english$AgeSubject=="old"])
#Looks pretty close. If the two groups were both very normal, we could test variances with the same "var.test()" function we used above. These aren't exactly normal, though, so let's use Levene's test. We need to get that from the "car" package. (Both variance tests are actually types of F-test, which we'll talk about in its own section later.)
install.packages("car")
library(car)
leveneTest(RTlexdec ~ AgeSubject, data=english)
#Well damn. The differences in variations are statistically significant. But like I said, R can handle this anyway. The default for a t-test in R is to assume that the variances are NOT equal. If they WERE equal, we could run a stricter t-test, but since they're not, we'll use the default.
#And now assumption #3: that the tests are independent.
#That's also a little tricky here. See, we don't know how many subjects there are. The dataset doesn't say. Maybe each word was given to one and only one person, so there were 4568 subjects. Maybe there were only two subjects, a young one and an old one, and they each did 2284 words.
#My guess is that it's somewhere in the middle, like 45 subjects doing about 100 words each. But we don't KNOW that. And that puts a HUGE caveat on our analysis. We can run the t-test, but without knowing how many subjects there are we can't be very sure about it. For example, if there are only 6 subjects, 3 young and 3 old, and one of the old people happens to be super slow, then the young/old difference might not actually be a young/old difference. It could be that everyone's reaction time is the same except old Barnabus, and he's skewing the "old" data.
#This is a VERY COMMON problem in linguistics -- scholars reporting data about individual WORDS or FEATURES without being clear about how many PEOPLE there are. You can have 5,000 examples of something, but if they're all from the same person, they're not independent and you can't say much about this word or feature generally.
#We're gonna test anyway. But we would need to put a HUGE caveat on this information. In fact, if I was doing this for real, I'd try to contact the people who did the experiment and find out how many subjects there were. And if I couldn't find that, I'd just throw this away.
t.test(english$RTlexdec[english$AgeSubject=="young"], english$RTlexdec[english$AgeSubject=="old"])
#WITH OUR BIG CAVEAT IN MIND, based on this we can reject the null hypothesis: probably the difference in mean reaction time between these two groups is not due to chance. Probably young and old people in the whole population have different means here.
#Now, this is only STATISTICAL significance: it's probably not chance. That's not the same as SUBSTANTIVE significance. Substantive significance means noticing that the difference between these two means is only 0.22, and knowing enough about brains and language and response time to say whether that's enough of a difference for us to care about.
#Let's practice. Compare the reaction times when a word is a verb to when it's a noun. But first, make sure that it's okay to use a t-test. Discuss all three assumptions that a t-test makes and whether they hold up for the noun/verb groups.
### TEST 2: CHI-SQUARE
#For comparing categorical variables
#First, take a look at them:
#Two categorical variables
table1 <- table(english$CV, english$Voice)
prop.table(table1)
#Three categorical variables
table2 <- table(english$CV, english$Voice, english$WordCategory)
ftable(table2)
#If you have categorical groups (like "noun" and "verb") and the
#
#each one: what it's for (what kind of questions it answers); what assumptions it makes and how to tell if those assumptions hold; how to code; how to interpret result; how to present graph or chart
### F-TEST ###
## Purpose
## Assumptions
## Code
## Interpreting Results
## Presenting Results
### CHI-SQUARE ###
## Purpose
## Assumptions
## Code
## Interpreting Results
## Presenting Results
### ANOVA ###
## Purpose
## Assumptions
## Code
## Interpreting Results
## Presenting Results
<file_sep>#As always, start by setting up the working directory
getwd()
setwd("C:Users/John/Downloads")
#Next, import any packages you need.
#Since we'll be messing with a new dataset, we'll want "tidyverse." (You pretty much always want tidyverse.)
#We'll get the dataset from another package, languageR
#Remember that if you don't already have these you'll need to "install packages" first
library(tidyverse)
library(languageR)
#The languageR package includes many datasets
#Take a look:
data(package="languageR")
#We'll use the "english" dataset for now.
#Start by just looking at the first few rows, and at the structure
head(english)
tail(english)
str(english)
#Good grief that's a lot of columns
#What do they all mean?
#Let's look at the help file
?english
#So this dataset has a bunch of English words, information about those words, and how long the reaction time was for subjects to decide if it was a word or not. Many of the words are really obscure.
#Let's practice by asking two questions about this dataset
#First, is reaction time correlated with subjective ratings of familiarity for a word?
#And second, do young and old speakers have a statistically significant difference in average reaction time?
#Both of these involve taking just the columns we need from all of these options
#For the first question, we want "Familiarity" and "RTlexdec"
#But wait!
#Every word is in here twice -- once with the "old" speakers and once with the "young" speakers
#Let's put them back together before we go on
#So we'll need the two columns of interest, plus "Word" and "AgeSubject"
#You pull particular columns from a dataframe using the "select()" function
#And we're gonna use piping, which comes from tidyverse
#That's stuff using this symbol: %>%
#With that, we can put the data first, then do something to it
english %>% select(RTlexdec,Familiarity,Word,AgeSubject)
#That's the same as this:
select(english, c(RTlexdec,Familiarity,Word,AgeSubject))
#But the first one is easier to read, especially if we keep doing more stuff to that same data
#Let's save the smaller dataset as a new variable
#You could save it as "english" again, but then you would *lose* anything you didn't keep
#So it's better to save it as a new variable, so "english" still has all the original information and we can go back and pull other stuff out later
q1data <- english %>% select(RTlexdec,Familiarity,Word,AgeSubject)
#Ok. Let's look at the structure of this smaller dataframe
str(q1data)
#Hmm. "Word" is saved as a factor with 2197 levels (that means there are 2197 different words). But there are 4568 total rows.
4568/2197
4568/2
#So some words are in here three or four times??
#Let's check on that. First we'll group the data by the "Word" column, then we'll get the count of how many times each word appears
#This pattern is a fundamental one for data org and exploration:
# data %>% group_by(something) %>% summarize(number_you_want)
#There are lots of options in summarize() -- count, mean, range, etc.
?summarize()
#For now we want the count, which we get with n()
q1data %>% group_by(Word) %>% summarize(count=n())
#What we specifically want to know, though, is whether any of these counts are above 2
#So let's add one more step: filter()
q1data %>% group_by(Word) %>% summarize(count=n()) %>% filter(count>2)
#Looks like there are some that show up 4 times. That's weird.
#Are they just duplicates?
q1data[q1data$Word=="arm",]
q1data[q1data$Word=="bitch",]
q1data[q1data$Word=="bust",]
#Looks like yes. So I can just include all 4 in the averages, and it shouldn't change anything (because (2+4)/2 = (2+4+2+4)/4). I'd be more careful about it if this was a final analysis, but for now, I'm just taking a first look at the data and I want to move forward.
#To get the reaction time averages, I group by word again, and this time take a mean() in the summarize() function
q1data %>% group_by(Word) %>% summarize(avgRT=mean(RTlexdec))
#Once again, this just shows these summary numbers in the console
#To continue messing with this, I'll need to save it as a variable too
#This time I'm removing data again by averaging, so I'll make another new dataframe variable. Don't forget to keep "Familiarity" in there too!
#Familiarity should be the same for each word, no matter whether it's under "old" or "young," so I'll just take the first time it comes up
q1d2 <- q1data %>% group_by(Word) %>% summarize(avgRT=mean(RTlexdec), familiarity=mean(Familiarity))
head(q1d2)
#Ok great!
#So the question: are these two correlated?
cor(q1d2$avgRT, y=q1d2$familiarity)
#Looks like yes, and in the direction we'd expect (higher familiarity correlates to lower reaction time)
#So this might be something worth investigating with linear regression later
#If we did that, we'd first want to make sure that both avgRT and familiarity are normally distributed
#(I'd bet money avgRT is, but familiarity? Could be exponential)
#And of course we'd want to go back and check that averaging in those surprise words with 4 answers
#Anyway for now we're just organizing data for a stats first pass, so let's move on to question 2
#Do young and old speakers have a statistically significant difference in average reaction time?
#Now we DO want separate info for young and old speakers, so we can't use the q1data variable we made before
#We need to go back to the original and get the data we need for this new question
#What were the original columns again?
str(english)
#Ok, so we just want "RTlexdec" and "AgeSubject"
q2data <- english %>% select(RTlexdec, AgeSubject)
head(q2data)
tail(q2data)
q2data %>% group_by(AgeSubject) %>% summarize(mean(RTlexdec))
#Aaaand a t-test:
t.test(RTlexdec ~ AgeSubject, data=q2data)
q2data %>% t.test(RTlexdec ~ AgeSubject)
#Also a yes to question 2, then.
#Ok, practice time! Take 2 minutes to think of another fairly simple question we could ask about this data. Remember, you can look at the information on what all the variables are in help:
?english
#Is there a difference between noun and verb in terms of reaction time?
q3data <- english %>% select(RTlexdec, Word, WordCategory)
q3d2 <- q3data %>% group_by(Word) %>% summarize(avgRT=mean(RTlexdec))
head(q3d2)
q3d3 <- left_join(q3d2, q3data, by="Word")
t.test(avgRT ~ WordCategory, data=q3d3)
<file_sep>---
title: "Introduction"
author: "<NAME>"
date: "May 20, 2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Introduction {-}
You know you wanna use R. I know you do. You know you do. It's &&better. Besides, it's sexy af.
But it's undeniably daunting. R can pull off these nuanced analyses on piles and piles of data exactly because it's a for-real programming language. And if you've spent the last years or decades learning the ins and outs of negative concord or voice onset time or Grimm's Law or whatever, then it's unlikely you've put the same amount of time into learning programming. Which, y'know, fair. You're a linguist. (Or else reading this book as a voyeur, I suppose.)
The tragedy of mortality is that we can't learn every damn thing. I'm gonna argue, though, that it's worthwhile to pick up at least a little bit of R, even if that's a sidestep from your immediate interests. The basic reason is this: R can automate some of the tedious busy-work tasks. Putting time in to learn R now frees up time in the future that you would have spent adding diphthong glides to a graph one line at a time, or going into every spreadsheet cell with an NA to switch it to 0, or hunting down every single time you mentioned the standard deviation because it's actually 3.97 ms, not 3.79.
&&obviously not teaching linguistics here. Or stats, for that matter. Just coding.
## Structure of this Book
Chapter One focuses on the basics of R itself, on loading in and accessing your data, and on the preliminary set-up steps that you normally want to take before embarking on a new project. People familiar with R can skip it, but if you don't already know R, I recommend you read it, even if all you ultimately want is just one teeny-tiny itsy-bitsy little graph. Otherwise you may get this graph to work, but not an extremely similar graph with a different type of variable next week. It's your life, though, so follow your heart I guess.
Chapter Two is &&
## Datasets
&&from LanguageR; acknowledge Baayen
## Getting R and RStudio
Download R studio; tries to help with the capital letters thing; can eat a turkey without a plate, but if you have a plate why would you not use it
Download R: https://www.r-project.org/
Install R Studio: https://rstudio.com/products/rstudio/download/
Using R in console vs making a script
Comments
<file_sep>#Practice with line graphs and scatterplots
#The bar graph code from last week is at the bottom of this script!
getwd()
setwd("C:/Users/Leah/Desktop/RforLing")
library(tidyverse)
###Line graph of police shootings by year (data from WashPo)
#1. Import dataset
WaPo <- read_csv("fatal-police-shootings-data.txt")
#2. Organization: look at the data. How are dates given?
#We want our chart to be by year. For that we'll use "lubridate." Install the package if you need to.
library(lubridate)
year <- year(ymd(WaPo$date))
WaPo <- mutate(WaPo, year)
#Use piping (%>%) to group the data by year, then get the count for each year. Save this as a dataset WaPo2. When you get the count, remember to name it something, so it won't have parentheses in the variable name.
WaPo2 <- WaPo %>% group_by(year) %>% summarise(shootings=n())
WaPo2
#3. Make this dataset ggplot-readable. That means preparing ggplot for what the data is and what we want the x and y variables to be. Remember this WON'T make a graph; it's just getting ready. Name this WaPo2plot.
WaPo2plot <- ggplot(data=WaPo2, aes(x=year,y=shootings))
#4. Use the data in WaPo2plot to make a graph. Show ggplot that what we want is a line graph by using geom_line().
WaPo2plot+
geom_line()
#5. Well, that's not too useful. I downloaded this data in May 2020, so the 2020 numbers are obviously way smaller, and this makes it hard to see the differences in 2015-19. Go back to WaPo2, make a WaPo3 by dropping 2020, and try again.
WaPo3 <- WaPo2 %>% filter(year<2020)
WaPo3plot <- ggplot(data=WaPo3, aes(x=year,y=shootings))
WaPo3plot+
geom_line()
#6. Customize title, labels, theme, colors, etc., then save as a png.
###Scatterplot with line of best fit
#Let's go back to lexdec for this one. Goal: two scatterplots, reaction times by frequency and reaction times by word length.
#1. Get the data. Don't really need to do any special organizing on this one.
library(languageR)
?lexdec
#2. Make two ggplot-readable datasets. I called them ldplot and ldplot2.
ldplot <- ggplot(data=lexdec, aes(x=RT, y=Frequency))
ldplot2 <- ggplot(data=lexdec, aes(x=RT, y=Length))
#3. Make these into two scatterplots. Try geom_point and geom_jitter. What's the difference?
ldplot+
geom_jitter()
ldplot2+
geom_jitter()
#4. Add a line of best fit to each one. There are several ways to do this, but the simplest for just looking at data like this is by adding the ADDITIONAL layer geom_smooth(method=lm). What are the tendencies for each graph? Is that what you'd expect?
ldplot+
geom_jitter()+
geom_smooth(method=lm)
ldplot2+
geom_jitter()+
geom_smooth(method=lm)
#5. Customize and save.
###EXAMPLE FROM LAST TIME: BAR GRAPH
budgplot <- ggplot(data=budget,aes(x=`Department/Cost Center`,y=`Millions of Dollars`))
budgplot+
geom_col(fill="#333366")+
coord_flip()+
theme_grey()+
ggtitle("Ten Largest Expenditures in Mobile, AL 2020 City Budget", subtitle="Accounting for $162 million of the total $259 million budget")+
geom_text((aes(label=`Millions of Dollars`)), hjust=1.25,color="white")+
labs(caption="Data Source: City of Mobile, AL Annual Budget Fiscal Year 2020 \n https://www.cityofmobile.org/uploads/file_library/2020-proposed-budget-final-082019.pdf")
ggsave("MobileAlBudget2020.png")
|
c14321f8c6bc0f2b3bdac09eee1c23085569899c
|
[
"R",
"RMarkdown"
] | 5 |
RMarkdown
|
lnodar/RforLing
|
6a65b976dc47ac6589bd515fcb712c9549c90e18
|
d46866fe490341c1010babe6000a90820ec758fd
|
refs/heads/master
|
<repo_name>mohitjayant/Custom_Ruler<file_sep>/RulerPrint/MainWindow.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace RulerPrint
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public Vector windowOrigin = new Vector(0,0);
ToolTip cursorToolTip;
public MainWindow()
{
InitializeComponent();
cursorToolTip = new ToolTip();
myCanvas.ToolTip = cursorToolTip;
}
private void Window_MouseMove_1(object sender, MouseEventArgs e)
{
Point myPoint = e.GetPosition(myCanvas);
windowOrigin.X = myCanvas.ActualWidth / 2;
windowOrigin.Y = myCanvas.ActualHeight / 2;
cursorToolTip.HorizontalOffset = myPoint.X - 200;
cursorToolTip.VerticalOffset = myPoint.Y - 200;
cursorToolTip.Content = "(" + (1000-(myPoint.X)) + ", " +(600-myPoint.Y) + ")";
horizontalRuler.RaiseHorizontalRulerMoveEvent(e);
verticalRuler.RaiseVerticalRulerMoveEvent(e);
}
}
}
<file_sep>/README.md
# Custom_Ruler
Drawing of custom Ruler by assigning origin at top left corner of screen.
|
f58d084f6336b63110fade3467dc6c596af431de
|
[
"Markdown",
"C#"
] | 2 |
C#
|
mohitjayant/Custom_Ruler
|
6541179f8edb289d10f0bd776d4eb16d4cdedde4
|
47d423eba52ba904fd2b8d54590c1f2b8d39eff1
|
refs/heads/master
|
<repo_name>kojea0919/kojea0919<file_sep>/2013603037_Kojeahuck.sh
#!/bin/bash
##Project
PrintTree()
{
if [ $1 ]
then
cd $1
fi
count=`ls -l | wc -l`
if [ `expr $count - 1` = "0" ]
then
return 0
fi
local dirname=(`find * -prune -type d | sort -d`)
local filename=(`find * -prune -type f | sort -d`)
local specname=(`find * -prune ! \( -type f \) ! -type d | sort -d`)
local size
size=${#dirname[@]}
local a
for (( p = 0 ; p < $2 ; ++p )) ;
do
a=$a' '
done
local i
for (( i = 0 ; i < $size ; i++ )) ;
do
echo "$a r[ `expr $i + 1` ] ${dirname[$i]}"
echo "$a |--------------------INFOMATION--------------------"
echo "$a[34m |file type : `stat ${dirname[$i]} | grep IO | rev | cut -f 1 -d ' ' | rev`"[0m""
echo "$a |File`stat ${dirname[$i]} | grep Size | cut -f 1 `"
echo "$a |Change time `stat ${dirname[$i]} | grep Change | cut -f 2 -d e`"
echo "$a |permission : `stat ${dirname[$i]} | grep Uid | cut -f 2 -d : | cut -f 1 -d /`)"
echo "$a |absolute path : `pwd`/${dirname[$i]}"
if [ $2 = 0 ]
then
echo "$a |relative path : ./${dirname[$i]}"
else
Data=`expr $2 + 5`
echo "$a |relative path : ./`pwd | cut -f 5-$Data -d /`/${dirname[$i]}"
fi
echo "$a ---------------------------------------------------"
PrintTree "${dirname[$i]}" `expr $2 + 1`
cd ..
done
for (( j = 0 ; j < ${#filename[@]} ; j++ )) ;
do
echo "$a r[ `expr $i + $j + 1` ] ${filename[$j]}"
echo "$a |--------------------INFOMATION--------------------"
echo "$a |file type : `stat ${filename[$j]} | grep IO | rev | cut -f 1 -d ' ' | rev`"
echo "$a |File`stat ${filename[$j]} | grep Size | cut -f 1 `"
echo "$a |Change time `stat ${filename[$j]} | grep Change | cut -f 2 -d e`"
echo "$a |permission : `stat ${filename[$j]} | grep Uid | cut -f 2 -d : | cut -f 1 -d /`)"
echo "$a |absolute path : `pwd`/${filename[$j]}"
if [ $2 = 0 ]
then
echo "$d |relative path : ./${filename[$j]}"
else
Data=`expr $2 + 5`
echo "$a |relative path : ./`pwd | cut -f 5-$Data -d /`/${filename[$j]}"
fi
echo "$a ---------------------------------------------------"
done
for (( k = 0 ; k < ${#specname[@]} ; k++ )) ;do
echo "$a r[ `expr $i + $j + $k + 1` ] ${specname[$k]}"
echo "$a |--------------------INFOMATION--------------------"
echo "$a[32m |file type : `stat ${specname[$k]} | grep IO | rev | cut -f 1 -d ' ' | rev`"[0m""
echo "$a |File`stat ${specname[$k]} | grep Size | cut -f 1 `"
echo "$a |Change time `stat ${specname[$k]} | grep Change | cut -f 2 -d e`"
echo "$a |permission : `stat ${specname[$k]} | grep Uid | cut -f 2 -d : | cut -f 1 -d /`)"
echo "$a |absolute path : `pwd`/${specname[$k]}"
if [ $2 = 0 ]
then
echo "$d |relative path : ./${specname[$k]}"
else
echo "$a |relative path : ./`pwd | cut -f 5-$Data -d /`/${specname[$k]}"
fi
echo "$a ---------------------------------------------------"
done
}
echo "=== print file information ==="
echo "current directory : `pwd`"
filecount=`ls -l | wc -l`
echo "the number of elements : `expr $filecount - 1`"
PrintTree "`pwd`" 0
|
ae3b9f25544e91bc4ddf3592449134f3826afce4
|
[
"Shell"
] | 1 |
Shell
|
kojea0919/kojea0919
|
41b82f44c373e3787992a0e9ea34a3db3753129e
|
69ed1ef815bacb7d64dbef4f1e628b8a24883bbc
|
refs/heads/master
|
<file_sep>import defaultImg from '../assets/default.png'
import defaultGood from '../assets/good/default.png'
import defaultShop from '../assets/shop/default.png'
export const getImageUrl = url => url || defaultImg
export const getGoodImageUrl = url => url || defaultGood
export const getShopImageUrl = url => url || defaultShop
export default getImageUrl
<file_sep>import Taro, { Component } from '@tarojs/taro'
import { View, Image, Textarea } from '@tarojs/components'
import taroFetch from '../../utils/request'
import { getShopImageUrl } from '../../utils/image'
import { sliceStr } from '../../utils/string'
import './shopComment.scss'
class shopComment extends Component {
config = {
navigationBarTitleText: '清单评论',
navigationBarBackgroundColor: '#F0F0F0',
}
constructor(props) {
super(props)
this.state = {
id: null,
shopData: {},
pageNum: 1,
pageSize: 50,
comments: {
total: 0,
list: [],
},
comment: null,
}
}
componentDidShow() {
const { id } = this.$router.params
this.fetchData(id)
this.fetchShopComments(id)
}
componentDidHide() {}
fetchData = id => {
taroFetch({
url: '/app/wishList/selectWishListById',
data: {
listId: id,
},
}).then(data => {
this.setState({
id,
shopData: data.wishList,
})
})
}
fetchShopComments = id => {
const { pageNum, pageSize } = this.state
taroFetch({
url: '/app/comment/getComments',
data: {
listId: id,
pageNum,
pageSize,
},
}).then(data => {
this.setState({
comments: {
...data,
list: data.wishListComments,
},
})
})
}
handleComment = e => {
this.setState({
comment: e.target.value,
})
}
add = () => {
const { comment, id } = this.state
taroFetch({
url: '/app/comment/addComment',
method: 'POST',
data: {
listId: id,
content: comment,
},
}).then(() => {
this.setState(
{
comment: null,
},
this.fetchShopComments(id)
)
})
}
render() {
const {
shopData: { listName, listPic, listDesc },
comment,
comments: { list },
} = this.state
return (
<View className="shopComment">
<View className="shopComment-shop">
<View className="shopComment-shop-container">
<Image
className="shopComment-shop-container-left"
src={getShopImageUrl(listPic)}
/>
<View className="shopComment-shop-container-right">
<View className="shopComment-shop-container-right-title">
{sliceStr(listName, 20)}
</View>
<View className="shopComment-shop-container-right-des">
{sliceStr(listDesc, 40) || '暂无描述'}
</View>
</View>
</View>
</View>
<View className="shopComment-comment">
<View className="shopComment-comment-head">全部评论</View>
<View className="shopComment-comment-body">
{list.length &&
list.map(item => (
<View className="shopComment-comment-item">
<Image
className="shopComment-comment-item-left"
src={item.avatar}
/>
<View className="shopComment-comment-item-right">
<View className="user">{item.nickName}</View>
<View className="content">{item.content}</View>
<View className="time">{item.createTime}</View>
</View>
</View>
))}
{!list.length && (
<View className="shopComment-empty">当前暂无评论</View>
)}
</View>
</View>
<View className="shopComment-add">
<Textarea
fixed
className="shopComment-add-left"
cursorSpacing={60}
value={comment}
onInput={this.handleComment}
placeholder="说点什么......"
/>
<View className="shopComment-add-right" onClick={this.add}>
评论
</View>
</View>
</View>
)
}
}
export default shopComment
<file_sep>import Taro, { Component } from '@tarojs/taro'
import { View, Text, Image } from '@tarojs/components'
import aboutIcon from '../../assets/user/about.png'
import ideaIcon from '../../assets/user/idea.png'
// import messageIcon from '../../assets/user/message.png'
import { getStorage } from '../../utils/storage'
import OpenTypeButton from '../../components/OpenTypeButton'
import './user.scss'
class UserPage extends Component {
config = {
navigationBarTitleText: '我的',
navigationBarBackgroundColor: '#F0F0F0',
}
constructor(props) {
super(props)
this.state = {
userInfo: {},
}
}
async componentDidShow() {
const userInfo = await getStorage('userInfo')
this.setState({
userInfo: JSON.parse(userInfo),
})
}
handleAbout = () => {
Taro.navigateTo({
url: '/pages/about/about',
})
}
render() {
const {
userInfo: { avatar, nickName, id },
} = this.state
return (
<View className="user">
<View className="user-header">
<Image className="user-photo" src={avatar} />
<View className="user-msg">
<Text className="user-msg-name">{nickName}</Text>
<Text className="user-msg-id">ID:{id}</Text>
</View>
</View>
{/* <View className="user-item">
<Image className="user-item-icon" src={messageIcon} />
消息通知
</View> */}
<View className="user-item">
<OpenTypeButton openType="feedback">
<Image className="user-item-icon" src={ideaIcon} />
意见反馈
</OpenTypeButton>
</View>
<View className="user-item" onClick={this.handleAbout}>
<Image className="user-item-icon" src={aboutIcon} />
关于我们
</View>
</View>
)
}
}
export default UserPage
<file_sep>import Taro from '@tarojs/taro'
import { View, Image } from '@tarojs/components'
import { AtIcon } from 'taro-ui'
import { handlePrice } from '../../utils/number'
import { sliceStr } from '../../utils/string'
import { getGoodImageUrl } from '../../utils/image'
import discountImg from '../../assets/good/discount.png'
import discountPriceImg from '../../assets/good/dicount-pirce.png'
import './index.scss'
// function component 必须首字母大写
export default function ShopGood(props) {
const { data, showBuy, showDelete, onClick, onDelete } = props
// createChannel: 1商品 2内容
const {
skuName,
price,
mainImageUrl,
goodContent,
createChannel = 1,
discount,
} = data
const isGood = Number(createChannel) === 1
const finalPrice = price - discount
return (
<View
className="shopContent-good"
onClick={() => {
onClick && onClick()
}}
>
<Image
className="shopContent-good-image"
src={getGoodImageUrl(mainImageUrl)}
/>
<View className="shopContent-good-content">
{showDelete && (
<View
className="shopContent-good-content-close"
onClick={e => {
e.stopPropagation()
onDelete()
}}
>
<AtIcon value="close-circle" color="#BC1723" />
</View>
)}
<View className="shopContent-good-content-title">{skuName}</View>
{isGood && discount && (
<View className="shopContent-good-content-discount">
<Image src={discountImg} />
{handlePrice(discount)}元劵
</View>
)}
{!isGood && (
<View className="shopContent-good-content-des">
{sliceStr(goodContent || '暂无描述', 60)}
</View>
)}
{isGood && (
<View className="shopContent-good-content-footer">
<View className="shopContent-good-content-footer-price">
¥{handlePrice(finalPrice)}
<Image src={discountPriceImg} />
</View>
{showBuy && <View className="shopContent-good-btn">去购买</View>}
</View>
)}
</View>
</View>
)
}
ShopGood.defaultProps = {
data: {},
}
<file_sep>import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import { AtButton } from 'taro-ui'
import { GOOD_CHANNEL } from '../../../constants'
import './index.scss'
export default class searchDefault extends Component {
render() {
const { listId, onAdd, channel } = this.props
const channelName = GOOD_CHANNEL[channel]
const progress = [
`打开${channelName}APP`,
'复制商品标题',
'打开好物清单',
'点击搜索',
]
return (
<View className="searchDefault">
<View className="search-progress">
<View className="search-progress-header">
{channelName}99%的商品都有优惠券或返利
</View>
<View className="search-progress-body">
{progress.map((des, index) => (
<View className="search-progress-item">
<View className="search-progress-item-left">
<View className="search-progress-item-left-num">{index}</View>
<View className="search-progress-item-left-des">{des}</View>
</View>
{index < 3 && (
<View className="search-progress-item-right"></View>
)}
</View>
))}
</View>
</View>
<View className="search-add">
{listId && <AtButton onClick={onAdd}>创建商品/内容</AtButton>}
</View>
{/* <View className="search-exp">
<View className="search-exp-header">
<Text>最近搜索</Text>
<View className="search-exp-clear">清除</View>
</View>
<View className="search-exp-body">
<View className="search-exp-body-item">耳机</View>
<View className="search-exp-body-item">手机更新迭代</View>
</View>
</View> */}
</View>
)
}
}
<file_sep>import Taro from '@tarojs/taro'
import { View, Swiper, SwiperItem, Image } from '@tarojs/components'
import './index.scss'
import '../home.scss'
export default function Banner(props) {
if (props && props.data && !props.data.length) {
return null
}
return (
<View className="home-banner">
<Swiper circular autoplay interval={3000}>
{props.data.map(item => (
<SwiperItem>
<Image className="home-banner-image" src={item.url} />
</SwiperItem>
))}
</Swiper>
</View>
)
}
Banner.defaultProps = {
data: [],
}
<file_sep>import Taro from '@tarojs/taro'
import { View, Image } from '@tarojs/components'
import { SHOP_STATUS } from '../../../constants'
import { getShopImageUrl, getGoodImageUrl } from '../../../utils/image'
import goodAddImg from '../../../assets/good/add.png'
import './index.scss'
// function component 必须首字母大写
export default function ShopItem(props) {
const {
data: {
listName,
goodCount,
listPic,
privacyType,
colectionCount,
wishGoods = [],
},
onClick,
} = props
return (
<View className="shopItem" onClick={onClick}>
<View className="shopItem-header">
<Image
className="shopItem-header-left"
src={getShopImageUrl(listPic)}
/>
<View className="shopItem-header-right">
<View className="shopItem-header-right-title">{listName}</View>
<View className="shopItem-header-right-content">
{SHOP_STATUS[privacyType]} · {goodCount}件商品 · {colectionCount}
人收藏
</View>
</View>
</View>
<View className="shopItem-body">
{wishGoods && wishGoods.length > 0 ? (
wishGoods.map(item => (
<Image
className="shopItem-body-item"
src={getGoodImageUrl(item.mainImageUrl)}
/>
))
) : (
<Image className="shopItem-body-item" src={goodAddImg} />
)}
</View>
</View>
)
}
ShopItem.defaultProps = {
data: {},
}
<file_sep>import Taro, { Component } from '@tarojs/taro'
import { View, ScrollView } from '@tarojs/components'
import { AtTextarea, AtButton, AtFloatLayout } from 'taro-ui'
import taroFetch from '../../utils/request'
import SearchTop from '../search/searchTop'
import ShopGood from '../../components/ShopGood'
import AddGood from '../../components/AddGood'
import ImagePicker from '../../components/ImagePicker'
import './shopContent.scss'
class shopContent extends Component {
config = {
navigationBarTitleText: '创建内容',
}
constructor(props) {
super(props)
this.state = {
id: null,
listId: null,
title: undefined,
des: undefined,
good: null,
images: [],
goods: [],
search: undefined,
hasGood: false,
showModal: false,
isInEdit: false,
}
}
componentDidMount() {
const { listId, id } = this.$router.params
this.setState(
{
listId,
id,
isInEdit: !!id,
},
() => this.fetchGoodContent()
)
}
componentDidHide() {
this.setState({
showModal: false,
})
}
fetchGoodContent = () => {
const { id, isInEdit } = this.state
if (!isInEdit) return
taroFetch({
url: '/app/goods/getGoodDetailInfo',
data: {
goodId: id,
},
}).then(data => {
const { imageInfo, skuName, goodContent, wishGoodDetail } = data
this.setState({
images: imageInfo || [],
title: skuName,
des: goodContent,
good: wishGoodDetail,
hasGood: !!wishGoodDetail,
})
})
}
handleImages = images => this.setState({ images })
handleInput = type => e => {
this.setState({
[type]: e.target.value,
})
}
submit = () => {
const { title, des, images, good, listId, id, isInEdit } = this.state
if (!title) {
Taro.showToast({
title: '标题必填',
icon: 'none',
duration: 1000,
})
return
}
const params = {
id,
listId,
skuName: title,
goodContent: des,
skuId: (good && good.id) || null,
imageList: images,
}
const url = isInEdit
? '/app/goods/updateContentGood'
: '/app/goods/addContentGood'
taroFetch({
url,
method: 'POST',
data: params,
})
.then(({ id: detailId }) => {
if (isInEdit) {
Taro.navigateBack()
} else {
Taro.redirectTo({
url: `/pages/goodDetail/goodDetail?id=${detailId}&listId=${listId}`,
})
}
})
.catch()
}
handleSearch = value => {
this.setState(
{
search: value,
},
() => {
if (!value) {
this.handleClear()
}
}
)
}
doSearch = () => {
const { search } = this.state
// todo: 搜索清单/商品接口
taroFetch({
url: '/app/goods/getGoodInfo',
data: {
goodInfo: search,
goodChannel: 2, // 1:京东,2:拼多多,3:淘宝
},
})
.then(data => {
this.setState({
goods: data.slice(0, 10) || [],
})
})
.catch(() => {
this.setState({
goods: [],
})
})
}
handleClear = () => {
this.setState({
search: '',
goods: [],
})
}
pickGood = good => {
this.setState(
{
good,
hasGood: true,
},
this.close
)
}
add = () => {
this.setState({
showModal: true,
})
}
close = () => {
this.setState({
showModal: false,
search: '',
goods: [],
})
}
handleDeleteGood = () => {
this.setState({
hasGood: false,
good: {},
})
}
render() {
const {
images,
title,
des,
good,
hasGood,
search,
goods,
showModal,
} = this.state
return (
<View className="shopContent">
<View className="shopContent-images">
<ImagePicker
length={3}
count={9}
urls={images}
onChange={this.handleImages}
/>
</View>
<View className="shopContent-item">
<View className="title">标题</View>
<AtTextarea
maxLength={35}
placeholder="请输入商品/内容标题"
value={title}
onChange={this.handleInput('title')}
/>
</View>
<View className="shopContent-item">
<View className="title">相关商品</View>
{hasGood && (
<ShopGood showDelete onDelete={this.handleDeleteGood} data={good} />
)}
{!hasGood && <AddGood title="添加商品/内容" onClick={this.add} />}
</View>
<View className="shopContent-item">
<View className="title">介绍</View>
<AtTextarea
placeholder="请输入商品/内容介绍"
value={des}
onChange={this.handleInput('des')}
/>
</View>
<AtButton className="shopContent-submit" onClick={this.submit}>
保存并预览
</AtButton>
<AtFloatLayout
scrollY={false}
scrollX={false}
isOpened={showModal}
onClose={this.close}
>
<View className="shopContent-search">
<View className="shopContent-search-head">
<SearchTop
placeholder="输入商品名称"
showActionButton
value={search}
onChange={this.handleSearch}
onSearch={this.doSearch}
onClear={this.handleClear}
/>
</View>
<View className="shopContent-search-body">
{!goods.length && (
<View className="shopContent-search-empty">
暂无商品,请输入关键词搜索
</View>
)}
{goods.length && (
<ScrollView
scrollX={false}
scrollY
scrollWithAnimation
scrollTop={0}
style={{
height: '600rpx',
}}
>
{goods.map(item => (
<ShopGood data={item} onClick={() => this.pickGood(item)} />
))}
</ScrollView>
)}
</View>
</View>
</AtFloatLayout>
</View>
)
}
}
export default shopContent
<file_sep>import Taro from '@tarojs/taro'
import { View, Image, Text } from '@tarojs/components'
import { getShopImageUrl } from '../../../utils/image'
import { AtIcon } from 'taro-ui'
import './index.scss'
// function component 必须首字母大写
export default function ShopDetailMsg(props) {
const { onClose, data } = props
const { listPic, listName, avatar, nickName, listDesc } = data
return (
<View className="ShopDetailMsg">
<View className="ShopDetailMsg-close" onClick={onClose}>
<AtIcon value="close" onClick={onClose} />
</View>
<Image className="ShopDetailMsg-image" src={getShopImageUrl(listPic)} />
<View>{listName}</View>
<View className="ShopDetailMsg-author">
<Image className="ShopDetailMsg-author-photo" src={avatar} />
<Text>{nickName}</Text>
</View>
<View>{listDesc || '暂无描述'}</View>
</View>
)
}
ShopDetailMsg.defaultProps = {
data: {},
}
<file_sep>import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import taroFetch from '../../utils/request'
import Banner from './banner'
import Feature from './feature'
import Recommend from './recommend'
import SearchTop from '../search/searchTop'
import './home.scss'
import '../search/search.scss'
class Home extends Component {
config = {
navigationBarTitleText: '好物清单',
navigationBarBackgroundColor: '#C91623',
navigationBarTextStyle: 'white',
}
constructor(props) {
super(props)
this.state = {
data: {
banner: [],
homeList: [],
selectionList: [],
currentHomeType: 2,
},
}
}
componentDidShow() {
taroFetch({
url: '/app/home/index',
}).then(homeData => {
this.setState({
data: homeData,
})
})
}
focusSearch = () => {
Taro.navigateTo({
url: '/pages/search/search',
})
}
handelRecommend = listType => {
taroFetch({
url: '/app/wishList/selectWishList',
data: {
pageNum: 1,
pageSize: 10,
listType,
},
}).then(data => {
this.setState(preState => ({
...preState,
homeList: data.items,
currentHomeType: listType,
}))
})
}
render() {
const {
data: { banner, homeList, selectionList },
} = this.state
return (
<View className="home">
<View onClick={this.focusSearch} className="home-search">
<SearchTop disabled />
</View>
<Banner data={banner} />
<Feature data={selectionList} />
<Recommend data={homeList} onClick={this.handelRecommend} />
</View>
)
}
}
export default Home
<file_sep>// 清单列表页
import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import taroFetch from '../../utils/request'
import ShopListItem from '../../components/ShopListItem'
import './shopList.scss'
class ShopList extends Component {
config = {
navigationBarTitleText: '清单列表',
navigationBarBackgroundColor: '#C91623',
navigationBarTextStyle: 'white',
}
constructor(props) {
super(props)
this.state = {
data: [],
pageNum: 1,
pageSize: 50,
}
}
componentDidShow() {
this.setState(
{
data: [],
pageNum: 1,
pageSize: 50,
},
this.fetch
)
}
fetch = () => {
const { type } = this.$router.params
const shopListUrlMap = {
myList: '/app/wishList/selectMyAdminWishList',
collectList: '/app/wishList/selectMyCollectionWishList',
}
if (Number(type)) {
this.fetchShopListByType(type)
} else {
this.fetchShopList(shopListUrlMap[type])
}
}
fetchShopList = url => {
const { pageNum, pageSize } = this.state
taroFetch({
url,
data: {
pageNum,
pageSize,
},
}).then(({ wishLists = [] }) => {
this.setState({
data: wishLists,
})
})
}
fetchShopListByType = listType => {
const { pageNum, pageSize } = this.state
taroFetch({
url: '/app/wishList/selectWishList',
data: {
pageNum,
pageSize,
listType,
},
}).then(({ items }) => {
this.setState({
data: items,
})
})
}
toDetail = id => {
Taro.navigateTo({
url: `/pages/shopDetail/shopDetail?id=${id}`,
})
}
// 滚动逻辑暂时删除
// handleScrollToLower = () => {
// const { total, pageSize, pageNum } = this.state
// if (pageSize * pageNum < total) {
// this.setState(
// {
// pageNum: pageNum + 1,
// },
// this.fetch
// )
// }
// }
render() {
const { data } = this.state
if (data && !data.length) {
return null
}
return (
<View className="shopList">
<View className="shopList-box">
{data.map(item => (
<ShopListItem
key={item.id}
data={item}
onClick={() => this.toDetail(item.id)}
/>
))}
</View>
</View>
)
}
}
export default ShopList
<file_sep>import Taro from '@tarojs/taro'
const isDev = false
const devUrl = 'http://4192.168.127.12:8083'
const productionUrl = 'https://www.mygoodslist.com'
const BASE_URL = isDev ? devUrl : productionUrl
// const BASE_URL = 'http://fpy229.imwork.net'
const setToken = token => Taro.setStorage({ key: 'token', data: token })
const getToken = () =>
Taro.getStorage({ key: 'token' })
.then(res => res.data)
.catch(() => '')
const getLoginToken = () =>
new Promise((resolve, reject) => {
Taro.login({
success: function(res) {
if (res.code) {
// 利用code获取登录状态
return fetch({
url: '/app/auth/loginByJsCode',
method: 'POST',
data: {
jsCode: res.code,
channel: 'weixin',
},
}).then(async loginData => {
await setToken(loginData.token)
resolve(loginData.token)
})
} else {
Taro.showToast({
title: '登录失败',
icon: 'none',
duration: 2000,
})
reject('登录失败')
}
},
})
})
async function fetch(options) {
const { url, method = 'GET', data: paramsData, header } = options
let token = await getToken()
if (!token && url !== '/app/auth/loginByJsCode') {
token = await getLoginToken()
}
return Taro.request({
url: `${BASE_URL}${url}`,
method,
data: paramsData,
header: {
...header,
'Content-Type': 'application/json',
'Mini-Token': token,
},
})
.then(async response => {
const {
data: { data, code },
} = response
if (code === '1005') {
// token失效,重新登录,后再次返回该接口
await getLoginToken()
return fetch({
url,
method,
data,
header,
})
}
if (code !== '0000') {
return Promise.reject(response.data)
}
return data
})
.catch(error => {
Taro.showToast({
title: (error && error.msg) || '接口报错,请稍后在试',
icon: 'none',
duration: 2000,
})
return Promise.reject()
})
}
export { setToken, getToken, BASE_URL }
export default fetch
<file_sep>import Taro, { Component } from '@tarojs/taro'
import { View, Button } from '@tarojs/components'
import classnames from 'classnames'
import ShopListItem from '../../../components/ShopListItem'
import './index.scss'
const recommendTypes = {
'2': '推荐',
'3': '官方',
'4': '最近',
'5': '人气',
}
const list = []
for (let index = 0; index < 10; index++) {
const element = { name: '1212' }
list.push(element)
}
export default class Recommend extends Component {
constructor(props) {
super(props)
this.state = {
active: 2, // 默认推荐
}
}
handleToDetail = id => () => {
Taro.navigateTo({
url: `/pages/shopDetail/shopDetail?id=${id}`,
})
}
handleActive = active => () => {
const activeNum = Number(active)
this.setState({ active: activeNum }, () => {
this.props.onClick(activeNum)
})
}
handleFresh = () => {
console.log('刷新')
this.props.onClick(this.state.active)
}
render() {
const { active } = this.state
const { data } = this.props
if (data && !data.length) {
return null
}
return (
<View className="home-recommend">
<View className="home-recommend-header">
{Object.keys(recommendTypes).map(key => (
<View
key={key}
className={classnames('home-recommend-header-item', {
active: active === Number(key),
})}
onClick={this.handleActive(key)}
>
{recommendTypes[key]}
</View>
))}
<Button className="fresh" onClick={this.handleFresh}>
刷新
</Button>
</View>
<View className="home-recommend-body">
{data.map(item => (
<ShopListItem data={item} onClick={this.handleToDetail(item.id)} />
))}
</View>
</View>
)
}
}
Recommend.defaultProps = {
data: [],
}
<file_sep>import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import { TaroCanvasDrawer } from 'taro-plugin-canvas'
export default class TaroPoster extends Component {
render() {
const config = {
width: 200,
height: 600,
}
return (
<View>
生成海报
<TaroCanvasDrawer
config={config}
onCreateSuccess={() => {}}
onCreateFail={() => {}}
/>
</View>
)
}
}
<file_sep>export const sliceStr = (str, num) => {
if (!str) {
return ''
}
return str.length < num ? str : `${str.slice(0, num)}...`
}
export default sliceStr
<file_sep>import Taro from '@tarojs/taro'
import Authorize from '../../components/Authorize'
import ShopPage from './shopPage'
function Shop() {
return (
<Authorize>
<ShopPage />
</Authorize>
)
}
export default Shop
<file_sep>import Taro, { Component } from '@tarojs/taro'
import { View, Text, Image, Button } from '@tarojs/components'
import { AtActionSheet, AtActionSheetItem } from 'taro-ui'
import moreIcon from '../../assets/shopDetail/more.png'
import addIcon from '../../assets/shopDetail/add.png'
import emptyImg from '../../assets/shop/empty.png'
import taroFetch from '../../utils/request'
import ShopHeader from './ShopHeader'
import ShopGood from '../../components/ShopGood'
import AddGood from '../../components/AddGood'
import ShopDetailMsg from './ShopDetailMsg'
import './shopDetail.scss'
class shopDetailPage extends Component {
config = {
navigationBarTitleText: '清单详情页',
navigationBarBackgroundColor: '#484848',
navigationBarTextStyle: 'white',
}
constructor(props) {
super(props)
this.state = {
id: '',
total: 0,
data: {
listGood: {
wishGoods: [],
},
wishList: {},
},
showManage: false,
showDetail: false,
}
}
componentDidShow() {
const { listId } = this.props
this.fetchData(listId)
}
componentDidHide() {
this.close()
}
onShareAppMessage() {
const {
data: {
wishList: { listName },
},
} = this.state
return {
title: listName || '清单详情页',
path: `/pages/shopDetail/shopDetail?id=${this.state.id}`,
}
}
fetchData = id => {
taroFetch({
url: '/app/wishList/selectWishListById',
data: {
listId: id,
},
}).then(data => {
this.setState({
id,
data,
total: data.listGood.total,
})
})
}
handleGoodDetail = good => {
const { id } = good
const {
id: listId,
data: {
wishList: { editPermission },
},
} = this.state
Taro.navigateTo({
url: `/pages/goodDetail/goodDetail?listId=${listId}&id=${id}&editPermission=${editPermission}`,
})
}
openModal = () => {
this.setState({
showManage: true,
})
}
close = () => {
this.setState({
showManage: false,
})
}
edit = () => {
Taro.navigateTo({
url: `/pages/shopEdit/shopEdit?id=${this.state.id}`,
})
}
delete = () => {
taroFetch({
url: '/app/wishList/deleteList',
method: 'POST',
data: {
id: this.state.id,
},
}).then(() => {
Taro.showToast({
title: '删除成功',
icon: 'success',
duration: 1000,
})
Taro.switchTab({
url: '/pages/shop/shop',
})
})
}
handleCollect = () => {
const {
data: {
wishList: { collected },
},
} = this.state
taroFetch({
url: '/app/wishList/addOrCancleListCollection',
method: 'POST',
data: {
listId: this.state.id,
},
}).then(() => {
Taro.showToast({
title: collected ? '取消收藏' : '收藏成功',
icon: 'success',
duration: 1000,
})
this.fetchData(this.state.id)
})
}
handleFavour = () => {
const {
data: {
wishList: { liked },
},
} = this.state
taroFetch({
url: '/app/wishList/addOrCancleListLike',
method: 'POST',
data: {
listId: this.state.id,
},
}).then(() => {
Taro.showToast({
title: liked ? '取消点赞' : '点赞成功',
icon: 'success',
duration: 1000,
})
this.fetchData(this.state.id)
})
}
handleShare = () => {
taroFetch({
url: '/app/share/addShare',
method: 'POST',
data: {
id: this.state.id,
},
}).then(() => {
this.fetchData(this.state.id)
})
}
handleComment = () => {
Taro.navigateTo({
url: `/pages/shopComment/shopComment?id=${this.state.id}`,
})
}
handleShopAction = type => {
switch (type) {
case 'collect':
this.handleCollect()
break
case 'share':
this.handleShare()
break
case 'favour':
this.handleFavour()
break
case 'comment':
this.handleComment()
break
default:
break
}
}
/* 滚动逻辑暂时注释
handleScrollToLower = () => {
const { pageSize, pageNum, total } = this.state
if (pageSize * pageNum < total) {
this.setState(
{
pageNum: pageNum + 1,
},
this.fetchGoods
)
}
}
*/
add = () => {
Taro.navigateTo({
url: `/pages/search/search?listId=${this.state.id}`,
})
}
editGood = () => {
Taro.navigateTo({
url: `/pages/goodList/goodList?listId=${this.state.id}&edit=1`,
})
}
gotoGoodList = () => {
const {
data: {
wishList: { editPermission },
},
} = this.state
Taro.navigateTo({
url: `/pages/goodList/goodList?listId=${this.state.id}&editPermission=${editPermission}`,
})
}
openDetail = () => {
this.setState({
showDetail: true,
})
}
closeDetail = () => {
this.setState({
showDetail: false,
})
}
render() {
const {
data: { listGood, wishList },
showManage,
total,
showDetail,
} = this.state
const { editPermission } = wishList
if (showDetail) {
return <ShopDetailMsg data={wishList} onClose={this.closeDetail} />
}
return (
<View className="shopDetail">
{/* <ShopDetailMsg data={wishList} /> */}
<ShopHeader
data={wishList}
onClick={this.openDetail}
onEvent={this.handleShopAction}
/>
<View className="shopContent">
<View className="shopContent-head">
<Text>全部商品</Text>
{editPermission && (
<View className="shopContent-head-op">
<Image
className="shopContent-head-op-icon icon-add"
src={addIcon}
onClick={this.add}
/>
<Image
className="shopContent-head-op-icon"
src={moreIcon}
onClick={this.openModal}
/>
</View>
)}
</View>
<View className="shopContent-body">
{listGood.wishGoods.length &&
listGood.wishGoods.map(good => (
<ShopGood
data={good}
onClick={() => this.handleGoodDetail(good)}
/>
))}
{!listGood.wishGoods.length &&
(editPermission ? (
<AddGood title="添加商品/内容" onClick={this.add} />
) : (
<View className="empty">暂无商品/内容</View>
))}
{total && total > 10 && (
<Button onClick={this.gotoGoodList}>查看更多商品</Button>
)}
</View>
</View>
<AtActionSheet isOpened={showManage} onClose={this.close}>
<AtActionSheetItem
className="shopDetail-operation-item"
onClick={this.edit}
>
编辑清单
</AtActionSheetItem>
<AtActionSheetItem
className="shopDetail-operation-item"
onClick={this.delete}
>
删除清单
</AtActionSheetItem>
<AtActionSheetItem
className="shopDetail-operation-item"
onClick={this.editGood}
>
编辑商品
</AtActionSheetItem>
</AtActionSheet>
</View>
)
}
}
export default shopDetailPage
<file_sep>import Taro, { Component } from '@tarojs/taro'
import { Image, View, Text } from '@tarojs/components'
import taroFetch from '../../utils/request'
import { setStorage, getStorage } from '../../utils/storage'
import bkImg from '../../assets/authorize/background.png'
import logoImg from '../../assets/authorize/logo.png'
import logoDesImg from '../../assets/authorize/logo-des.png'
import weixinImg from '../../assets/authorize/weixin.png'
import OpenTypeButton from '../OpenTypeButton'
import './index.scss'
export default class Authorize extends Component {
constructor(props) {
super(props)
this.state = {
hasAuthorize: true,
}
}
async componentDidShow() {
let userInfo = await getStorage('userInfo')
if (userInfo) {
userInfo = JSON.parse(userInfo)
}
if (!userInfo || !userInfo.nickName) {
// 没有用户昵称,则意味着没有更新用户信息,此时跳授权页面
userInfo = await this.getServiceInfo()
if (!userInfo || !userInfo.nickName) {
this.setState({
hasAuthorize: false,
})
return
}
await setStorage('userInfo', JSON.stringify(userInfo))
}
}
getSystemInfo = () =>
Taro.getSystemInfo()
.then(res => res)
.catch(error => error)
getUserInfo = () => {
Taro.getSetting({
success: res => {
if (!res.authSetting['scope.userInfo']) {
this.setState({
hasAuthorize: false,
})
} else {
Taro.authorize({
scope: 'scope.userInfo',
success: () => {
Taro.getUserInfo({
success: response => {
this.updateUserInfoToService(response)
},
})
},
})
}
},
})
}
getServiceInfo = () =>
taroFetch({
url: '/app/member/getMemberInfo',
})
.then(res => res)
.catch(error => error)
updateUserInfoToService = async userData => {
const { brand, system, model } = await this.getSystemInfo()
const params = {
userInfo: {
...userData.userInfo,
encryptedData: userData.encryptedData,
iv: userData.iv,
},
systemInfo: {
brand,
system,
model,
},
}
taroFetch({
url: '/app/member/updateMemberInfo',
method: 'POST',
data: params,
}).then(() => {
taroFetch({
url: '/app/member/getMemberInfo',
}).then(res => {
console.log('/app/member/getMemberInfo', res)
})
})
}
handleUserInfo = info => {
console.log(info)
this.setState(
{
hasAuthorize: true,
},
() => {
this.updateUserInfoToService(info.target)
}
)
}
render() {
const { hasAuthorize } = this.state
if (!hasAuthorize) {
return (
<View className="authorize">
<View className="authorize-top">
<View className="authorize-top-content">
<Image className="authorize-img-logo" src={logoImg} />
<Image className="authorize-img-logodes" src={logoDesImg} />
</View>
<Image className="authorize-top-bk" src={bkImg} />
</View>
<View className="authorize-bottom">
<OpenTypeButton
openType="getUserInfo"
onGetUserInfo={this.handleUserInfo}
>
<View className="authorize-bottom-action">
<Image className="authorize-img-weixin" src={weixinImg} />
<Text>授权登录</Text>
</View>
</OpenTypeButton>
</View>
</View>
)
}
return <View>{this.props.children}</View>
}
}
<file_sep>export const GOOD_CHANNEL_MAP = {
JING_DONG: 1,
PIN_DUO_DUO: 2,
TAO_BAO: 3,
}
export const GOOD_CHANNEL = {
1: '京东',
2: '拼多多',
3: '淘宝',
}
export const GOOD_CHANNEL_APPID = {
2: 'wx32540bd863b27570',
}
export const SHOP_LIST_TYPE = {
1: '精选',
2: '推荐',
3: '官方',
4: '最新',
5: '人气',
}
export const SHOP_TYPE_MAP = {
comment: '评论',
favour: '赞',
share: '分享',
collect: '收藏',
}
export const SHOP_STATUS = {
0: '公开',
1: '私有',
}
export const INTRODUCE = 'https://mp.weixin.qq.com/s/V6yS_n83jonkq2rGJ-VhIA'
<file_sep>import Taro from '@tarojs/taro'
import { View } from '@tarojs/components'
import { AtIcon } from 'taro-ui'
import './index.scss'
function AddGood(props) {
const { title, onClick } = props
return (
<View className="addGood" onClick={onClick}>
<AtIcon value="add" color="#BC1723" />
{title}
</View>
)
}
export default AddGood
AddGood.defaultProps = {
title: '',
}
<file_sep>import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import ShopListItem from '../../../components/ShopListItem'
import ShopGood from '../../../components/ShopGood'
import './index.scss'
export default class SearchResult extends Component {
render() {
const {
data: { goods, shopList },
onGoodClick,
onShopClick,
} = this.props
return (
<View className="searchResult">
{shopList.length && (
<View>
<View className="searchResult-title">清单</View>
<View>
{shopList.map(item => (
<ShopListItem
data={item}
onClick={() => onShopClick(item.id)}
/>
))}
</View>
</View>
)}
{goods.length && (
<View>
<View className="searchResult-title">商品</View>
<View>
{goods.map(item => (
<ShopGood data={item} onClick={() => onGoodClick(item)} />
))}
</View>
</View>
)}
</View>
)
}
}
SearchResult.defaultProps = {
data: {
goods: [],
shopList: [],
},
}
<file_sep>// 清单列表页
import Taro, { Component } from '@tarojs/taro'
import { View, Checkbox, Radio } from '@tarojs/components'
import taroFetch from '../../utils/request'
import ShopGood from '../../components/ShopGood'
import './goodList.scss'
class GoodList extends Component {
config = {
navigationBarTitleText: '商品列表',
navigationBarBackgroundColor: '#C91623',
navigationBarTextStyle: 'white',
}
constructor(props) {
super(props)
this.state = {
list: [],
selectedIds: [],
isSelectAll: false,
isInEdit: false,
}
}
componentDidShow() {
const { listId, edit, editPermission } = this.$router.params
console.log(typeof edit, edit)
this.setState({
listId,
isInEdit: !!edit,
editPermission,
})
this.fetch(listId)
}
fetch = listId => {
taroFetch({
url: '/app/goods/getListGoods',
method: 'GET',
data: {
listId,
pageNum: 1,
pageSize: 50,
},
}).then(res => {
this.setState({
listId,
list: res.wishGoods,
})
})
}
select = id => () => {
const { selectedIds, list, isInEdit } = this.state
if (!isInEdit) return
if (selectedIds.includes(id)) {
const thisIndex = selectedIds.findIndex(item => item === id)
selectedIds.splice(thisIndex, 1)
} else {
selectedIds.push(id)
}
const isSelectAll = selectedIds.length === list.length
this.setState({
selectedIds,
isSelectAll,
})
}
pickAll = () => {
const { list, isSelectAll } = this.state
const selectedIds = isSelectAll ? [] : list.map(item => item.id)
this.setState({
isSelectAll: !isSelectAll,
selectedIds,
})
}
delete = () => {
const { listId, selectedIds } = this.state
if (selectedIds.length === 0) return
taroFetch({
url: '/app/goods/deleteListGood',
method: 'POST',
data: {
listId,
goodIds: selectedIds,
},
}).then(() => {
this.clear()
this.fetch(listId)
})
}
clear = () => {
this.setState({
selectedIds: [],
isSelectAll: false,
})
}
goToDetail = good => () => {
const { isInEdit, listId, editPermission } = this.state
if (isInEdit) return
Taro.navigateTo({
url: `/pages/goodDetail/goodDetail?listId=${listId}&id=${good.id}&editPermission=${editPermission}`,
})
}
render() {
const { list, selectedIds, isSelectAll, isInEdit } = this.state
if (list && !list.length) {
return null
}
return (
<View className="goodList">
<View
className="goodList-box"
style={{ paddingBottom: isInEdit ? '50px' : '10px' }}
>
{list.map(item => {
return (
<View
className="goodList-box-item"
onClick={this.select(item.id)}
>
{isInEdit && (
<Checkbox
className="goodList-box-item-check"
color="#BC1723"
checked={selectedIds.includes(item.id)}
/>
)}
<ShopGood data={item} onClick={this.goToDetail(item)} />
</View>
)
})}
</View>
{isInEdit && (
<View className="goodList-operation">
<View className="goodList-operation-box">
<Radio
className="goodList-operation-box-radio"
color="#BC1723"
checked={isSelectAll}
onClick={this.pickAll}
>
全选
</Radio>
<View
className="goodList-operation-box-delete"
onClick={this.delete}
>
删除
</View>
</View>
</View>
)}
</View>
)
}
}
export default GoodList
<file_sep>import Taro from '@tarojs/taro'
import { View, Text, Image } from '@tarojs/components'
import './index.scss'
export default function Categary(props) {
const { listName, listPic } = props.data
return (
<View className="home-feature-categary" onClick={props.onClick}>
<Image className="home-feature-categary-image" src={listPic} />
<Text className="home-feature-categary-title">{listName}</Text>
</View>
)
}
Categary.defaultProps = {
data: {},
}
|
c27371dc5dffa87193fad258426107efcaf2c549
|
[
"JavaScript"
] | 23 |
JavaScript
|
Mrsosann/taro-shopping
|
8bae1cb8d2b8200f147a4e9c46f8bf689cc699c5
|
9485b34fcfba158d1d1830ad11a42ca54286b271
|
refs/heads/master
|
<repo_name>aliahsan/TestDev<file_sep>/extastypie/db_settings.py
import mongoengine
CONN = mongoengine.connect('tasty_database')
import os
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
SECRET_KEY = <KEY>'
RECAPTCHA_PUBLIC_KEY = "<KEY>"
RECAPTCHA_PRIVATE_KEY = "<KEY>"
<file_sep>/extastypie/tastywrapper/fields.py
from tastypie.bundle import Bundle
from tastypie.resources import Resource
from tastypie.fields import ApiField
class ListFieldValue(object):
def __init__(self, value):
self.value = value
class ListField(ApiField):
def __init__(self, inner_field, **kwargs):
super(ListField, self).__init__(**kwargs)
inner_field.attribute = 'value'
self.inner_field = inner_field
def dehydrate(self, bundle):
items = getattr(bundle.obj, self.attribute)
return [self.inner_field.dehydrate(Bundle(obj = ListFieldValue(item))) for item in items]
class DictField(ApiField):
pass
class EmbeddedResourceField(ApiField):
def __init__(self, resource_type, **kwargs):
super(EmbeddedResourceField, self).__init__(**kwargs)
self.resource_type = resource_type
def dehydrate(self, bundle):
doc = getattr(bundle.obj, self.attribute)
return self.resource_type().full_dehydrate(doc)<file_sep>/extastypie/tastywrapper/resources.py
from tastypie.resources import Resource, DeclarativeMetaclass
from tastypie import fields as tasty_fields
from tastypie.bundle import Bundle
from tastypie.exceptions import TastypieError
from mongoengine import EmbeddedDocument
from mongoengine import fields as mongo_fields
from tastywrapper import fields
FIELD_MAP = {
mongo_fields.BooleanField: tasty_fields.BooleanField,
mongo_fields.DateTimeField: tasty_fields.DateTimeField,
mongo_fields.IntField: tasty_fields.IntegerField,
mongo_fields.FloatField: tasty_fields.FloatField,
mongo_fields.DictField: fields.DictField
# Char Fields:
# StringField, ObjectIdField, EmailField, URLField
# TODO
# 'ReferenceField',
# 'DecimalField', 'GenericReferenceField', 'FileField',
# 'BinaryField', , 'GeoPointField']
}
class DocumentDeclarativeMetaclass(DeclarativeMetaclass):
def __new__(cls, name, bases, attrs):
meta = attrs.get('Meta')
if meta:
if hasattr(meta, 'queryset') and not hasattr(meta, 'object_class'):
setattr(meta, 'object_class', meta.queryset._document)
if hasattr(meta, 'object_class') and not hasattr(meta, 'queryset'):
if hasattr(meta.object_class, 'objects'):
setattr(meta, 'queryset', meta.object_class.objects.all())
document_type = getattr(meta, 'object_class')
if issubclass(document_type, EmbeddedDocument):
if hasattr(meta, 'include_resource_uri'):
if getattr(meta, 'include_resource_uri'):
raise TastypieError("include_resource_uri cannot be True when the resource is an instance of EmbeddedDocument: %s" % document_type)
else:
setattr(meta, 'include_resource_uri', False)
new_class = super(DocumentDeclarativeMetaclass, cls).__new__(cls, name, bases, attrs)
fields = getattr(new_class._meta, 'fields', [])
excludes = getattr(new_class._meta, 'excludes', [])
field_names = new_class.base_fields.keys()
for field_name in field_names:
if field_name == 'resource_uri':
continue
if field_name in new_class.declared_fields:
continue
if len(fields) and not field_name in fields:
del(new_class.base_fields[field_name])
if len(excludes) and field_name in excludes:
del(new_class.base_fields[field_name])
# Add in the new fields.
new_class.base_fields.update(new_class.get_fields(fields, excludes))
if getattr(new_class._meta, 'include_absolute_url', True):
if not 'absolute_url' in new_class.base_fields:
new_class.base_fields['absolute_url'] = CharField(attribute='get_absolute_url', readonly=True)
elif 'absolute_url' in new_class.base_fields and not 'absolute_url' in attrs:
del(new_class.base_fields['absolute_url'])
return new_class
class DocumentResource(Resource):
"""
A subclass of ``Resource`` designed to work with mongoengine's ``Document``.
This class will introspect a given ``Document`` and build a field list based
on the fields found on the model (excluding relational fields).
Given that it is aware of Django's ORM, it also handles the CRUD data
operations of the resource.
"""
__metaclass__ = DocumentDeclarativeMetaclass
@classmethod
def resource_for_document_type(cls, document_type):
class Meta:
object_class = document_type
return DocumentDeclarativeMetaclass('%sResource' % document_type.__name__, (DocumentResource,), {'Meta': Meta})
@classmethod
def api_field_from_mongoengine_field(cls, f, default=tasty_fields.CharField):
"""
Returns the field type that would likely be associated with each
mongoengine type.
"""
if isinstance(f, mongo_fields.ListField):
inner_field, field_args = cls.api_field_from_mongoengine_field(f.field)
return fields.ListField, {'inner_field': inner_field(**field_args)}
elif isinstance(f, mongo_fields.EmbeddedDocumentField):
return fields.EmbeddedResourceField, {'resource_type': cls.resource_for_document_type(f.document_type_obj)}
else:
while(f != type):
if f in FIELD_MAP:
return FIELD_MAP[f], { }
f = f.__class__
return default, { }
@classmethod
def get_fields(cls, fields=None, excludes=None):
"""
Given any explicit fields to include and fields to exclude, add
additional fields based on the associated model.
"""
final_fields = {}
fields = fields or []
excludes = excludes or []
if not cls._meta.object_class:
return final_fields
for name, f in cls._meta.object_class._fields.iteritems():
# If the field name is already present, skip
if name in cls.base_fields:
continue
# If field is not present in explicit field listing, skip
if fields and name not in fields:
continue
# If field is in exclude list, skip
if excludes and name in excludes:
continue
api_field_class, kwargs = cls.api_field_from_mongoengine_field(f)
kwargs.update({
'attribute': name,
'unique': f.unique,
'default': f.default
})
if f.required is False:
kwargs['null'] = True
final_fields[name] = api_field_class(**kwargs)
final_fields[name].instance_name = name
return final_fields
def _new_query(self):
return self._meta.queryset.clone()
def get_object_list(self, request):
"""
An ORM-specific implementation of ``get_object_list``.
Returns a queryset that may have been limited by authorization or other
overrides.
"""
base_object_list = self._new_query()
# Limit it as needed.
authed_object_list = self.apply_authorization_limits(request, base_object_list)
return authed_object_list
# TODO support filters
def build_filters(self, filters = None):
return { }
def obj_get_list(self, request=None, **kwargs):
"""
A ORM-specific implementation of ``obj_get_list``.
Takes an optional ``request`` object, whose ``GET`` dictionary can be
used to narrow the query.
"""
filters = None
if hasattr(request, 'GET'):
filters = request.GET
applicable_filters = self.build_filters(filters=filters)
try:
return self.get_object_list(request).filter(**applicable_filters)
except ValueError, e:
raise NotFound("Invalid resource lookup data provided (mismatched type).")
def obj_get(self, request=None, **kwargs):
"""
A ORM-specific implementation of ``obj_get``.
Takes optional ``kwargs``, which are used to narrow the query to find
the instance.
"""
try:
return self.get_object_list(request).get(**kwargs)
except ValueError, e:
raise NotFound("Invalid resource lookup data provided (mismatched type).")
def obj_delete_list(self, request=None, **kwargs):
"""
A ORM-specific implementation of ``obj_delete_list``.
Takes optional ``kwargs``, which can be used to narrow the query.
"""
self.get_object_list(request).filter(**kwargs).delete()
def obj_delete(self, request=None, **kwargs):
"""
A ORM-specific implementation of ``obj_delete``.
Takes optional ``kwargs``, which are used to narrow the query to find
the instance.
"""
try:
obj = self.get_object_list(request).get(**kwargs)
except ObjectDoesNotExist:
raise NotFound("A model instance matching the provided arguments could not be found.")
obj.delete()
def obj_create(self, bundle, request=None, **kwargs):
"""
A ORM-specific implementation of ``obj_create``.
"""
bundle.obj = self._meta.object_class()
for key, value in kwargs.items():
setattr(bundle.obj, key, value)
bundle = self.full_hydrate(bundle)
self.is_valid(bundle,request)
# There should be error handling here in case the creation was not successful but for now I have commented out
#if bundle.errors:
# self.error_response(bundle.errors, request)
bundle.obj.save()
return bundle
def get_resource_uri(self, bundle_or_obj):
"""
Handles generating a resource URI for a single resource.
Uses the model's ``pk`` in order to create the URI.
"""
kwargs = {
'resource_name': self._meta.resource_name,
}
if isinstance(bundle_or_obj, Bundle):
kwargs['pk'] = bundle_or_obj.obj.pk
else:
kwargs['pk'] = bundle_or_obj.id
if self._meta.api_name is not None:
kwargs['api_name'] = self._meta.api_name
return self._build_reverse_url("api_dispatch_detail", kwargs=kwargs)<file_sep>/extastypie/employee/urls.py
from django.conf.urls.defaults import *
from tastypie.api import Api
from employee.api import EmployeeResource
api_v1 = Api(api_name='v1')
api_v1.register(EmployeeResource())
urlpatterns = patterns('employee.views',
url(r'^api/', include(api_v1.urls)),
)<file_sep>/extastypie/employee/core.py
from mongoengine import *
class Employee(Document):
def number():
no = Employee.objects.count()
if no == None:
return 1
else:
return no + 1
_id = IntField(unique=True,primary_key=True, required=True)
first_name = StringField(max_length=255, required=True)
#last_name = StringField(max_length=255, required=True)
#gender = StringField(max_length=1, required=True)
#birth_date = DateTimeField( required=True)
#street1 = StringField(max_length=50, required=True)
#street2 = StringField(max_length=50)
#city = StringField(max_length=50, required=True)
#state = StringField(max_length=50, required=True)
#zip = StringField(max_length=5, required=True)
#phone = StringField(max_length=25, required=True)<file_sep>/extastypie/employee/api.py
from tastypie import fields
from tastypie.authorization import Authorization
from tastypie.constants import ALL
from tastywrapper.resources import DocumentResource
from employee.core import Employee
class EmployeeResource(DocumentResource):
class Meta:
object_class = Employee
resource_name = 'employees'
authorization = Authorization()
|
0af26689b1194ff7fadb968c3ad27d891b0b2a43
|
[
"Python"
] | 6 |
Python
|
aliahsan/TestDev
|
88d770f4cb3c2fcfa54e5d6e4854f5f6619225be
|
f6919451ac35d6ff9613be84c78f8bbe78e05392
|
refs/heads/master
|
<file_sep>var _key = "tag";
// returns the url with key-value pair added to the parameter string.
function insertParam(url, key, value) {
if (url.indexOf('?') != -1) {
var pairset = url.split('&');
var i = pairset.length;
var pair;
key = escape(key);
value = escape(value);
while (i--) {
pair = pairset[i].split('=');
if (pair[0] == key) {
pair[1] = value;
pairset[i] = pair.join('=');
break;
}
}
if (i < 0) {
pairset[pairset.length] = [key, value].join('=');
}
return pairset.join('&');
}
else {
return url + '?' + [key, value].join('=');
}
}
// listen for click on the extensions toolbar button
chrome.browserAction.onClicked.addListener(
function (tab) {
// Open the Amazon deals page
chrome.tabs.create(
{
'url': 'http://www.savepaise.com',
'selected': true
}
);
}
);
// listen for new web page requests to the flipkart site
chrome.webRequest.onBeforeRequest.addListener(
function (details) {
// only for the top-most window (ignore frames)
if (window == top) {
var _keyFlipkart = "affid";
trackId = "praveenaa";
// if the url does not already contain the tracking id
if (details.url.search(trackId) == -1 &&
details.url.search("/api/") == -1 &&
details.url.search("/lc/") == -1 &&
details.url.search("/sw.js") == -1) {
// redirect them to the url with the new tracking id parameter inserted
return {redirectUrl: insertParam(details.url, _keyFlipkart, trackId)};
}
}
},
{
urls: [
"http://www.flipkart.com/*", "https://www.flipkart.com/*",
"http://dl.flipkart.com/*", "https://dl.flipkart.com/*"
],
types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"]
}, // only run for requests to the following urls
['blocking'] // blocking permission necessary in order to perform the redirect
);
// listen for new web page requests to the amazon.in site
chrome.webRequest.onBeforeRequest.addListener(
function (details) {
// only for the top-most window (ignore frames)
if (window == top) {
trackId = "savepaise-21";
// if the url does not already contain the tracking id
if (details.url.search(trackId) == -1 &&
details.url.search("ap/signin") == -1 &&
details.url.search("ap/widget") == -1) {
// redirect them to the url with the new tracking id parameter inserted
return {redirectUrl: insertParam(details.url, _key, trackId)};
}
}
},
{
urls: [
"http://www.amazon.in/*", "https://www.amazon.in/*"],
types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"]
}, // only run for requests to the following urls
['blocking'] // blocking permission necessary in order to perform the redirect
);
var host = "https://linksredirect.com/?pub_id=22090CL19883&source=linkkit&subid=praveen&url=";
chrome.webRequest.onBeforeRequest.addListener(
function (details) {
if (window == top) {
// var urls = new URL(details.url);
// var DomainName = urls.hostname;
return {redirectUrl: host + details.url + details.url.match(/^https?:\/\/[^\/]+([\S\s]*)/)[1]};
}
},
{
urls: [
"*://jabong.com/*",
"*://www.jabong.com/*",
"*://tatacliq.com/*",
"*://www.tatacliq.com/*",
"*://bigbasket.com/*",
"*://www.bigbasket.com/*",
"*://limeroad.com/*",
"*://www.limeroad.com/*",
"*://shopclues.com/*",
"*://www.shopclues.com/*"
],
types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"]
},
["blocking"]
);
|
cde6814d35e14dfb2073704937dbc0975b4c468d
|
[
"JavaScript"
] | 1 |
JavaScript
|
bpkleo2002/savepiseext
|
122d7b7a9b7185611b21202842cb4b9e12d43ac8
|
77d2af4523a4b8a5e7e29237f34c8091c6693528
|
refs/heads/master
|
<repo_name>ryo33/react-state-redux<file_sep>/src/index.js
import connect from './connect'
import reactStateReduxReducer from './reducer'
export {
connect,
reactStateReduxReducer
}
<file_sep>/test/connect.spec.js
import './browser_setup'
import { expect } from 'chai'
import React, { Component } from 'react'
import { createStore } from 'redux'
import { Provider } from 'react-redux'
import TestUtils from 'react-addons-test-utils'
import { getStore, reducerA, reducerB, counter } from './helper.js'
import connect from '../src/connect'
import { PROPS_ID } from '../src/constants'
describe('connect', () => {
class Child extends Component {
render() {
return <div />
}
}
const Connect = connect(undefined, undefined, undefined, undefined, { withRef: true })(Child, counter)
class A extends Component {
render() {
return <div />
}
}
const ConnectA = connect((state, componentState) => ({
state, componentState
}), (dispatch, dispatchToThis) => ({
dispatch, dispatchToThis
}))(A, reducerA)
class B extends Component {
render() {
return <div />
}
}
const ConnectB = connect((state, componentState) => ({
state, componentState
}), (dispatch, dispatchToThis) => ({
dispatch, dispatchToThis
}))(B, reducerB)
it('should receive the props correctly', () => {
const store = getStore()
const tree = TestUtils.renderIntoDocument(
<Provider store={store}>
<Connect a="a" b="b">c</Connect>
</Provider>
)
const child = TestUtils.findRenderedComponentWithType(tree, Child)
const connect = TestUtils.findRenderedComponentWithType(tree, Connect)
expect(child.props.a).to.equal('a')
expect(child.props.b).to.equal('b')
expect(child.props.children).to.equal('c')
expect(child.props[PROPS_ID]).to.match(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
})
it('should add/remove a component to redux store by mount/unmount', () => {
const store = getStore()
const tree = TestUtils.renderIntoDocument(
<Provider store={store}>
<Connect />
</Provider>
)
const child = TestUtils.findRenderedComponentWithType(tree, Child)
const connect = TestUtils.findRenderedComponentWithType(tree, Connect)
const wrappedComponent = connect.getWrappedInstance()
const componentID = child.props[PROPS_ID]
expect(store.getState().reactStateRedux.components).to.have.deep.property(
componentID + '.state', 0
)
child.props.dispatchToThis({ type: 'INCREMENT' })
expect(store.getState().reactStateRedux.components).to.have.deep.property(
componentID + '.state', 1
)
connect.getWrappedInstance().componentWillMount()
expect(store.getState().reactStateRedux.components).to.have.deep.property(
componentID + '.state', 1
)
connect.getWrappedInstance().componentWillUnmount()
child.props.dispatchToThis({ type: 'INCREMENT' })
child.props.dispatchToThis({ type: 'INCREMENT' })
child.props.dispatchToThis({ type: 'INCREMENT' })
connect.getWrappedInstance().componentWillMount()
expect(store.getState().reactStateRedux.components).to.have.deep.property(
componentID + '.state', 1
)
})
it('dispatch ADD to both', () => {
const store = getStore()
const tree = TestUtils.renderIntoDocument(
<Provider store={store}>
<div>
<ConnectA />
<ConnectB />
</div>
</Provider>
)
const a = TestUtils.findRenderedComponentWithType(tree, A)
const b = TestUtils.findRenderedComponentWithType(tree, B)
a.props.dispatch({
type: 'ADD',
payload: 10
})
expect(a.props.componentState).to.equal(10)
expect(b.props.componentState).to.deep.equal([10])
b.props.dispatch({
type: 'ADD',
payload: 5
})
expect(a.props.componentState).to.equal(15)
expect(b.props.componentState).to.deep.equal([10, 5])
})
it('dispatch ADD to A', () => {
const store = getStore()
const tree = TestUtils.renderIntoDocument(
<Provider store={store}>
<div>
<ConnectA />
<ConnectB />
</div>
</Provider>
)
const a = TestUtils.findRenderedComponentWithType(tree, A)
const b = TestUtils.findRenderedComponentWithType(tree, B)
a.props.dispatchToThis({
type: 'ADD',
payload: 10
})
expect(a.props.componentState).to.equal(10)
expect(b.props.componentState).to.deep.equal([])
})
it('dispatch ADD to B', () => {
const store = getStore()
const tree = TestUtils.renderIntoDocument(
<Provider store={store}>
<div>
<ConnectA />
<ConnectB />
</div>
</Provider>
)
const a = TestUtils.findRenderedComponentWithType(tree, A)
const b = TestUtils.findRenderedComponentWithType(tree, B)
b.props.dispatchToThis({
type: 'ADD',
payload: 10
})
expect(a.props.componentState).to.equal(0)
expect(b.props.componentState).to.deep.equal([10])
})
it('dispatch INCREMENT', () => {
const store = getStore()
const tree = TestUtils.renderIntoDocument(
<Provider store={store}>
<div>
<ConnectA />
<ConnectB />
</div>
</Provider>
)
const a = TestUtils.findRenderedComponentWithType(tree, A)
const b = TestUtils.findRenderedComponentWithType(tree, B)
expect(a.props.state.counter).to.equal(0)
expect(b.props.state.counter).to.deep.equal(0)
a.props.dispatch({
type: 'INCREMENT'
})
expect(a.props.state.counter).to.equal(1)
expect(b.props.state.counter).to.deep.equal(1)
b.props.dispatch({
type: 'INCREMENT'
})
expect(a.props.state.counter).to.equal(2)
expect(b.props.state.counter).to.deep.equal(2)
})
})
<file_sep>/src/connect.js
import { Component, createElement } from 'react'
import { connect } from 'react-redux'
import hoistStatics from 'hoist-non-react-statics'
import { fromJS } from 'immutable'
import uuid from 'uuid'
import { INIT, ADD_COMPONENT, REMOVE_COMPONENT, PROPS_ID, DISPATCH_TO } from './constants'
const defaultMapStateToProps = (state, componentState) => ({})
const defaultMapDispatchToProps = (dispatch, dispatchToThis) => ({ dispatch, dispatchToThis })
export default function connectToComponentState(mapStateToProps, mapDispatchToProps, mergeProps, options, options2) {
const mapState = mapStateToProps || defaultMapStateToProps
const mapDispatch = mapDispatchToProps || defaultMapDispatchToProps
const finalMapStateToProps = (state, props) => {
const id = props[PROPS_ID]
const componentState = state.reactStateRedux.components[id].state
return mapState(state, componentState, props)
}
const finalMapDispatchToProps = (dispatch, props) => {
const id = props[PROPS_ID]
const dispatchToThis = (action) => dispatch({
type: DISPATCH_TO,
payload: {
id, action
}
})
return mapDispatch(dispatch, dispatchToThis, props)
}
return (wrappedComponent, reducer) => {
const finalWrappedComponent = connect(
finalMapStateToProps,
finalMapDispatchToProps,
mergeProps,
options
)(wrappedComponent)
class ConnectToComponentState extends Component {
constructor(props, context) {
super(props, context)
this.componentID = uuid.v4()
const initialState = reducer(undefined, { type: INIT })
this.state = {
componentState: initialState
}
}
componentWillMount() {
this.props.dispatch({
type: ADD_COMPONENT,
payload: {
id: this.componentID,
reducer,
state: this.state.componentState
}
})
}
componentWillUnmount() {
this.props.dispatch({
type: REMOVE_COMPONENT,
payload: {
id: this.componentID,
}
})
}
componentWillReceiveProps(nextProps) {
const component = nextProps.reactStateRedux.components[this.componentID]
if (component) {
this.setState({
componentState: component.state
})
}
}
render() {
const props = fromJS(this.props)
.set(PROPS_ID, this.componentID)
.toJS()
return this.props.reactStateRedux.components[this.componentID]
? createElement(
finalWrappedComponent,
props
)
: null
}
}
return connect(
({ reactStateRedux }) => ({ reactStateRedux }), undefined, undefined, options2
)(hoistStatics(ConnectToComponentState, finalWrappedComponent))
}
}
<file_sep>/src/constants.js
// Actions
export const INIT = '@@react-state-redux/INIT'
export const DISPATCH_TO = '@@react-state-redux/DISPATCH_TO'
export const ADD_COMPONENT = '@@react-state-redux/ADD_COMPONENT'
export const REMOVE_COMPONENT = '@@react-state-redux/REMOVE_COMPONENT'
// The name of props which has the components' IDs
export const PROPS_ID = '@@react-state-redux/componentID'
<file_sep>/example/src/TextField.js
import React from 'react'
import { connect } from '../../src/index'
const mapStateToProps = (state, componentState) => ({
value: componentState
})
function componentReducer(state = "", { type, payload }) {
switch (type) {
case 'CHANGE':
return payload
default:
return state
}
}
const TextField = ({ value, dispatch, dispatchToThis }) => <div>
<input
value={value}
onChange={(event) => dispatchToThis({type: 'CHANGE', payload: event.target.value})}
/>
</div>
export default connect(mapStateToProps)(TextField, componentReducer)
<file_sep>/src/reducer.js
import { fromJS } from 'immutable'
import { ADD_COMPONENT, REMOVE_COMPONENT, DISPATCH_TO } from './constants'
const initialState = {
components: {}
}
const createComponent = (reducer, state) => ({ reducer, state })
export default function reducer(state = initialState, action) {
const { type, payload, meta } = action
switch (type) {
case ADD_COMPONENT:
{
const { id, reducer } = payload
const componentState = payload.state
return fromJS(state)
.setIn(['components', id], createComponent(reducer, componentState)).toJS()
}
case REMOVE_COMPONENT:
{
const { id } = payload
return fromJS(state)
.deleteIn(['components', id]).toJS()
}
case DISPATCH_TO:
{
const { id, action } = payload
return fromJS(state).updateIn(['components', id], (component) => {
if (component) {
return component
.set('state', component.get('reducer')(component.get('state'), action))
}
}).toJS()
}
default:
return fromJS(state).update('components', (components) => {
return components.map((component) => {
return component
.set('state', component.get('reducer')(component.get('state'), action))
})
}).toJS()
}
}
|
8a3836ff06c9b132413bb15202151391488ee6e1
|
[
"JavaScript"
] | 6 |
JavaScript
|
ryo33/react-state-redux
|
b0316b576b1fd655079855646ad352ad241ff860
|
4354bcf61e19649d21c2d26192333c0b6568bad9
|
refs/heads/master
|
<file_sep>package com.qihoo.ai.drivemanner;
import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity{
private static final String TAG = MainActivity.class.getSimpleName();
private TextView gSensorTextX;
private TextView gSensorTextY;
private TextView gSensorTextZ;
private Intent intent;
private View view;
private Thread thread;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mThread();
gSensorTextX = (TextView)findViewById(R.id.gSensorTextX);
gSensorTextY = (TextView)findViewById(R.id.gSensorTextY);
gSensorTextZ = (TextView)findViewById(R.id.gSensorTextZ);
}
@Override
protected void onResume() {
super.onResume();
intent = new Intent(this, CollisionService.class);
startService(intent);
}
@Override
protected void onPause() {
super.onPause();
stopService(intent);
}
Handler handler = new Handler() {
public void handleMessage(Message msg) {
super.handleMessage(msg);
}
};
private void mThread() {
if (thread == null) {
thread = new Thread(new Runnable() {
public void run() {
while (true) {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (CollisionService.flag) {
Message msg = new Message();
handler.sendMessage(msg);
}
}
}
});
thread.start();
}
}
}
|
d5ebb06676024642179f5dfb337a23a2ef31a734
|
[
"Java"
] | 1 |
Java
|
PeterPan506/DriveManner
|
824461abfb87bab1fd9a433e879fab2ef3c5ea8c
|
9da3a1bcc836c148e705574ad4fa375a205ef4c3
|
refs/heads/master
|
<file_sep>using OsuUtil.Beatmap;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace osu_player.Songs
{
public struct SongInfo
{
public String FolderName;
public String Background;
public String Song;
public String ArtistName;
public String ArtistNameUnicode;
public String Title;
public String TitleUnicode;
public static SongInfo FromBeatmap(IBeatmap map)
{
return new SongInfo
{
Title = map.RankedName,
TitleUnicode = map.RankedNameUnicode,
ArtistName = map.Artist,
ArtistNameUnicode = map.ArtistUnicode,
FolderName = map.SongFolderName,
Song = map.AudioFileName
};
}
}
}
<file_sep>using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace osu_player.Visualization
{
public class TriangleContainer : Container
{
private const float create_chance = 0.1f;
private const float triangle_min_size = 55f;
private const float triangle_max_size = 95f;
private const float triangle_min_speed = 2250f;
private const float triangle_max_speed = 4500f;
public ColourInfo TriangleColour { get; set; }
public TriangleContainer() : base()
{
TriangleColour = Color4.Black;
}
protected override void Update()
{
Random rnd = new Random();
if (rnd.NextDouble() <= create_chance)
{
float size = triangle_min_size + (float) (rnd.NextDouble() * (triangle_max_size - triangle_min_size));
Triangle triangle = new Triangle()
{
Origin = Anchor.Centre,
Colour = TriangleColour,
Alpha = 0.015f + (float) (rnd.NextDouble() * 0.135f),
Size = new Vector2(size),
Position = new Vector2((float) (rnd.NextDouble() * DrawWidth), DrawHeight + size)
};
Add(triangle);
triangle.MoveToY(-size, triangle_min_speed + (triangle_max_speed - triangle_min_speed) * rnd.NextDouble()).Expire();
}
base.Update();
}
}
}
<file_sep>using OsuUtil.Beatmap;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace osu_player.Taskbar
{
public class TaskbarMenu : ContextMenu
{
public TaskbarOption TaskbarOption { get; }
internal MenuItem infoItem;
internal MenuItem songInfoItem;
internal MenuItem nextSongItem;
internal MenuItem toggleWallpaper;
internal MenuItem closeItem;
internal MenuItem collectionSelection;
internal MenuItem notSelected;
public TaskbarMenu(TaskbarOption taskbarOption)
{
TaskbarOption = taskbarOption;
infoItem = new MenuItem
{
Text = "osu!player by storycraft",
Enabled = false
};
songInfoItem = new MenuItem
{
Text = "",
Enabled = false
};
(nextSongItem = new MenuItem
{
Text = "곡 변경",
}).Click += OnNextSongItemClick;
collectionSelection = new MenuItem
{
Text = "재생 목록 선택",
};
notSelected = new MenuItem
{
Text = "선택 안함",
};
notSelected.Click += OnCollectionReset;
(toggleWallpaper = new MenuItem
{
Text = "월페이퍼 렌더링 토글",
}).Click += OnToggleWallpaper;
toggleWallpaper.Checked = taskbarOption.Application.WallpaperMode;
(closeItem = new MenuItem
{
Text = "닫기",
}).Click += OnCloseItemClick;
MenuItems.Add(infoItem);
MenuItems.Add(new MenuItem
{
Text = "-",
Enabled = false
});
MenuItems.Add(songInfoItem);
MenuItems.Add(nextSongItem);
MenuItems.Add(collectionSelection);
MenuItems.Add(toggleWallpaper);
MenuItems.Add(closeItem);
}
internal void OnLoad()
{
notSelected.Checked = !TaskbarOption.Application.SongSelector.CollectionMode;
collectionSelection.MenuItems.Add(notSelected);
foreach (string name in TaskbarOption.Application.CollectionDb.CollectionSet.Keys)
{
if (TaskbarOption.Application.CollectionDb.CollectionSet[name].Count < 1)
continue;
List<IBeatmap> beatmapList = new List<IBeatmap>();
foreach (string hash in TaskbarOption.Application.CollectionDb.CollectionSet[name])
{
if (!TaskbarOption.Application.OsuDb.HasBeatmapHash(hash))
continue;
IBeatmap map = TaskbarOption.Application.OsuDb.GetBeatmapByHash(hash);
beatmapList.Add(map);
}
if (beatmapList.Count < 1)
continue;
MenuItem item = new MenuItem
{
Text = name + " - ( " + beatmapList.Count + " )"
};
item.Click += (object sender, EventArgs e) =>
{
OnCollectionSelect(item, beatmapList);
};
collectionSelection.MenuItems.Add(item);
}
}
private void OnToggleWallpaper(object sender, EventArgs e)
{
toggleWallpaper.Checked = TaskbarOption.Application.WallpaperMode = !toggleWallpaper.Checked;
}
private void OnNextSongItemClick(object sender, EventArgs e)
{
TaskbarOption.Application.PlayRandomSong();
}
private void OnCloseItemClick(object sender, EventArgs e)
{
TaskbarOption.Application.Exit();
}
private void OnCollectionReset(object sender, EventArgs e)
{
if (notSelected.Checked)
return;
foreach (MenuItem childItem in notSelected.Parent.MenuItems)
childItem.Checked = false;
notSelected.Checked = true;
TaskbarOption.Application.SongSelector.CollectionMode = false;
}
private void OnCollectionSelect(MenuItem item, List<IBeatmap> list)
{
if (item.Checked)
return;
foreach (MenuItem childItem in item.Parent.MenuItems)
childItem.Checked = false;
item.Checked = true;
TaskbarOption.Application.SongSelector.CollectionMode = true;
TaskbarOption.Application.SongSelector.PlayCollection = list;
}
}
}
<file_sep>using BMAPI.v1;
using BMAPI.v1.Events;
using OsuUtil.Beatmap;
using OsuUtil.DataBase;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace osu_player.Songs
{
public class SongSelector
{
public BeatmapDb BeatmapDb { get; }
public CollectionDb CollectionDb { get; }
public DirectoryInfo SongsFolder { get; }
public bool CollectionMode { get; set; }
public List<IBeatmap> PlayCollection { get; set; }
public SongSelector(BeatmapDb beatmapDb, CollectionDb collectionDb, DirectoryInfo songsFolder)
{
BeatmapDb = beatmapDb;
CollectionDb = collectionDb;
SongsFolder = songsFolder;
CollectionMode = false;
}
public SongInfo GetRandom()
{
List<IBeatmapSet> beatmapSetList = BeatmapDb.BeatmapSets.Values.ToList();
List<IBeatmap> beatmapList;
if (CollectionMode)
{
beatmapList = PlayCollection;
}
else
{
IBeatmapSet mapSet = beatmapSetList[(int)(new Random().NextDouble() * (beatmapSetList.Count - 1))];
beatmapList = mapSet.Beatmaps.Values.ToList();
}
IBeatmap map = beatmapList[(int) (new Random().NextDouble() * (beatmapList.Count - 1))];
DirectoryInfo beatmapFolder = new DirectoryInfo(SongsFolder.FullName + Path.DirectorySeparatorChar + map.SongFolderName);
Beatmap bm = new Beatmap(beatmapFolder.FullName + Path.DirectorySeparatorChar + map.OsuFileName);
ContentEvent backgroundEvent = null;
foreach (EventBase e in bm.Events)
{
if (e is ContentEvent contentEvent)
{
if (contentEvent.Type == ContentType.Image)
{
backgroundEvent = contentEvent;
break;
}
}
}
return new SongInfo
{
Title = bm.Title,
TitleUnicode = bm.TitleUnicode,
ArtistName = bm.Artist,
ArtistNameUnicode = bm.ArtistUnicode,
Song = beatmapFolder.FullName + Path.DirectorySeparatorChar + bm.AudioFilename,
Background = backgroundEvent == null ? null : beatmapFolder.FullName + Path.DirectorySeparatorChar + backgroundEvent.Filename
};
}
}
}
<file_sep>using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu_player.Songs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace osu_player.Visualization
{
public class PlayInfoContainer : ParallaxContainer
{
public BeatmapSongPlayer Player { get; }
public AudioVisualizer Visualizer { get; }
public Box CircularBox { get; }
public CircularContainer Circular { get; }
public TriangleContainer TriangleContainer { get; }
private Container InfoContainer { get; }
public SpriteText TitleText { get; set; }
public SpriteText ArtistText { get; set; }
public SpriteText ProgressText { get; set; }
public CircularProgress ProgressBar { get; }
public PlayInfoContainer(BeatmapSongPlayer player)
{
Player = player;
Children = new Drawable[]{
Visualizer = new AudioVisualizer(player)
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Size = new OpenTK.Vector2(450f, 450f),
Depth = -3
},
Circular = new CircularContainer()
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Size = new OpenTK.Vector2(450f, 450f),
Masking = true,
CornerRadius = 175f,
Depth = -4,
Children = new Drawable[]
{
ProgressBar = new CircularProgress()
{
Margin = new MarginPadding(50f),
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Colour = Color4.White,
Depth = -4
},
InfoContainer = new CircularContainer()
{
Size = new OpenTK.Vector2(400f, 400f),
Margin = new MarginPadding(50f),
Masking = true,
CornerRadius = 400f / 2f,
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Lighten(1.15f).Opacity(75),
Radius = 3f
},
Depth = -4,
Children = new Drawable[]
{
TriangleContainer = new TriangleContainer()
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Depth = -5,
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding(25f),
Children = new Drawable[]
{
TitleText = CreateTitleText("Title"),
ArtistText = CreateArtistText("Artist"),
ProgressText = new SpriteText()
{
Origin = Anchor.Centre,
Anchor = Anchor.BottomCentre,
Font = "OpenSans",
Colour = Color4.Black,
TextSize = 30f,
Text = "0:00 / 0:00",
Depth = -6
},
new Box()
{
RelativeSizeAxes = Axes.Both
}
}
},
new Box()
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.White
}
}
},
CircularBox = new Box()
{
RelativeSizeAxes = Axes.Both
}
},
}
};
EdgeEffect = new EdgeEffectParameters
{
Colour = Color4.Black.Lighten(1.25f).Opacity(0.6f),
Radius = 5f
};
}
private SongInfo songInfo;
public SongInfo SongInfo
{
get
{
return songInfo;
}
set
{
songInfo = value;
TitleText.FadeOutFromOne(1000).Expire();
ArtistText.FadeOutFromOne(1000).Expire();
InfoContainer.Add(TitleText = CreateTitleText(value.Title));
InfoContainer.Add(ArtistText = CreateArtistText(value.ArtistName));
TitleText.FadeInFromZero(1000);
ArtistText.FadeInFromZero(1000);
}
}
protected override void Update()
{
ProgressBar.Current.Value = (float)Player.CurrentTime / Math.Max(Player.PlayTime, 1);
string progressText = "";
int seconds = (int)(Player.CurrentTime / 1000);
int minutes = seconds / 60;
int hours = minutes / 60;
if (hours > 0)
progressText += hours + ":";
progressText += minutes % 60 + ":";
progressText += seconds % 60;
progressText += " / ";
seconds = (int)(Player.PlayTime / 1000);
minutes = seconds / 60;
hours = minutes / 60;
if (hours > 0)
progressText += hours + ":";
progressText += minutes % 60 + ":";
progressText += seconds % 60;
ProgressText.Text = progressText;
base.Update();
}
protected SpriteText CreateTitleText(string title)
{
return new SpriteText()
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Font = "OpenSans",
Colour = Color4.Black,
TextSize = 45f,
Text = title,
Depth = -6
};
}
protected SpriteText CreateArtistText(string artist)
{
return new SpriteText()
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Y = 40,
Font = "OpenSans",
Colour = Color4.Black,
TextSize = 25f,
Text = artist,
Depth = -6
};
}
}
}<file_sep>using System;
using System.Drawing;
using System.Windows.Forms;
namespace osu_player.Taskbar
{
public class TaskbarOption
{
public CustomPaper Application { get; }
public NotifyIcon TaskbarIcon { get; }
public TaskbarMenu TaskbarMenu { get; }
public TaskbarOption(CustomPaper application)
{
Application = application;
TaskbarIcon = new NotifyIcon();
TaskbarIcon.ContextMenu = TaskbarMenu = new TaskbarMenu(this);
TaskbarIcon.Icon = SystemIcons.Application;
}
public bool Visible
{
get
{
return TaskbarIcon.Visible;
}
set
{
TaskbarIcon.Visible = value;
}
}
public Icon Icon
{
get
{
return TaskbarIcon.Icon;
}
set
{
TaskbarIcon.Icon = value;
}
}
public String InfoMessage
{
get
{
return TaskbarIcon.Text;
}
set
{
TaskbarIcon.Text = value;
TaskbarMenu.songInfoItem.Text = value;
}
}
internal void OnLoad()
{
TaskbarMenu.OnLoad();
}
}
}
<file_sep># osu-player
<file_sep>using osu.Framework;
using osu.Framework.Allocation;
using OpenTK;
using StoryWallpaper;
using System.Drawing;
using System.Windows.Forms;
using System;
using osu_player.Taskbar;
using osu_player.Visualization;
using System.IO;
using OsuUtil;
using osu_player.Songs;
using OsuUtil.DataBase;
using osu.Framework.Graphics;
using System.Collections.Generic;
using OsuUtil.Beatmap;
namespace osu_player
{
public class CustomPaper : Game
{
public TaskbarOption TaskbarOption { get; }
public BeatmapSongPlayer SongPlayer { get; private set; }
public SongSelector SongSelector { get; private set; }
public DesktopWallpaper DesktopWallpaper { get; private set; }
public BeatmapDb OsuDb { get; private set; }
public CollectionDb CollectionDb { get; private set; }
public DirectoryInfo OsuFolder { get => new DirectoryInfo(OsuFinder.TryFindOsuLocation()); }
public DirectoryInfo SongsFolder { get => new DirectoryInfo(OsuFolder.FullName + Path.DirectorySeparatorChar + "Songs"); }
public event EventHandler OnSongChange;
public CustomPaper()
{
Name = "CustomPaper";
wallpaperMode = true;
TaskbarOption = new TaskbarOption(this);
}
[BackgroundDependencyLoader]
private void load()
{
Window.IconChanged += UpdateTaskbarIcon;
TaskbarOption.Visible = true;
if (!OsuFinder.IsOsuInstalled())
{
MessageBox.Show("osu!가 설치되어 있지 않은 것 같습니다.\n프로그램을 종료합니다.", "CustomPaper", MessageBoxButtons.OK, MessageBoxIcon.Error);
Exit();
}
try
{
OsuDb = OsuDbReader.ParseFromStream(new FileStream(OsuFolder.FullName + Path.DirectorySeparatorChar + "osu!.db", FileMode.Open));
} catch (Exception e)
{
MessageBox.Show("osu! 비트맵 리스트를 파싱할 수 없습니다. 프로그램이 종료됩니다.\n" + e.StackTrace, "CustomPaper", MessageBoxButtons.OK, MessageBoxIcon.Error);
Exit();
}
try
{
CollectionDb = OsuCollectionReader.ParseFromStream(new FileStream(OsuFolder.FullName + Path.DirectorySeparatorChar + "collection.db", FileMode.Open));
} catch (Exception e)
{
CollectionDb = new OsuCollectionDb(new Dictionary<string, List<string>>());
MessageBox.Show("osu! 컬렉션 리스트를 파싱할 수 없습니다. 컬렉션 모드가 비 활성화 됩니다.\n" + e.StackTrace, "CustomPaper", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
SongSelector = new SongSelector(OsuDb, CollectionDb, SongsFolder);
SongPlayer = new BeatmapSongPlayer(this);
Host.Exited += OnExited;
DesktopWallpaper = new DesktopWallpaper(this);
Window.Visible = false;
Add(DesktopWallpaper.PlayerDrawable);
AppendToDesktop();
TaskbarOption.OnLoad();
PlayRandomSong();
}
private void AppendToDesktop()
{
Rectangle virtualRect = SystemInformation.VirtualScreen;
Window.WindowState = WindowState.Minimized;
DesktopTool.AppendToWallpaperArea(Window.WindowInfo.Handle);
Window.WindowBorder = WindowBorder.Hidden;
Window.Location = new Point(-virtualRect.Left, -virtualRect.Top);
Window.Size = Screen.PrimaryScreen.Bounds.Size;
DesktopTool.UpdateWallpaper();
Window.Visible = true;
}
private SongInfo currentSong;
public SongInfo CurrentSong
{
get
{
return currentSong;
}
set
{
currentSong = value;
OnSongChange?.Invoke(this, EventArgs.Empty);
DesktopWallpaper.CurrentSongInfo = value;
SongPlayer.CurrentSong = value;
TaskbarOption.InfoMessage = "Now Playing: " + value.ArtistNameUnicode + " - " + value.TitleUnicode;
SongPlayer.Play();
}
}
public void PlayRandomSong()
{
try
{
CurrentSong = SongSelector.GetRandom();
Console.WriteLine("Now Playing : " + CurrentSong.Title);
}
catch (Exception e)
{
Console.WriteLine("Error " + e.StackTrace);
PlayRandomSong();
}
}
private bool wallpaperMode;
public bool WallpaperMode
{
get => wallpaperMode;
set
{
if (wallpaperMode == value) return;
wallpaperMode = value;
if (wallpaperMode)
{
Window.Visible = true;
Host.DrawThread.InactiveHz = 0;
Host.UpdateThread.InactiveHz = 0;
}
else
{
Window.Visible = false;
Host.DrawThread.InactiveHz = 1;
Host.UpdateThread.InactiveHz = 10;
DesktopTool.UpdateWallpaper();
}
}
}
private void UpdateTaskbarIcon(object sender, EventArgs e)
{
TaskbarOption.Icon = Window.Icon;
}
protected override void Update()
{
base.Update();
if (SongPlayer.HasCompleted)
PlayRandomSong();
}
protected void OnExited()
{
TaskbarOption.Visible = false;
DesktopTool.UpdateWallpaper();
}
}
}
<file_sep>using osu.Framework;
using osu.Framework.Platform;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace osu_player
{
class Program
{
[STAThread]
public static void Main()
{
using (Game game = new CustomPaper())
{
using (GameHost host = Host.GetSuitableHost(@"custom-paper"))
{
host.Run(game);
}
}
}
}
}
<file_sep>using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Audio.Track;
using osu.Framework.IO.Stores;
using OsuUtil.Beatmap;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace osu_player.Songs
{
public class BeatmapSongPlayer
{
public CustomPaper Application { get; }
public AudioManager Audio { get => Application.Audio; }
public TrackBass CurrentTrack { get; private set; }
private SongInfo currentSong;
public SongInfo CurrentSong
{
get
{
return currentSong;
}
set
{
currentSong = value;
using (FileStream fs = new FileStream(value.Song, FileMode.Open))
{
Stream = new MemoryStream();
byte[] buffer = new byte[65535];
int readed;
while ((readed = fs.Read(buffer, 0, buffer.Length)) > 0)
{
Stream.Write(buffer, 0, readed);
}
}
CurrentTrack?.Stop();
CurrentTrack = new TrackBass(Stream);
Audio.Track.AddItem(CurrentTrack);
}
}
public Stream Stream { get; private set; }
public double CurrentTime { get => CurrentTrack.CurrentTime; set => CurrentTrack.Seek(value); }
public double PlayTime { get => CurrentTrack.Length; }
public double PlayRate { get => CurrentTrack.Rate; set => CurrentTrack.Rate = value; }
public bool IsPlaying { get => CurrentTrack.IsRunning; }
public bool HasCompleted { get => CurrentTrack.HasCompleted; }
public BeatmapSongPlayer(CustomPaper application)
{
Application = application;
}
public void Play()
{
CurrentTrack.Start();
}
public void Stop()
{
CurrentTrack.Stop();
}
}
}
<file_sep>using osu_player.Songs;
using osu.Framework.Graphics.Textures;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using OpenTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Effects;
using osu.Framework.Input;
using OpenTK;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics.OpenGL.Textures;
using System.Drawing;
namespace osu_player.Visualization
{
public class DesktopWallpaper
{
public CustomPaper Application { get; }
public Container PlayerDrawable { get; }
public PlayInfoContainer PlayInfoContainer { get; }
public ParallaxContainer BackgroundContainer { get; }
private Box BackgroundBox { get; set; }
private Texture background;
public Texture Background
{
get => background;
private set
{
background = value;
if (BackgroundBox != null)
BackgroundBox.FadeOutFromOne(1000).Expire();
BackgroundContainer.Add(BackgroundBox = CreateBackgroundBox());
BackgroundBox.FadeInFromZero(1000);
}
}
public DesktopWallpaper(CustomPaper application)
{
Application = application;
PlayInfoContainer = new PlayInfoContainer(application.SongPlayer)
{
ParallaxAmount = 0.02f,
Depth = -3,
Scale = new Vector2(1.0f)
};
PlayInfoContainer.ScaleTo(1f, 1000f, Easing.OutQuart);
BackgroundContainer = new ParallaxContainer()
{
RelativeSizeAxes = Axes.Both,
ParallaxAmount = 0.0125f,
Depth = -1,
Children = new[]
{
new Box()
{
RelativeSizeAxes = Axes.Both,
Depth = -2,
Colour = Color4.Black,
Alpha = 0.33f
}
}
};
PlayerDrawable = new Container()
{
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
PlayInfoContainer,
BackgroundContainer,
new Box()
{
RelativeSizeAxes = Axes.Both
}
}
};
}
private SongInfo currentSongInfo;
public SongInfo CurrentSongInfo
{
get => currentSongInfo;
set
{
currentSongInfo = value;
try
{
PlayInfoContainer.SongInfo = value;
FileStream stream = new FileStream(value.Background, FileMode.Open);
Background = TextureLoader.FromStream(stream);
Color4 color = Color4.White;
Random rnd = new Random();
using (Bitmap bitmap = new Bitmap(stream))
{
Color accentColor = bitmap.GetPixel((int)(rnd.NextDouble() * bitmap.Width), (int)(rnd.NextDouble() * bitmap.Height));
color = new Color4(accentColor.R, accentColor.G, accentColor.B, 255).Lighten(1.33f);
}
PlayInfoContainer.Visualizer.AccentColour = color.Lighten(1.05f).Opacity(0.5f);
PlayInfoContainer.CircularBox.Colour = color.Lighten(1.25f).Opacity(0.75f);
PlayInfoContainer.TriangleContainer.TriangleColour= PlayInfoContainer.ProgressBar.Colour = color.Darken(1.25f).Opacity(0.75f);
}
catch (Exception e)
{
Console.WriteLine("Error " + e);
Background = Texture.WhitePixel;
}
}
}
private Box CreateBackgroundBox()
{
return new Box()
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Depth = -1,
Texture = Background,
RelativeSizeAxes = Axes.Both,
FillAspectRatio = ((float) Background.Width / Background.Height),
FillMode = FillMode.Fill
};
}
}
}
|
93ce28596b6d759edd159b890761528d7886ac65
|
[
"Markdown",
"C#"
] | 11 |
C#
|
storycraft/osu-player
|
fd0aa4cc1dbe529dfc9ff81fc30e3abffa7e8f46
|
c9a7bae4febfb6046c437dea68a2c6d265eb0108
|
refs/heads/master
|
<file_sep>#KOB
Dependencies :
* Request
* Template<file_sep><?php
if(!isset($_POST) || !isset($_POST['action']))
{
exit();
}
define('PLAYER_FILE', '../data/players.json');
define('RESULTS_FILE', '../data/results.json');
define('KOB_FILE', '../data/kob.json');
function generateKOBFile()
{
$players = json_decode(file_get_contents(PLAYER_FILE), true);
$results = json_decode(file_get_contents(RESULTS_FILE), true);
$kob_data = array();
foreach($players as $k=>$p)
{
$kob_data[] = array(
'id'=>$k,
'name'=>$p['name'],
'pts'=>0,
'played'=>0,
'win'=>0,
'lose'=>0,
'pp'=>0,
'pc'=>0,
'diff'=>0
);
}
for($i = 0, $max = count($results); $i<$max; $i++)
{
$r = $results[$i];
$team1 = $r['team1'];
$team2 = $r['team2'];
$score1 = $r['score1'];
$score2 = $r['score2'];
$win = array($score1>$score2, $score2>$score1);
$diff = array($score1-$score2, $score2-$score1);
foreach($team1 as $p)
{
if(!isset($kob_data[$p]))
continue;
$kob_data[$p]['pts'] += $score1;
$kob_data[$p]['played'] += 1;
$result = $win[0]?"win":"lose";
$kob_data[$p][$result] += 1;
$kob_data[$p]['pp'] += $score1;
$kob_data[$p]['pc'] += $score2;
$kob_data[$p]['diff'] += $diff[0];
}
foreach($team2 as $p)
{
if(!isset($kob_data[$p]))
continue;
$kob_data[$p]['pts'] += $score2;
$kob_data[$p]['played'] += 1;
$result = $win[1]?"win":"lose";
$kob_data[$p][$result] += 1;
$kob_data[$p]['pp'] += $score2;
$kob_data[$p]['pc'] += $score1;
$kob_data[$p]['diff'] += $diff[1];
}
}
file_put_contents(KOB_FILE, json_encode($kob_data));
}
class SimpleModel
{
protected $fileName;
protected $data;
public function __construct($pFileName)
{
$this->fileName = $pFileName;
if(!file_exists($this->fileName))
{
$this->data = array();
$this->save();
}
$this->data = json_decode(file_get_contents($this->fileName), true);
}
public function add($pData)
{
$this->data[] = $pData;
}
public function delete($pIndex)
{
if(!isset($this->data[$pIndex]))
return;
unset($this->data[$pIndex]);
}
public function save()
{
chmod($this->fileName, 0777);
file_put_contents($this->fileName, json_encode($this->data));
}
public function getData()
{
return $this->data;
}
}
class Players extends SimpleModel
{
public function __construct()
{
parent::__construct(PLAYER_FILE);
}
}
class Results extends SimpleModel
{
public function __construct()
{
parent::__construct(RESULTS_FILE);
}
public function deletePlayer($pIndex)
{
foreach($this->data as &$r)
{
foreach($r['team1'] as $o=>$id)
{
if($id == $pIndex)
{
unset($r['team1'][$o]);
}
}
foreach($r['team2'] as $o=>$id)
{
if($id == $pIndex)
{
unset($r['team2'][$o]);
}
}
}
}
}
switch($_POST['action'])
{
case "getResults":
$resultModel = new Results();
$playersModel = new Players();
$results = $resultModel->getData();
$players = $playersModel->getData();
$results = array_reverse($results);
$return = array();
foreach($results as &$r)
{
for($i = 1; $i<=2; $i++)
{
foreach($r['team'.$i] as $n=>$id)
{
if(isset($players[$id]))
{
$r['team'.$i][$n] = $players[$id];
}
}
}
$return[] = $r;
}
header('Content-Type:application/json');
echo json_encode($return);
exit();
break;
case "addPlayer":
$playersModel = new Players();
$name = $_POST['name'];
$playersModel->add(array('name'=>$name));
$playersModel->save();
generateKOBFile();
break;
case "addResults":
$resultModel = new Results();
$team1 = array($_POST['p1'], $_POST['p2']);
$team2 = array($_POST['p3'], $_POST['p4']);
$score1 = $_POST['score1'];
$score2 = $_POST['score2'];
$resultModel->add(array(
'team1'=>$team1,
'team2'=>$team2,
'score1'=>$score1,
'score2'=>$score2));
$resultModel->save();
generateKOBFile();
break;
case "deletePlayer":
$resultModel = new Results();
$resultModel->deletePlayer($_POST['player_id']);
$resultModel->save();
$playersModel = new Players();
$playersModel->delete($_POST['player_id']);
$playersModel->save();
generateKOBFile();
break;
case "deleteResult":
$resultModel = new Results();
$resultModel->delete($_POST['result_id']);
$resultModel->save();
generateKOBFile();
break;
default:
exit();
}
echo "ok";
exit();
|
12d8d432a335b449152e2672326a920fe63b3a2d
|
[
"Markdown",
"PHP"
] | 2 |
Markdown
|
arno06/KOB
|
0c855918f34aa39f29d10748ec2859ccde3b98fb
|
5b27d7c93c55ec34ba203c1466a8f6160ae07151
|
refs/heads/master
|
<file_sep>const express = require ("express")
const app = express()
const hbs = require("hbs")
app.use (express.static(__dirname + "/public"));
app.set("views", __dirname +"/views");
app.set("view engine", "hbs");
app.get("/", (request, response) => {
response.render("index", {
pageTitle:"Kanye Home"
});
});
app.get("/about", (request, response) => {
response.render("about", {
pageTitle: "About God"
});
});
app.listen(4000, () => {
console.log(`Example app listening at http://localhost:4000`)
})
|
f1f6f69e0c9d9b37253012993ad4cf85bb297e42
|
[
"JavaScript"
] | 1 |
JavaScript
|
lepfau/gitconflict
|
b6280e489732192517bdecfe4d427abbd19510ef
|
fb0190317d2c55d5d0e0dbdabae103edd7648b21
|
refs/heads/master
|
<repo_name>dotworks-pj/free_ad<file_sep>/app/controllers/mypage/user_profiles_controller.rb
# frozen_string_literal: true
module Mypage
class UserProfilesController < Mypage::BaseController
before_action :set_user_profile, only: %i[edit update]
def new
@user_profile = UserProfile.new
end
def edit; end
def create
@user_profile = current_user.build_profile(user_profile_params)
if @user_profile.save
redirect_to mypage_root_path, notice: '自社プロフィールを登録しました'
else
render :new
end
end
def update
if @user_profile.update(user_profile_params)
redirect_to mypage_root_path, notice: '自社プロフィールを更新しました'
else
render :edit
end
end
private
def set_user_profile
@user_profile = UserProfile.find(params[:id])
end
def user_profile_params
params.require(:user_profile).permit(:organization, :representative, :post_code, :description, :address, :phone)
end
end
end
<file_sep>/db/migrate/20191102131723_remove_user_id_from_spaces.rb
# frozen_string_literal: true
class RemoveUserIdFromSpaces < ActiveRecord::Migration[6.0]
def change
remove_reference :spaces, :user, null: false, foreign_key: true
end
end
<file_sep>/app/models/place_owner_profile.rb
# frozen_string_literal: true
class PlaceOwnerProfile < ApplicationRecord
belongs_to :place
validates :organization, presence: true
validates :representative, presence: true
validates :post_code, presence: true
validates :address, presence: true
validates :phone, presence: true
end
<file_sep>/db/migrate/20191020033853_rename_posts_to_spaces.rb
# frozen_string_literal: true
class RenamePostsToSpaces < ActiveRecord::Migration[6.0]
def change
rename_table :posts, :spaces
end
end
<file_sep>/app/models/user_profile.rb
# frozen_string_literal: true
class UserProfile < ApplicationRecord
belongs_to :user
validates :organization, presence: true
validates :representative, presence: true
validates :post_code, presence: true
validates :address, presence: true
validates :phone, presence: true
end
<file_sep>/app/uploaders/advertisement_original_image_uploader.rb
# frozen_string_literal: true
class AdvertisementOriginalImageUploader < BaseImageUploader
process resize_to_fit: [540, 360]
version :thumb do
process resize_to_fit: [210, 140]
end
def default_url
'sample.png'
end
end
<file_sep>/app/assets/javascripts/admin.js
//= require rails-ujs
//= require activestorage
// only for Admin features
//= require jquery/dist/jquery.min
//= require bootstrap/dist/js/bootstrap.min
//= require admin-lte/dist/js/adminlte.min
//= require admin-lte/plugins/iCheck/icheck
<file_sep>/app/controllers/places_controller.rb
# frozen_string_literal: true
class PlacesController < ApplicationController
before_action :set_place, only: [:show]
def show
@main_space = @place.spaces.first
@sub_spaces = @place.spaces.drop(1)
end
private
def set_place
@place = Place.find(params[:id])
end
end
<file_sep>/app/controllers/root_controller.rb
# frozen_string_literal: true
class RootController < BaseController
def index
@places = Place.limit(9)
end
end
<file_sep>/app/controllers/mypage/root_controller.rb
# frozen_string_literal: true
module Mypage
class RootController < Mypage::BaseController
def index; end
end
end
<file_sep>/app/controllers/admin/root_controller.rb
# frozen_string_literal: true
module Admin
class RootController < Admin::BaseController
def index; end
end
end
<file_sep>/spec/factories/advertisements.rb
# frozen_string_literal: true
FactoryBot.define do
factory :advertisement do
user { nil }
name { 'MyString' }
use_template { false }
advertisement_templates { nil }
title { 'MyString' }
url { 'MyText' }
qr_image { 'MyString' }
description { 'MyString' }
original_image { 'MyString' }
end
end
<file_sep>/app/models/advertisement.rb
# frozen_string_literal: true
class Advertisement < ApplicationRecord
mount_uploader :qr_image, PlaceMainImageUploader
mount_uploader :original_image, PlaceMainImageUploader
belongs_to :user
belongs_to :advertisement_template
end
<file_sep>/app/models/advertisement_template.rb
# frozen_string_literal: true
class AdvertisementTemplate < ApplicationRecord
has_many :advertisements
end
<file_sep>/app/controllers/mypage/spaces_controller.rb
# frozen_string_literal: true
module Mypage
class SpacesController < Mypage::BaseController
before_action :set_place, only: %i[index new edit create update]
before_action :set_space, only: %i[edit update]
def index
@spaces = @place.spaces
end
def new
@space = Space.new
@space.build_space_images
end
def edit; end
def create
@space = @place.spaces.build(space_params)
if @space.save
redirect_to mypage_place_spaces_path(@place, @space), notice: 'Space was successfully created.'
else
render :new
end
end
def update
if @space.update(space_params)
redirect_to mypage_place_spaces_path(@place, @space), notice: 'Space was successfully updated.'
else
render :edit
end
end
private
def set_place
@place = current_user.places.find(params[:place_id])
end
def set_space
@space = @place.spaces.find(params[:id])
end
def space_params
params.require(:space).permit(:name, :charge, :status, :description, space_images_attributes: %i[id image image_cache _destroy])
end
end
end
<file_sep>/app/models/place.rb
# frozen_string_literal: true
class Place < ApplicationRecord
mount_uploader :main_image, PlaceMainImageUploader
enum status: { closed: 0, published: 1 }
belongs_to :user
has_one :owner_profile, class_name: 'PlaceOwnerProfile'
has_many :spaces
accepts_nested_attributes_for :spaces, allow_destroy: true
validates :title, presence: true
validates :description, presence: true
validates :name, presence: true
validates :address, presence: true
validates :station, presence: true
validates :main_image, presence: true
def publish
update!(status: :published)
end
end
<file_sep>/app/models/space.rb
# frozen_string_literal: true
class Space < ApplicationRecord
belongs_to :place
has_many :space_images, dependent: :destroy
accepts_nested_attributes_for :space_images, allow_destroy: true
SPACE_IMAGE_LIMIT = 4
enum status: { closed: 0, published: 1 }
validates :name, presence: true
validates :charge,
presence: true,
numericality: {
only_integer: true,
greater_than_or_equal_to: 51
}
validates :status, presence: true
def build_space_images
(SPACE_IMAGE_LIMIT - space_images.count).times do
space_images.build
end
end
end
<file_sep>/db/fixtures/006_space_image.rb
# frozen_string_literal: true
raise StandardError, 'production環境では利用できません' if Rails.env.production?
# space_imageの作成
Space.find_each do |space|
space_images = (1..4).map do |index|
{
id: (space.id - 1) * 4 + index,
space: space,
image: File.open('./db/fixtures/images/sample.png')
}
end
SpaceImage.seed(
:id, space_images
)
end
<file_sep>/db/fixtures/005_space.rb
# frozen_string_literal: true
raise StandardError, 'production環境では利用できません' if Rails.env.production?
# spaceの作成
main_spaces = (1..10).map do |index|
{
id: index,
place: Place.find(index),
status: :published,
name: '4人がけのテーブルに面した壁',
description: "当店でもっとも空席率の低い、人気の席です。\nPCで作業されるお客様、長時間滞在されるお客様が多いです。",
charge: 100000
}
end
Space.seed(
:id, main_spaces
)
sub_spaces = (1..10).map do |index|
{
id: 10 + index,
place: Place.find(index),
status: :published,
name: '男子トイレのドアの内側',
description: "当店でもっとも空席率の低い、人気の席です。\nPCで作業されるお客様、長時間滞在されるお客様が多いです。",
charge: 50000
}
end
Space.seed(
:id, sub_spaces
)
sub_spaces2 = (1..10).map do |index|
{
id: 20 + index,
place: Place.find(index),
status: :published,
name: '男子トイレのドアの内側',
description: "当店でもっとも空席率の低い、人気の席です。\nPCで作業されるお客様、長時間滞在されるお客様が多いです。",
charge: 10000
}
end
Space.seed(
:id, sub_spaces2
)
<file_sep>/db/migrate/20191201081400_create_advertisements.rb
# frozen_string_literal: true
class CreateAdvertisements < ActiveRecord::Migration[6.0]
def change
create_table :advertisements do |t|
t.references :user, null: false, foreign_key: true
t.string :name, null: false
t.references :advertisement_template, null: false, foreign_key: true
t.string :title
t.text :url
t.string :qr_image
t.string :description
t.boolean :use_template, default: true, null: false
t.string :original_image
t.timestamps
end
end
end
<file_sep>/db/fixtures/002_user.rb
# frozen_string_literal: true
raise StandardError, 'production環境では利用できません' if Rails.env.production?
# userの作成
users = (1..3).map do |index|
{
id: index,
email: "<EMAIL>",
password: '<PASSWORD>',
password_confirmation: '<PASSWORD>',
confirmed_at: Time.current
}
end
User.seed(
:id, users
)
<file_sep>/README.md
# FreeAd(仮)
## Ruby version
2.6.3
## System dependencies
Rails 6.0.0
mysql 5.7系
## 事前準備
```sh
$ git clone https://github.com/dotworks-pj/free_ad
$ cd free_ad
```
## yarnのインストール
```sh
$ brew install yarn
```
## Rubyのインストール
インストール可能なRubyバージョンを確認
```sh
$ rbenv install --list
```
2.6.3を入れる
```sh
$ rbenv install 2.6.3
```
インストールされていることを確認
```sh
$ rbenv version
2.6.3
```
MySQLがインストールされていない場合はインストール
```sh
$ brew install mysql
$ xcode-select --install
```
Bundlerでgemをインストール
```sh
$ gem install bundler
$ bundle install --path vendor/bundle
```
パッケージをインストール
```
$ yarn install
```
MySQLが起動していなければ起動
```sh
mysql.server start
```
データベースの初期化
```sh
$ bundle exec rake db:create
$ bundle exec rake db:migrate
```
Puma起動
```sh
$ ./bin/rails s -p 3000
```
## アクセス
ブラウザで以下のURLにアクセスします
トップページ
>http://localhost:3000
管理画面
>http://localhost:3000/admin
letter_opener
>http://localhost:3000/letter_opener
```
<EMAIL>
```
passwordは `<PASSWORD>` でログイン可能
<file_sep>/db/fixtures/003_user_profile.rb
# frozen_string_literal: true
raise StandardError, 'production環境では利用できません' if Rails.env.production?
# user_profileの作成
user_profiles = (1..3).map do |index|
{
id: index,
user: User.find(index),
organization: '株式会社ヒルカワ産業',
representative: '田口純平',
post_code: '1234567',
address: '岐阜県中津川市蛭川',
phone: '0573-11-1111'
}
end
UserProfile.seed(
:id, user_profiles
)
<file_sep>/config/routes.rb
# frozen_string_literal: true
Rails.application.routes.draw do
root 'root#index'
namespace :admin do
root 'root#index'
end
resources :places, only: [:show]
namespace :mypage do
root 'root#index'
resources :user_profiles, only: %i[new edit create update]
resources :advertisements, except: [:destroy]
resources :places, except: [:destroy] do
resources :spaces, except: [:show]
resource :place_owner_profiles, path: :owner_profile, as: :owner_profile, only: %i[new edit create update]
member do
get :confirm, to: 'places#confirm'
patch :publish, to: 'places#publish'
end
end
end
devise_for :admin_users, path: :admin, controllers: {
sessions: 'admin/admin_users/sessions',
passwords: '<PASSWORD>'
}
devise_for :users, controllers: {
sessions: 'users/sessions',
passwords: '<PASSWORD>',
registrations: 'users/registrations',
confirmations: 'users/confirmations'
}
devise_scope :user do
patch 'users/confirmation', to: 'users/confirmations#confirm'
end
mount LetterOpenerWeb::Engine, at: '/letter_opener' if Rails.env.development?
end
<file_sep>/app/helpers/application_helper.rb
# frozen_string_literal: true
module ApplicationHelper
def alert_class_for(flash_type)
{
success: 'alert-success',
error: 'alert-danger',
alert: 'alert-warning',
notice: 'alert-info'
}[flash_type.to_sym] || flash_type.to_s
end
def is_active?(path)
request.path == path
end
def horizontal_form_for(*args, &block)
options = args.extract_options!
options.deep_merge! html: {},
wrapper: :horizontal_form,
wrapper_mappings: {
check_boxes: :horizontal_collection,
radio_buttons: :horizontal_collection,
file: :horizontal_file,
boolean: :horizontal_boolean
}
html_class = options[:html][:class] || ''
options[:html][:class] = [html_class, 'form-horizontal'].join(' ')
simple_form_for(*args, options, &block)
end
end
<file_sep>/db/fixtures/004_place.rb
# frozen_string_literal: true
raise StandardError, 'production環境では利用できません' if Rails.env.production?
# placeの作成
places = (1..10).map do |index|
{
id: index,
user: User.find(1),
status: :published,
title: '蛭川の人気カフェ!',
name: '喫茶ヒルカワ',
description: "恵那駅から車で20分、駅近のカフェの一部スペースをお貸しします。\n年配の人の割合が多いですが、夕方は下校中の小学生や中学生がよく来るため、終日にぎやかです。\n\n早朝から深夜まで営業していますので、ぜひご利用くださいませ!",
address: '岐阜県中津川市蛭川',
station: '恵那駅',
url: 'https://dotworkscorp.com/',
main_image: File.open('./db/fixtures/images/cafe_sample.jpg')
}
end
Place.seed(
:id, places
)
closed_places = (11..15).map do |index|
{
id: index,
user: User.find(1),
status: :closed,
title: '蛭川の人気カフェ!(非公開)',
name: '喫茶ヒルカワ',
description: "恵那駅から車で20分、駅近のカフェの一部スペースをお貸しします。\n年配の人の割合が多いですが、夕方は下校中の小学生や中学生がよく来るため、終日にぎやかです。\n\n早朝から深夜まで営業していますので、ぜひご利用くださいませ!",
address: '岐阜県中津川市蛭川',
station: '恵那駅',
url: 'https://dotworkscorp.com/',
main_image: File.open('./db/fixtures/images/cafe_sample.jpg')
}
end
Place.seed(
:id, closed_places
)
<file_sep>/db/migrate/20191123090921_change_column_to_allow_null.rb
# frozen_string_literal: true
class ChangeColumnToAllowNull < ActiveRecord::Migration[6.0]
def up
change_column :places, :title, :string, null: true
change_column :places, :description, :text, null: true
change_column :places, :name, :string, null: true
change_column :places, :address, :string, null: true
change_column :places, :station, :string, null: true
change_column :places, :main_image, :string, null: true
end
def down
change_column :places, :title, :string, null: false
change_column :places, :description, :text, null: false
change_column :places, :name, :string, null: false
change_column :places, :address, :string, null: false
change_column :places, :station, :string, null: false
change_column :places, :main_image, :string, null: false
end
end
<file_sep>/app/controllers/mypage/places_controller.rb
# frozen_string_literal: true
module Mypage
class PlacesController < Mypage::BaseController
before_action :set_place, only: %i[show edit update confirm publish]
def index
@places = current_user.places
end
def show
@places = current_user.places
@main_space = @place.spaces.first
@sub_spaces = @place.spaces.drop(1)
end
def new
@place = Place.new
end
def edit
@place.spaces.each(&:build_space_images)
end
def create
@place = current_user.places.build(place_params)
if @place.save
redirect_to mypage_place_spaces_path(@place), notice: 'プレイスを保存しました'
else
render :new
end
end
def update
if @place.update(place_params)
redirect_to mypage_place_spaces_path(@place), notice: 'プレイスを保存しました'
else
render :edit
end
end
def confirm
@main_space = @place.spaces.first
@sub_spaces = @place.spaces.drop(1)
end
def publish
if @place.publish
redirect_to mypage_place_path(@place), notice: 'プレイスを投稿しました'
else
render 'confirm'
end
end
private
def set_place
@place = current_user.places.find(params[:id])
end
def place_params
params.require(:place).permit(:title, :description, :name, :address, :station, :url, :main_image, :main_image_cache, spaces_attributes: [:id, :place_id, :name, :description, :charge, :_destroy, space_images_attributes: %i[id image image_cache _destroy]])
end
end
end
<file_sep>/app/models/user.rb
# frozen_string_literal: true
class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable, :confirmable
has_one :profile, class_name: 'UserProfile', dependent: :destroy
has_many :places, dependent: :destroy
has_many :advertisements, dependent: :destroy
def password_required?
super if confirmed?
end
end
<file_sep>/app/controllers/mypage/base_controller.rb
# frozen_string_literal: true
module Mypage
class BaseController < ApplicationController
before_action :authenticate_user!
layout 'mypage'
end
end
<file_sep>/app/models/space_image.rb
# frozen_string_literal: true
class SpaceImage < ApplicationRecord
mount_uploader :image, SpaceImageUploader
belongs_to :space
end
<file_sep>/config/initializers/carrierwave.rb
# frozen_string_literal: true
# config/initializers/carrierwave.rb
CarrierWave.configure do |config|
config.asset_host = Settings.asset_url
end
<file_sep>/db/migrate/20191124030936_add_status_to_places.rb
# frozen_string_literal: true
class AddStatusToPlaces < ActiveRecord::Migration[6.0]
def change
add_column :places, :status, :integer, default: 0, null: false, after: :user_id
end
end
<file_sep>/spec/factories/places.rb
# frozen_string_literal: true
FactoryBot.define do
factory :place do
user { nil }
title { 'MyString' }
description { 'MyText' }
name { 'MyString' }
address { 'MyString' }
station { 'MyString' }
url { 'MyText' }
maim_image { 'MyString' }
end
end
<file_sep>/app/controllers/mypage/place_owner_profiles_controller.rb
# frozen_string_literal: true
module Mypage
class PlaceOwnerProfilesController < Mypage::BaseController
before_action :set_place, only: %i[edit create update]
before_action :set_place_owner_profile, only: %i[edit update]
def new
@place_owner_profile = PlaceOwnerProfile.new
end
def edit; end
def create
@place_owner_profile = @place.build_owner_profile(place_owner_profile_params)
if @place_owner_profile.save
redirect_to confirm_mypage_place_path(@place), notice: '会社プロフィールを登録しました'
else
render :new
end
end
def update
if @place_owner_profile.update(place_owner_profile_params)
redirect_to confirm_mypage_place_path(@place), notice: '会社プロフィールを更新しました'
else
render :edit
end
end
private
def set_place
@place = current_user.places.find(params[:place_id])
end
def set_place_owner_profile
@place_owner_profile = @place.owner_profile
end
def place_owner_profile_params
params.require(:place_owner_profile).permit(:organization, :representative, :post_code, :description, :address, :phone)
end
end
end
<file_sep>/db/migrate/20191123055532_create_place_owner_profiles.rb
# frozen_string_literal: true
class CreatePlaceOwnerProfiles < ActiveRecord::Migration[6.0]
def change
create_table :place_owner_profiles do |t|
t.references :place, null: false, foreign_key: true
t.string :organization
t.string :representative
t.string :post_code
t.string :address
t.string :phone
t.timestamps
end
end
end
<file_sep>/spec/factories/place_owner_profiles.rb
# frozen_string_literal: true
FactoryBot.define do
factory :place_owner_profile do
place { nil }
organization { 'MyString' }
representative { 'MyString' }
post_code { 'MyString' }
address { 'MyString' }
phone { 'MyString' }
end
end
<file_sep>/db/migrate/20191027133234_create_places.rb
# frozen_string_literal: true
class CreatePlaces < ActiveRecord::Migration[6.0]
def change
create_table :places do |t|
t.references :user, null: false, foreign_key: true
t.string :title, null: false
t.text :description, null: false
t.string :name, null: false
t.string :address, null: false
t.string :station, null: false
t.text :url
t.string :main_image, null: false
t.timestamps
end
end
end
<file_sep>/db/migrate/20191102131932_add_place_id_to_spaces.rb
# frozen_string_literal: true
class AddPlaceIdToSpaces < ActiveRecord::Migration[6.0]
def up
add_reference :spaces, :place, foreign_key: true, after: :id
change_column :spaces, :place_id, :bigint, null: false
end
def down
remove_foreign_key :spaces, :places
remove_reference :spaces, :place
end
end
<file_sep>/db/fixtures/001_admin_user.rb
# frozen_string_literal: true
raise StandardError, 'production環境では利用できません' if Rails.env.production?
## admin_userの作成
AdminUser.seed(
:id,
id: 1,
email: '<EMAIL>',
password: '<PASSWORD>',
password_confirmation: '<PASSWORD>'
)
|
47ac06e778162776583a6505fd484b6839dc5706
|
[
"JavaScript",
"Ruby",
"Markdown"
] | 40 |
Ruby
|
dotworks-pj/free_ad
|
855743d7bc8fd1b6173043730d89750d7d3386b4
|
7a648a8d137387c8e8fb6f02d17a944921a200ef
|
refs/heads/master
|
<repo_name>toanhtran/msc_site<file_sep>/js/main.js
function main() {
! function() {
"use strict";
$("a.page-scroll").click(function() {
if (location.pathname.replace(/^\//, "") == this.pathname.replace(/^\//, "") && location.hostname == this.hostname) {
var a = $(this.hash);
if (a = a.length ? a : $("[name=" + this.hash.slice(1) + "]"), a.length) return $("html,body").animate({
scrollTop: a.offset().top - 40
}, 900), !1
}
}), $(window).bind("scroll", function() {
var a = $(window).height() - 100;
$(window).scrollTop() > a ? $(".navbar-default").addClass("on") : $(".navbar-default").removeClass("on")
}), $("body").scrollspy({
target: ".navbar-default",
offset: 80
}), $(document).ready(function() {
$("#team").owlCarousel({
navigation: !1,
slideSpeed: 300,
paginationSpeed: 400,
autoHeight: !0,
itemsCustom: [
[0, 1],
[450, 2],
[600, 2],
[700, 2],
[1e3, 4],
[1200, 4],
[1400, 4],
[1600, 4]
]
}), $("#clients").owlCarousel({
navigation: !1,
slideSpeed: 300,
paginationSpeed: 400,
autoHeight: !0,
itemsCustom: [
[0, 1],
[450, 2],
[600, 2],
[700, 2],
[1e3, 4],
[1200, 5],
[1400, 5],
[1600, 5]
]
}), $("#testimonial").owlCarousel({
navigation: !1,
slideSpeed: 300,
paginationSpeed: 400,
singleItem: !0
})
}), $(window).load(function() {
var a = $("#lightbox");
a.isotope({
filter: "*",
animationOptions: {
duration: 750,
easing: "linear",
queue: !1
}
}), $(".cat a").click(function() {
$(".cat .active").removeClass("active"), $(this).addClass("active");
var e = $(this).attr("data-filter");
return a.isotope({
filter: e,
animationOptions: {
duration: 750,
easing: "linear",
queue: !1
}
}), !1
})
})
}(), $("#tf-contact").submit(function(a) {
a.preventDefault();
var e = $("#c_name").val(),
t = $("#c_email").val(),
i = $("#c_message ").val(),
n = $("#tf-contact .ajax-response"),
o = {
name: e,
email: t,
message: i
};
return "" != e && "" != t && "" != i ? $.ajax({
type: "POST",
url: "php/contact.php",
data: o,
dataType: "json",
encode: !0,
success: function(a) {
var e = $.parseJSON(JSON.stringify(a));
n.html(e.message).fadeIn(500)
}
}) : (n.fadeIn(500), n.html('<i class="fa fa-warning"></i> Please fix the errors and try again.')), !1
})
}
main();
|
1ae4e70c1d6053ffad0bb28bd15a8f52fadd9043
|
[
"JavaScript"
] | 1 |
JavaScript
|
toanhtran/msc_site
|
4998c9c07fb85d995206e21148b6fe60597855f7
|
9832187909333dfb0b0dcbda89ee2027fd8a7edd
|
refs/heads/master
|
<file_sep><?php
namespace Kerbeh\OAuth2\Client\Provider;
use Kerbeh\OAuth2\Client\Provider\Exception\BrightspaceIdentityProviderException;
use League\OAuth2\Client\OptionProvider\HttpBasicAuthOptionProvider;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Tool\BearerAuthorizationTrait;
use Psr\Http\Message\ResponseInterface;
class Brightspace extends AbstractProvider
{
use BearerAuthorizationTrait;
const SCOPE_SEPARATOR = ' ';
const AUTH_URL = 'https://auth.brightspace.com/oauth2/auth';
const TOKEN_URL = 'https://auth.brightspace.com/core/connect/token';
protected $apiPath = '/d2l/api';
/**
* Domain
*
* @var string
*/
protected $domain;
/**
* The version number of the api
*
* @var array
*/
protected $apiVersion;
/**
* Constructor that takes the options and configurations
* required by the Oauth Client
*
* @param array $options Array of oauth client options i.e api version
* @param array $collaborators Array of oauth Collaborators
*/
public function __construct(array $options = [], array $collaborators = [])
{
$collaborators['optionProvider'] = new HttpBasicAuthOptionProvider();
$this->assertRequiredOptions($options);
$possible = $this->getConfigurableOptions();
$configured = array_intersect_key($options, array_flip($possible));
foreach ($configured as $key => $value) {
$this->$key = $value;
}
// Remove all options that are only used locally
$options = array_diff_key($options, $configured);
//Set the apiVersions array
if (empty($options['apiVersion'])) {
$options['apiVersion'] = $this->apiVersion;
}
parent::__construct($options, $collaborators);
}
/**
* Get api domain
*
* @return String
*/
public function getDomain()
{
return $this->domain;
}
/**
* Get the path to the api
*
* @return void
*/
public function getApiPath()
{
return $this->apiPath;
}
/**
* Returns all options that can be configured.
*
* @return array
*/
protected function getConfigurableOptions()
{
return array_merge(
$this->getRequiredOptions(),
[
'apiVersion',
]
);
}
/**
* Get authorization url to begin OAuth flow
*
* @return string
*/
public function getBaseAuthorizationUrl()
{
return $this::AUTH_URL;
}
/**
* Get access token url to retrieve token
*
* @return string
*/
public function getBaseAccessTokenUrl(array $params)
{
return $this::TOKEN_URL;
}
/**
* Returns all options that are required.
*
* @return array
*/
protected function getRequiredOptions()
{
return [
'domain',
'apiVersion',
];
}
/**
* Verifies that all required options have been passed.
*
* @param array $options Array of provided options
*
* @throws Exception
* @return void
*/
protected function assertRequiredOptions(array $options)
{
$missing = array_diff_key(array_flip($this->getRequiredOptions()), $options);
if (!empty($missing)) {
throw new \Exception(
'Required options not defined: ' . implode(', ', array_keys($missing))
);
}
}
/**
* Get the default scopes used by this provider.
*
* This should not be a complete list of all scopes, but the minimum
* required for the provider user interface!
*
* @return array
*/
protected function getDefaultScopes()
{
return ['core:*:*'];
}
/**
* Get the fqd for the who am i API call.
*
* @param AccessToken $token
*
* @return String
*/
public function getResourceOwnerDetailsUrl(AccessToken $token)
{
return 'https://' . $this->domain . $this->apiPath . '/lp/' . $this->apiVersion["lp_version"] . '/users/whoami';
}
/**
* Generate a user object from a successful user details request.
*
* @param array $response Array Brightsapce of who am i data
*
* @see https://docs.valence.desire2learn.com/res/user.html#User.WhoAmIUser
*
* @return \League\OAuth2\Client\Provider\ResourceOwnerInterface
*/
public function createResourceOwner(array $response, AccessToken $token)
{
$user = new BrightspaceResourceOwner($response);
return $user;
}
/**
* Throws an exception for brightspace client or oauth exceptions
*
* @param ResponseInterface $response HTTP response from the auth request
* @param array $data The reponse body
* with Brightspace error information
*
* @link https://docs.valence.desire2learn.com/basic/apicall.html?highlight=error#disposition-and-error-handling
* interpret the disposition of api errors
*
* @throws BrightspaceIdentityProviderException
*
* @return void;
*/
protected function checkResponse(ResponseInterface $response, $data)
{
if ($response->getStatusCode() >= 400) {
throw BrightspaceIdentityProviderException::clientException(
$response,
$data
);
} elseif (isset($data['error'])) {
throw BrightspaceIdentityProviderException::oauthException(
$response,
$data
);
}
}
}
<file_sep><?php
namespace Kerbeh\OAuth2\Client\Provider;
use function Kerbeh\OAuth2\Client\Provider\BrightspaceResourceOwner\getId as getIdentifier;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
class BrightspaceResourceOwner implements ResourceOwnerInterface
{
/**
* Raw response from the Api
* @var type
*/
protected $response;
/**
* Brightspace genereated UUID for the user
* Depending on calling users permisions this could potentially be null
* @see https://docs.valence.desire2learn.com/res/user.html?highlight=user#attributes
* @var Int
*/
protected $identifier;
/**
* A non empty string of the Users first name
* @see https://docs.valence.desire2learn.com/res/user.html?highlight=user#attributes
* @var String
*/
protected $firstName;
/**
* A non empty string of the Users last name
* @var String
* @see https://docs.valence.desire2learn.com/res/user.html?highlight=user#attributes
*/
protected $lastName;
/**
* Unique string identifier of the user
* @var String
*/
protected $uniqueName;
/**
* Opaque Identifier for a users profile
* @see https://docs.valence.desire2learn.com/res/user.html?highlight=user#id3
* @var String
*/
protected $profileIdentifier;
/**
* Creates a new resource owner
* @param array $response
*/
public function __construct(array $response = [])
{
$this->response = $response;
$this->identifier = (!empty($response["Identifier"])) ? $response["Identifier"] : null;
$this->firstName = (!empty($response["FirstName"])) ? $response["FirstName"] : null;
$this->lastName = (!empty($response["LastName"])) ? $response["LastName"] : null;
$this->uniqueName = (!empty($response["UniqueName"])) ? $response["UniqueName"] : null;
$this->profileIdentifier = (!empty($response["ProfileIdentifier"])) ? $response["ProfileIdentifier"] : null;
}
/**
* Gets the D2L UUID of the user
* Also aliased as getIdentifier
* @return Int
*/
public function getId()
{
return $this->identifier;
}
/**
* Gets the First Name of the user
* @return String
*/
function getFirstName()
{
return $this->firstName;
}
/**
* Gets the Last Name of the user
* @return String
*/
function getLastName()
{
return $this->lastName;
}
/**
* Gets the Unique Name aka Username of the User
* @return String
*/
function getUniqueName()
{
return $this->uniqueName;
}
/**
* Gets the profile id of the user
* @return String
*/
function getProfileIdentifier()
{
return $this->profileIdentifier;
}
/**
* @inheritdoc
*/
public function toArray()
{
return $this->response;
}
}
<file_sep># Changelog
All Notable changes to `oauth2-brightspace` will be documented in this file
|
51d85a20f8f0a440399c55671df6a88a20d02a14
|
[
"Markdown",
"PHP"
] | 3 |
PHP
|
kerbeh/oauth2-brightspace
|
3e8bef403bedc2b1c011c154c2e53aaa693e5d8a
|
6bd6076ebf8028d429908ebc10b60d4c0326bc61
|
refs/heads/master
|
<repo_name>gegyhamdani/gammusms<file_sep>/autoreply.php
<?php
mysql_connect("localhost","root","");
mysql_select_db("gammu");
$query = "SELECT * FROM inbox WHERE Processed = 'false'";
$hasil = mysql_query($query);
while($data= mysql_fetch_array($hasil)){
$id = $data['ID'];
$noPengirim = $data['SenderNumber'];
$msg = strtoupper($data['TextDecoded']);
$pecah = explode("#",$msg);
$d_tgl=$pecah[1];
$d_nama=$pecah[2];
$d_jk=$pecah[3];
$d_alamat=$pecah[4];
if($pecah[0]=="REG")
{
if($pecah[1] !="" and $pecah[2] !="" and $pecah[3] !="")
{
$today = date("Ymd");
$tgl=date("d M Y");
$newDate = date("Y-m-d", strtotime($d_tgl));
$isinyo="Nomor ".$noPengirim." Nama ".$d_nama." JenisKel ".$d_jk." Alamat ".$d_alamat;
$query=mysql_query("INSERT INTO outbox (DestinationNumber,
TextDecoded) VALUES ('".$noPengirim."', '".$isinyo."')");
}else{
$query=mysql_query("INSERT INTO outbox (DestinationNumber,
TextDecoded, CreatorID) VALUES ('".$noPengirim."', 'Gagal Registrasi. Format : REG#Tanggal#Nama#PRIA/WANITA#Alamat')");
}
}else{
$query=mysql_query("INSERT INTO outbox (DestinationNumber,
TextDecoded) VALUES ('".$noPengirim."', 'Gagal Registrasi. Format : REG#Tanggal#Nama#PRIA/WANITA#Alamat')");
}
$query3 = "UPDATE inbox SET Processed = 'true' WHERE ID = '$id'";
mysql_query($query3);
}
?>
|
1398158f962d83b66d6b9ef6e95ff4cdfd6966bf
|
[
"PHP"
] | 1 |
PHP
|
gegyhamdani/gammusms
|
a628c614bb9dd1f0cd114ec754491d0ef6d8a598
|
a1c383a7d74a2d1ee983d2389273f656e8281376
|
refs/heads/master
|
<file_sep><?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class SecurityController extends Controller
{
public function index(){
return view('security.index');
}
}
<file_sep><?php
namespace App\Http\Controllers;
use App\Address;
use App\Customer;
use Illuminate\Http\Request;
use App\User;
use App\Role;
class CustomerController extends Controller
{
public function index(){
$users = User::all();
return view('Users.indexCustomers')->with('users', $users);
}
public function create(){
return view('Users.registerCustomer');
}
protected function validator(array $data)
{
return Validator::make($data, [
'Name' => 'required|string|max:255',
'LastName' => 'required|string|max:255',
'email' => 'required|string|email|max:255|unique:users',
'username' => 'required|string|max:100|unique:users',
'password' => '<PASSWORD>',
'Phone' => 'required|numeric',
'Status' => 'required|numeric',
'Street' => 'required|string',
'Number' => 'required|numeric',
'City' => 'required|string',
]);
}
public function store(Request $request){
$user = new User;
$user->Name = $request->input('Name');
$user->LastName = $request->input('LastName');
$user->Phone = $request->input('Phone');
$user->email = $request->input('email');
$user->username = $request->input('username');
$user->password = <PASSWORD>($request->input('<PASSWORD>'));
$user->Status = $request->input('Status');
$user->Enterprise_id = $request->input('Enterprise_id');
$user->save();
$user
->roles()
->attach(Role::where('rol', 'Customer')->first());
$address = new Address;
$address->Street = $request->input('Street');
$address->Number = $request->input('Number');
$address->State = $request->input('State');
$address->City = $request->input('City');
$address->Town = $request->input('Town');
$address->ZipCode = $request->input('ZipCode');
$address->Status = $request->input('Status');
$address->Country = $request->input('Country');
$address->User_id = $user->id;
$address->save();
$users = User::all();
return view('Users.indexCustomers')->with('users', $users);
}
}
<file_sep><?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class InternalAddress extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('internaladdress', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->integer('EnterpriseId')->unsigned();
//$table->foreign('EnterpriseId')->references('id')->on('Enterprises')->nullable();
$table->string('Street', 150);
$table->integer('Number');
$table->string('Town', 150);
$table->string('City', 150);
$table->string('Country', 150);
$table->integer('ZipCode');
$table->smallInteger('Status');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('internaladdress');
}
}
<file_sep><?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class Users extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('Name', 200);
$table->string('LastName', 200);
$table->string('email')->unique();
$table->bigInteger('Phone');
$table->string('username', 100)->unique();
$table->string('password', 250);
$table->Integer('Enterprise_id')->unsinged();
$table->smallinteger('Status');
/*$table->unsignedInteger('roles_id');
$table->foreign('roles_id')->references('id')->on('roles');*/
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}
<file_sep><?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Maintenance extends Model
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'VehicleId', 'Responsible', 'EstimatedTime', 'DateStartMaintenance', 'DateFinishMaintenance', 'Comments', 'Amount', 'Status', 'Cause',
];
}
<file_sep><?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Billing extends Model
{
use Notifiable;
protected $fillable = [
'JourneyId', 'MaintenanceId', 'Item', 'Bill', 'Responsible', 'Status', 'Details',
];
}
<file_sep><?php
namespace App\Http\Controllers;
use App\GPS;
use Session;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Redirect;
class GpsController extends Controller
{
public function index(){
$gps = GPS::all();
return view('gps.index')->with('gps', $gps);
}
protected function validator(array $data)
{
return Validator::make($data, [
'IpAddress' => 'required|string|max:255',
'Status' => 'required|numeric',
]);
}
public function store(Request $request)
{
$gps = new GPS;
$gps->IpAddress = $request->input('IpAddress');
$gps->Status = $request->input('Status');
$gps->save();
return redirect()->route('gps.index');
}
public function edit($id){
$gps = GPS::find($id);
return view('gps.edit')->with('gps', $gps);
}
public function update($id)
{
// validate
// read more on validation at http://laravel.com/docs/validation
$rules = array(
'IpAddress' => 'required',
'status' => 'required|numeric'
);
$validator = Validator::make(Input::all(), $rules);
// process the login
if ($validator->fails()) {
return Redirect::to('gps/' . $id . '/edit')
->withErrors($validator)
->withInput(Input::except('password'));
} else {
// store
$gps = GPS::find($id);
$gps->IpAddress = Input::get('IpAddress');
$gps->Status = Input::get('status');
$gps->save();
// redirect
Session::flash('message', 'GPS Editado Correctamente!');
return Redirect::to('/gps');
}
}
public function destroy($id)
{
$gps = GPS::whereId($id)->firstOrFail();
$gps->delete();
return redirect('gps');
}
}
<file_sep><?php
namespace App\Http\Controllers;
use App\Route;
use Illuminate\Http\Request;
use App\User;
use App\Role;
class EmployersController extends Controller
{
public function index(){
$user = User::all();
return view('Users.index')->with('user', $user);
}
public function create(){
return view('Users.register');
}
protected function validator(array $data)
{
return Validator::make($data, [
'Name' => 'required|string|max:255',
'LastName' => 'required|string|max:255',
'email' => 'required|string|email|max:255|unique:users',
'username' => 'required|string|max:100',
'password' => '<PASSWORD>',
'Phone' => 'required|numeric',
'Status' => 'required|numeric',
]);
}
public function store(Request $request)
{
$user = new User;
$user->Name = $request->input('Name');
$user->LastName = $request->input('LastName');
$user->Phone = $request->input('Phone');
$user->email = $request->input('email');
$user->username = $request->input('username');
$user->password = <PASSWORD>($request->input('<PASSWORD>'));
$user->Status = $request->input('Status');
$user->Enterprise_id = $request->input('Enterprise_id');
$user->save();
//$rol = $request->input('Rol');
$user
->roles()
->attach(Role::where('rol', $request->input('Rol'))->first());
$users = User::all();
return view('Users.index')->with('user', $users);
}
public function edit($id){
$user = User::find($id);
return view('Users.edit')->with('user', $user);
}
}
<file_sep><?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function () {
return view('welcome');
});
Route::get('features', function (){
return view('feature');
});
Route::get('prices', function (){
return view('prices');
});
Route::get('/test', 'HomeController@getUsers');
Auth::routes();
/*
Route::get('/login', function (){
return view('welcome')->with('registro', 0);
});*/
Route::get('/home', 'HomeController@index')->name('home');
Route::resource('/account', 'AccountController')->middleware('auth');
Route::resource('/arrivals', 'ArrivalsController')->middleware('auth');
Route::resource('/billing', 'BillingController')->middleware('auth');
Route::resource('/departures', 'DeparturesController')->middleware('auth');
Route::resource('/gps', 'GpsController')->middleware('auth');
Route::resource('/maintenance', 'MaintenanceController')->middleware('auth');
Route::resource('/security', 'SecurityController')->middleware('auth');
Route::resource('/settings', 'SettingsController')->middleware('auth');
Route::resource('/manager', 'ManagerController')->middleware('auth');
Route::resource('/users', 'UsersController');
Route::resource('/drivers', 'DriverController')->middleware('auth');
Route::resource('/admin', 'AdminController')->middleware('auth');
Route::resource('/customer', 'CustomerController')->middleware('auth');
Route::resource('/office', 'OfficeController')->middleware('auth');
Route::resource('/enterprise', 'EnterpriseController')->middleware('auth');
Route::resource('/vehicle', 'VehicleController')->middleware('auth');
Route::resource('/employers', 'EmployersController')->middleware('auth');
<file_sep><?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class Role extends Controller
{
public function index(){
$role = Role::all();
return view('Users.index')->with('role', $role);
}
public function create(){
return view('Role.register');
}
protected function validator(array $data)
{
return Validator::make($data, [
]);
}
public function store(Request $request)
{
}
public function edit($id)
{
}
}
<file_sep><?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Characteristic extends Model
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'VehicleId', 'Brand', 'Model', 'Color', 'N_Axis', 'Type', 'FuelCapacity', 'WeightCapacity', 'FuelType', 'FuelPerformance',
];
}
<file_sep><?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class Address extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('address', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('Street', 150);
$table->integer('Number');
$table->string('Town', 150);
$table->string('City', 150);
$table->string('State', 150);
$table->string('Country', 150);
$table->integer('ZipCode');
$table->smallInteger('Status');
$table->integer('User_id')->unsigned();
$table->timestamps();
});
}
/**
* mysqldump -u sammy -p transport users > users.sql
*
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('customeraddress');
}
}
<file_sep><?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Route extends Model
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'EstimatedFuel', 'Distance', 'EstimatedTime', 'TollBooths', 'foods', 'JourneyId',
];
}
<file_sep><?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class Characteristics extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('characteristics', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->integer('Vehicleid');
$table->String('brand', 100);
$table->String('Model', 100);
$table->String('Color', 100);
$table->integer('N_Axis');
$table->smallInteger('Type');
$table->float('FuelCapacity');
$table->float('WeightCapacity');
$table->smallInteger('FuelTypr');
$table->float('FuelPerformance');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('characteristics');
}
}
<file_sep><?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ArrivalsController extends Controller
{
public function index(){
return view('arrivals.index');
}
}
<file_sep><?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class CustomerAddress extends Model
{
protected $table = 'customeraddress';
protected $fillable = [
'CustomerId', 'Street', 'Number', 'Town', 'City', 'Country', 'ZipCode', 'Status'
];
}
|
12dac9e682d9cb8feecd57b694a96419e1ee7815
|
[
"PHP"
] | 16 |
PHP
|
emirluna/transport
|
4afb45bef6e8387a6345bbf0418d9faf4ac2a8e6
|
97325b6417920e7b5b327add6c95f565a4db53af
|
refs/heads/master
|
<repo_name>munday/CC-d-Youtube<file_sep>/src/ws/munday/youtubecaptionrate/MainActivity.java
/*
* Copyright (C) 2011 <NAME>
*
* This program is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program;
* if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package ws.munday.youtubecaptionrate;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.SAXException;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.RatingBar;
import android.widget.RatingBar.OnRatingBarChangeListener;
public class MainActivity extends ListActivity {
VideoAdapter adapter = null;
ProgressDialog d = null;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button b = (Button) findViewById(R.id.search_btn);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
d=new ProgressDialog(MainActivity.this);
d.setMessage(getString(R.string.searching));
d.setIndeterminate(true);
d.show();
EditText query = (EditText) findViewById(R.id.query_text);
String q = query.getText().toString();
String args[] = {q};
new SearchTask().execute(args);
}
});
ListView l = getListView();
l.setOnItemClickListener(itemClick);
}
private final OnItemClickListener itemClick = new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> a, View v, int position,
long id) {
YoutubeSearchResult r = (YoutubeSearchResult) adapter.getItem(position);
GetActionsDialog(r.feedId).show();
}
};
private Dialog GetActionsDialog(String vid){
final String vidId = vid;
return new AlertDialog.Builder(this).setTitle("Video Actions")
.setItems(R.array.video_actions, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
final int w = which;
runOnUiThread(new Runnable() {
public void run() {
doAction(w, vidId);
}
});
dialog.dismiss();
}
})
.create();
}
public void doAction(int which, final String vidId){
switch(which){
case 0:
YoutubeSearchResult r = (YoutubeSearchResult) adapter.getItem(vidId);
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(r.videoLink)));
break;
case 1:
getRatingDialog(vidId).show();
break;
case 2:
YoutubeSearchResult rs = (YoutubeSearchResult) adapter.getItem(vidId);
final Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, "Check out this captioned video on Youtube!");
intent.putExtra(Intent.EXTRA_TEXT, rs.title + " - " + rs.videoLink);
startActivity(Intent.createChooser(intent, getString(R.string.share)));
break;
}
}
public Dialog getRatingDialog(String vid){
final String vidId = vid;
Context mContext = MainActivity.this;
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.rating_dialog, (ViewGroup) findViewById(R.id.layout_root));
RatingBar rb = (RatingBar)layout.findViewById(R.id.rating_bar);
rb.setOnRatingBarChangeListener(new OnRatingChanger(vidId));
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
builder.setView(layout).setTitle(R.string.rate_captions_title).setPositiveButton("Done", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
return builder.create();
}
public class OnRatingChanger implements OnRatingBarChangeListener{
private final String vidId;
public OnRatingChanger(String VidId){
vidId = VidId;
}
public Object getFromWeb(String address) throws MalformedURLException,IOException {
URL url = new URL(address);
Object content = url.getContent();
return content;
}
@Override
public void onRatingChanged(RatingBar ratingBar, final float rating,
boolean fromUser) {
YoutubeSearchResult r = (YoutubeSearchResult) adapter.getItem(vidId);
r.rating = rating;
adapter.notifyDataSetChanged();
new Thread(){
public void run(){
try {
getFromWeb("http://data.munday.ws/lastcall_db/add/?vidId=" + vidId + "&r=" + rating);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}.start();
}
}
class SearchTask extends UserTask<String,Void,ArrayList<YoutubeSearchResult>> {
@Override
public ArrayList<YoutubeSearchResult> doInBackground(
String... params) {
YoutubeSearchXMLHandler h = new YoutubeSearchXMLHandler();
h.URL = "http://gdata.youtube.com/feeds/api/videos?q=" + Uri.encode(params[0]) + "&caption&v=2&fields=entry[link/@rel='http://gdata.youtube.com/schemas/2007%23mobile']";
ArrayList<YoutubeSearchResult> results = null;
try {
results = h.parse();
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return results;
}
public void onPostExecute(ArrayList<YoutubeSearchResult> results){
if(results!=null){
adapter = new VideoAdapter(results, getApplicationContext());
getListView().setAdapter(adapter);
}
d.dismiss();
}
}
}<file_sep>/src/ws/munday/youtubecaptionrate/RatingLookupXMLHandler.java
/*
* Copyright (C) 2011 <NAME>
*
* This program is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program;
* if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package ws.munday.youtubecaptionrate;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.SAXException;
public class RatingLookupXMLHandler extends DefaultHandler {
public String URL;
RatingLookupItem itm;
StringBuilder _sb = new StringBuilder();
public RatingLookupItem parse() throws ParserConfigurationException, SAXException, IOException {
InputStream urlInputStream = null;
SAXParserFactory spf = null;
SAXParser sp = null;
URL url = new URL(this.URL);
urlInputStream = url.openConnection().getInputStream();
spf = SAXParserFactory.newInstance();
if (spf != null) {
sp = spf.newSAXParser();
sp.parse(urlInputStream, this);
}
if (urlInputStream != null) urlInputStream.close();
return itm;
}
@Override
public void startDocument() throws SAXException {
itm = new RatingLookupItem();
}
@Override
public void endDocument() throws SAXException {
//
}
@Override
public void endElement(String namespaceURI, String localName, String qName)
throws SAXException {
if (localName.equals("rating")) {
this.itm.rating=Float.valueOf(_sb.toString());
}else if(localName.equals("vidId")){
this.itm.vidId = _sb.toString();
}
this._sb.setLength(0);
}
@Override
public void characters(char ch[], int start, int length) {
_sb.append(ch,start,length);
}
}
<file_sep>/src/ws/munday/youtubecaptionrate/YoutubeSearchResult.java
/*
* Copyright (C) 2011 <NAME>
*
* This program is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program;
* if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package ws.munday.youtubecaptionrate;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.SAXException;
public class YoutubeSearchResult {
long id;
String videoLink = "";
String feedId = "";
String author = "";
String title = "";
String desc = "";
String thumb = "";
float rating = 0;
public void setId(String id){
feedId = id;
rating = getRating(id);
}
private float getRating(String id){
RatingLookupItem r = null;
String URL = "http://data.munday.ws/lastcall_db/search/?vidId=" + id;
RatingLookupXMLHandler lookup = new RatingLookupXMLHandler();
lookup.URL = URL;
try {
r = lookup.parse();
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return r.rating;
}
}
<file_sep>/src/ws/munday/youtubecaptionrate/VideoAdapter.java
package ws.munday.youtubecaptionrate;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RatingBar;
import android.widget.TextView;
public class VideoAdapter extends BaseAdapter{
private ArrayList<YoutubeSearchResult> vids;
private final LayoutInflater inflater;
private final Context context;
public VideoAdapter(ArrayList<YoutubeSearchResult> vids, Context c) {
this.context = c;
this.inflater = LayoutInflater.from(this.context);
this.vids = vids;
}
public ArrayList<YoutubeSearchResult> getVids() {
if(vids!=null)
return vids;
else
return null;
}
public void SetVids(ArrayList<YoutubeSearchResult> v) {
vids = v;
}
@Override
public int getCount() {
if(vids!=null)
return vids.size();
else
return 0;
}
@Override
public Object getItem(int position) {
if(vids!=null){
if(vids.size()>position)
return vids.get(position);
}
return null;
}
public Object getItem(String vidId) {
if(vids!=null){
for(YoutubeSearchResult r: vids){
if(r.feedId.equals(vidId)){
return r;
}
}
}
return null;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
YoutubeSearchResult v = null;
synchronized (vids) {
if(vids.size()>position)
v = vids.get(position);
else
return null;
// When convertView is not null, we can reuse it directly, there is no
// need
// to reinflate it. We only inflate a new View when the convertView
// supplied
// by ListView is null.
if (convertView == null) {
convertView = inflater.inflate(R.layout.video_item, null);
// Creates a ViewHolder and store references to the two children
// views
// we want to bind data to.
holder = new ViewHolder();
holder.videoName = (TextView) convertView.findViewById(R.id.vid_title);
holder.videoDesc = (TextView) convertView.findViewById(R.id.vid_desc);
holder.thumb = (ImageView) convertView.findViewById(R.id.vid_thumb);
holder.rating = (RatingBar) convertView.findViewById(R.id.ratingbar);
convertView.setTag(holder);
} else {
// Get the ViewHolder back to get fast access to the TextView
// and the ImageView.
holder = (ViewHolder) convertView.getTag();
}
// Bind the data efficiently with the holder.
holder.videoName.setText(v.title);
holder.videoDesc.setText(v.author);
Drawable img = getWebImageDrawable(v.thumb);
if(img!=null){
holder.thumb.setImageDrawable(img);
}
holder.rating.setRating(v.rating);
return convertView;
}
}
private Drawable getWebImageDrawable(String url) {
try {
InputStream is = (InputStream) this.getFromWeb(url);
Drawable d = Drawable.createFromStream(is, "src");
return d;
} catch (MalformedURLException e) {
e.printStackTrace();
return null;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
public Object getFromWeb(String address) throws MalformedURLException,IOException {
URL url = new URL(address);
Object content = url.getContent();
return content;
}
final class ViewHolder {
ImageView thumb;
TextView videoName;
TextView videoDesc;
RatingBar rating;
}
/*
public class OnRatingChanger implements OnRatingBarChangeListener{
private final String vidId;
public OnRatingChanger(String VidId){
vidId = VidId;
}
@Override
public void onRatingChanged(RatingBar ratingBar, final float rating,
boolean fromUser) {
new Thread(){
public void run(){
try {
getFromWeb("http://data.munday.ws/lastcall_db/add/?vidId=" + vidId + "&r=" + rating);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}.start();
}
}
*/
@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return 0;
}
}
<file_sep>/src/ws/munday/youtubecaptionrate/YoutubeSearchXMLHandler.java
/*
* Copyright (C) 2011 <NAME>
*
* This program is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program;
* if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package ws.munday.youtubecaptionrate;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.ArrayList;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
import android.util.Log;
import ws.munday.youtubecaptionrate.WebRequest;
public class YoutubeSearchXMLHandler extends DefaultHandler {
public String URL;
ArrayList<YoutubeSearchResult> results;
YoutubeSearchResult itm;
StringBuilder _sb = new StringBuilder();
boolean _is_item = false;
boolean _is_author = false;
int _itm_limit = 1000;
public ArrayList<YoutubeSearchResult> parse() throws ParserConfigurationException, SAXException, IOException {
SAXParserFactory spf = null;
SAXParser sp = null;
spf = SAXParserFactory.newInstance();
String ret = new WebRequest().Get(this.URL);
ByteArrayInputStream bs = new ByteArrayInputStream(ret.getBytes());
if (spf != null) {
sp = spf.newSAXParser();
sp.parse(bs, this);
}
return results;
}
@Override
public void startDocument() throws SAXException {
results = new ArrayList<YoutubeSearchResult>();
itm = new YoutubeSearchResult();
}
@Override
public void endDocument() throws SAXException {
//
}
@Override
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
Log.d("ytc",localName);
if (localName.toLowerCase().equals("entry")){
_is_item = true;
}
if(localName.equals("author")){
_is_author = true;
}
if(localName.toLowerCase().equals("thumbnail")){
if(atts.getValue("width").equals("120")){
itm.thumb = atts.getValue("url");
}
}
if(localName.toLowerCase().equals("player")){
itm.videoLink = atts.getValue("url");
}
}
@Override
public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
if(results.size() < _itm_limit){
if (localName.toLowerCase().equals("entry")) {
results.add(itm);
itm = new YoutubeSearchResult();
_is_item =false;
}else if (localName.toLowerCase().equals("author")) {
_is_author = false;
}else if(_is_author && localName.toLowerCase().equals("name")){
itm.author = _sb.toString();
}else if( _is_item && localName.toLowerCase().equals("description")){
itm.desc = _sb.toString().trim();
}else if(_is_item && localName.toLowerCase().equals("videoid")){
itm.setId(_sb.toString().trim());
}else if(_is_item && localName.toLowerCase().equals("title")){
itm.title = _sb.toString().trim();
}
}
this._sb.setLength(0);
}
@Override
public void characters(char ch[], int start, int length) {
if(results.size() < _itm_limit){
_sb.append(ch,start,length);
}
}
}
|
47f61c56ff7226c1bcde3cf4f8c80e41799cfe81
|
[
"Java"
] | 5 |
Java
|
munday/CC-d-Youtube
|
183a6a589e0f7c9202283cb911eeef872dc18385
|
81553791addd3ace7dc694254fff841e0ca743f1
|
refs/heads/main
|
<repo_name>squalasteam/Kavalasan<file_sep>/JS/registration.js
var globalcount = 1067;
function login(){
var n1 =1;
globalcount += n1;
let name =document.getElementById("name").value
let age =document.getElementById("age").value
let gender =document.getElementById("gender").value
let profession =document.getElementById("profession").value
if( gender ==="male"){
sex ="male";
}else if ( gender === "female"){
sex="female";
} else {
sex="others"
}
if(name && age && gender && profession !=="" ){
data="visible";
color="#ffbc00";
invalid="Enter Your datailes";
}
else{
data="hidden";
invalid="please Enter Your datailes";
color="red";
}
document.getElementById("erorr").style.background= color;
document.getElementById("erorr").innerHTML= invalid;
document.getElementById("data").style.visibility= data;
document.getElementById("id").innerHTML= globalcount;
document.getElementById("op_name").innerHTML= name;
document.getElementById("op_age").innerHTML= age;
document.getElementById("op_gender").innerHTML= sex;
document.getElementById("op_profession").innerHTML= profession;
}
function onlyNumberKey(evt) {
// Only ASCII character in that range allowed
var ASCIICode = (evt.which) ? evt.which : evt.keyCode
if (ASCIICode > 31 && (ASCIICode < 48 || ASCIICode > 57))
return false;
return true;
}
|
a3c0c02bf451bafe80b6caed1f2cc6bfc4f10c75
|
[
"JavaScript"
] | 1 |
JavaScript
|
squalasteam/Kavalasan
|
82771311127bd5b1b4a9371e157bfdae4222ff48
|
5be47538200aea86c03c687ac704a012ec375bcb
|
refs/heads/main
|
<repo_name>MehdiSaraie/CN-CA3<file_sep>/makefile
all: main.out client.out router.out
CXXFLAGS = -std=c++11
main.out: main.cpp functions.cpp functions.h
g++ $(CXXFLAGS) main.cpp functions.cpp -o main.out
client.out: client.cpp functions.cpp functions.h
g++ $(CXXFLAGS) client.cpp functions.cpp -o client.out
router.out: router.cpp functions.cpp functions.h
g++ $(CXXFLAGS) router.cpp functions.cpp -o router.out
.PHONY: clean
clean:
rm *.out
rm -r pipes
<file_sep>/client.cpp
#include "functions.h"
int main(int argc, char* argv[]){
string name = argv[0], router_ip = argv[1], router_port = argv[2];
int main_pipe_r = atoi(argv[3]);
char buffer[LENGTH];
vector<string> group_names;
int from_router_fd = 0, to_router_fd = 0;
int max_fd, activity;
fd_set readfds;
make_pipe(router_ip, router_port, 2, to_router_fd, from_router_fd);
while(true){
FD_ZERO(&readfds);
FD_SET(main_pipe_r, &readfds);
max_fd = main_pipe_r;
if (from_router_fd > 0)
FD_SET(from_router_fd, &readfds);
if (from_router_fd > max_fd)
max_fd = from_router_fd;
activity = select(max_fd + 1, &readfds, NULL, NULL, NULL);
if ((activity < 0) && (errno!=EINTR)){
cerr << ("select error\n");
}
if (FD_ISSET(main_pipe_r, &readfds)){ //msg from main
memset(&buffer, 0, LENGTH);
read(main_pipe_r, buffer, LENGTH);
vector<string> tokens = input_tokenizer(buffer);
if (tokens[0] == "Join"){
string ip = tokens[1], group_name = tokens[2];
group_names.push_back(group_name);
string msg = "graft " + group_name;
write(to_router_fd, &msg[0], strlen(&msg[0]));
}
else if (tokens[0] == "Leave"){
string ip = tokens[1], group_name = tokens[2];
for (int i = 0; i < group_names.size(); i++){
if (group_names[i] == group_name){
for (int j = i+1; j < group_names.size(); j++)
group_names[j-1] = group_names[j];
group_names.pop_back();
break;
}
}
}
else if (tokens[0] == "Select"){ //replace oldest group by new group
string ip = tokens[1], group_name = tokens[2];
if (group_names.size() == 0)
group_names.push_back(group_name);
else{
int i = 1;
for (i = 1; i < group_names.size(); i++)
group_names[i-1] = group_names[i];
group_names[i-1] = group_name;
}
string msg = "graft " + group_name;
write(to_router_fd, &msg[0], strlen(&msg[0]));
}
else if (tokens[0] == "Show" && tokens[1] == "group"){
string ip = tokens[2];
for (int i = 0; i < group_names.size(); i++)
cout << group_names[i] << " ";
cout << endl;
}
else if (tokens[0] == "Send" && tokens[1] == "message"){
string ip = tokens[2], message_body = tokens[3], group_name = tokens[4];
string msg = "datagram " + group_name + " " + message_body;
write(to_router_fd, &msg[0], strlen(&msg[0]));
}
else if (tokens[0] == "Send" && tokens[1] == "file"){
string ip = tokens[2], file_name = tokens[3], group_name = tokens[4];
vector<string> chunks = read_file_chunk(file_name);
for(int h=0; h<chunks.size(); h++){
string msg = "datagram "+ group_name + " " + chunks[h];
write(to_router_fd, &msg[0], strlen(&msg[0]));
}
}
}
if (FD_ISSET(from_router_fd, &readfds)){ //msg from router
memset(&buffer, 0, LENGTH);
read(from_router_fd, buffer, LENGTH);
vector<string> tokens = input_tokenizer(buffer);
if (tokens[0] == "datagram"){
string group_name = tokens[1];
bool found = false;
for (int i = 0; i < group_names.size(); i++){
if (group_names[i] == group_name){
found = true;
break;
}
}
if (found)
cout << name << " received message of group " << group_name << ":\n" << buffer << endl;
//WriteInFile(name, buffer);
else{
cout << name << " pruned message of group " << group_name << endl;
string msg = "prune " + group_name;
write(to_router_fd, &msg[0], strlen(&msg[0]));
}
}
}
}
return 0;
}
<file_sep>/main.cpp
#include "functions.h"
struct Device
{
string ip; //unique for specifiying source
int main_pipe_w; //to send msg from main to proc
string name = ""; //unique & used for clients before setting IP
};
int main(){
mkdir("pipes", 0777);
vector<Device> devices;
while(true){
string input_str;
getline(cin,input_str);
char* input = &input_str[0];
vector<string> tokens = input_tokenizer(input);
if (tokens.size() == 0)
continue;
//////////////client
if (tokens[0] == "Client"){
string name = tokens[1], router_ip = tokens[2], router_port = tokens[3];
struct Device new_client;
new_client.name = name;
int main_pipe[2];
pipe(main_pipe);
new_client.main_pipe_w = main_pipe[1];
devices.push_back(new_client);
int n1 = fork();
if (n1 == 0){ //child
execlp("./client.out", &name[0], &router_ip[0], &router_port[0], &(to_string(main_pipe[0]))[0], NULL);
exit(0);
}
int i;
for (i=0; i<devices.size(); i++){
if (devices[i].ip == router_ip)
break;
}
string msg = "Connect Router " + router_ip + " " + router_port;
write(devices[i].main_pipe_w, &msg[0], strlen(&msg[0]));
}
else if (tokens[0] == "Set" && tokens[1] == "IP"){
string name = tokens[2], ip = tokens[3];
int i;
for(i=0; i<devices.size(); i++){
if(devices[i].name == name){
devices[i].ip = ip;
break;
}
}
write(devices[i].main_pipe_w, input, strlen(input));
}
else if ((tokens[0] == "Join" || tokens[0] == "Leave" || tokens[0] == "Select") && tokens[3] == "CN"){
string ip = tokens[1], group_name = tokens[2];
int i;
for (i=0; i<devices.size(); i++){
if (devices[i].ip == ip)
break;
}
write(devices[i].main_pipe_w, input, strlen(input));
}
else if (tokens[0] == "Send" && tokens[1] == "file"){
string ip = tokens[2], file_name = tokens[3], group_name = tokens[4];
int i;
for (i=0; i<devices.size(); i++){
if (devices[i].ip == ip)
break;
}
write(devices[i].main_pipe_w, input, strlen(input));
}
else if (tokens[0] == "Send" && tokens[1] == "message"){
string ip = tokens[2], message_body = tokens[3], group_name = tokens[4];
int i;
for (i=0; i<devices.size(); i++){
if (devices[i].ip == ip)
break;
}
write(devices[i].main_pipe_w, input, strlen(input));
}
else if (tokens[0] == "Show" && tokens[1] == "group"){
string ip = tokens[2];
int i;
for (i=0; i<devices.size(); i++){
if (devices[i].ip == ip)
break;
}
write(devices[i].main_pipe_w, input, strlen(input));
}
////////////////router
else if (tokens[0] == "Router"){
string router_ip = tokens[1];
struct Device new_router;
new_router.ip = router_ip;
int main_pipe[2];
pipe(main_pipe);
new_router.main_pipe_w = main_pipe[1];
devices.push_back(new_router);
int n1 = fork();
if (n1 == 0){ //child
execlp("./router.out", &router_ip[0], &(to_string(main_pipe[0]))[0], NULL);
exit(0);
}
}
else if (tokens[0] == "Connect"){
string router1_ip = tokens[1], router2_ip = tokens[2], router1_port = tokens[3], router2_port = tokens[4];
int i;
for (i=0; i<devices.size(); i++){
if (devices[i].ip == router1_ip)
write(devices[i].main_pipe_w, input, strlen(input));
if (devices[i].ip == router2_ip)
write(devices[i].main_pipe_w, input, strlen(input));
}
}
else if (tokens[0] == "Disconnect"){
string router_ip = tokens[1], router_port = tokens[2];
int i;
for (i=0; i<devices.size(); i++){
if (devices[i].ip == router_ip)
break;
}
write(devices[i].main_pipe_w, input, strlen(input));
}
else if (tokens[0] == "Show"){
string ip = tokens[1];
int i;
for (i=0; i<devices.size(); i++){
if (devices[i].ip == ip)
break;
}
write(devices[i].main_pipe_w, input, strlen(input));
}
}
return 0;
}
<file_sep>/functions.h
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <fstream>
#include <vector>
#include <string>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <bits/stdc++.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
#include <map>
using namespace std;
#define LENGTH 1024
vector<string> input_tokenizer(char* input);
void make_pipe(string router_ip, string router_port, int flag, int& in_fd, int& out_fd);
void add_connection(int connection[][4], int& connection_size, int port_number, int read_fd, int write_fd);
void WriteInFile(string name, string input);
vector<string> read_file_chunk(string file_name);
<file_sep>/router.cpp
#include "functions.h"
int main(int argc, char* argv[]){
string router_ip = argv[0];
int main_pipe_r = atoi(argv[1]);
//int lookup[LENGTH][2];//dest system + port
//int lookup_size = 0;
int connection[LENGTH][4];//port + read_fd + write_fd (for all connected switches or systems) + cost
int connection_size = 0;
int i, j, k, fd, max_fd, activity;
fd_set readfds;
char buffer[LENGTH];
vector<vector<string>> learning(LENGTH);
map<string, int> sourceAddr; //group_name + write_fd
map<string, int>::iterator itr;
while(true){
FD_ZERO(&readfds);
FD_SET(main_pipe_r, &readfds);
max_fd = main_pipe_r;
for (i = 0; i < connection_size; i++){
fd = connection[i][1];
if (fd > 0)
FD_SET(fd, &readfds);
if (fd > max_fd)
max_fd = fd;
}
activity = select(max_fd + 1, &readfds, NULL, NULL, NULL);
if ((activity < 0) && (errno!=EINTR)){
cerr << ("select error\n");
}
if (FD_ISSET(main_pipe_r, &readfds)){ //msg from main
memset(&buffer, 0, LENGTH);
read(main_pipe_r, buffer, LENGTH);
vector<string> tokens = input_tokenizer(buffer);
if(tokens[0] == "Connect" && tokens[1] == "Router"){
string router_ip = tokens[2], router_port = tokens[3];
int in_fd, out_fd;
make_pipe(router_ip, router_port, 1, in_fd, out_fd);
add_connection(connection, connection_size, stoi(router_port), in_fd, out_fd);
}
else if (tokens[0] == "Connect"){
string router1_ip = tokens[1], router2_ip = tokens[2], router1_port = tokens[3], router2_port = tokens[4];
if (router_ip == router1_ip){
int in_fd, out_fd;
make_pipe(router1_ip, router1_port, 1, in_fd, out_fd);
add_connection(connection, connection_size, stoi(router1_port), in_fd, out_fd);
}
else if (router_ip == router2_ip){
int in_fd, out_fd;
make_pipe(router1_ip, router1_port, 2, in_fd, out_fd);
add_connection(connection, connection_size, stoi(router2_port), out_fd, in_fd);
}
}
else if (tokens[0] == "Disconnect"){
string router_ip = tokens[1], router_port = tokens[2];
for (i = 0; i < connection_size; i++){
if (connection[i][0] == stoi(router_port)){
string msg = "Disconnect";
write(connection[i][2], &msg[0], strlen(&msg[0]));
close(connection[i][1]);
close(connection[i][2]);
for (j = i+1; j < connection_size; j++){
for (int k = 0; k < 4; k++)
connection[j-1][k] = connection[j][k];
}
connection_size--;
break;
}
}
}
else if (tokens[0] == "Show"){
string ip = tokens[1];
for (i = 0; i < learning.size(); i++){
if (learning[i].size() > 0)
cout << "port " << i << " : ";
for (j = 0; j < learning[i].size(); j++){
cout << learning[i][j] << " ";
}
if (learning[i].size() > 0)
cout << endl;
}
}
}
for (i = 0; i < connection_size; i++){ //msg from a device
int src_fd = connection[i][1];
int src_port = connection[i][0];
if (FD_ISSET(src_fd, &readfds)){
memset(&buffer, 0, LENGTH);
read(src_fd, buffer, LENGTH);
cout << router_ip << " :: " << buffer << endl;
vector<string> tokens = input_tokenizer(buffer);
if (tokens[0] == "Disconnect"){
close(connection[i][1]);
close(connection[i][2]);
for (j = i+1; j < connection_size; j++){
for (k = 0; k < 4; k++)
connection[j-1][k] = connection[j][k];
}
connection_size--;
}
else if (tokens[0] == "datagram"){
string group_name = tokens[1];
itr = sourceAddr.find(group_name);
if (itr != sourceAddr.end()){
itr->second = connection[i][2];
for(j = 0; j < connection_size; j++){
if (connection[j][1] == src_fd)
continue;
int port_num = connection[j][0];
for(k = 0; k < learning[port_num].size(); k++){
if(learning[port_num][k] == group_name){
int dest_fd = connection[j][2];
write(dest_fd, buffer, strlen(buffer));
}
}
}
}
else{ //first message of a group received by rooter
sourceAddr.insert(pair<string, int>(group_name, connection[i][2]));
for (j = 0; j < connection_size; j++){ //broadcast
learning[connection[j][0]].push_back(group_name);
if (connection[j][1] != src_fd){
int dest_fd = connection[j][2];
write(dest_fd, buffer, strlen(buffer));
}
}
}
}
else if (tokens[0] == "prune"){
string group_name = tokens[1];
for (auto p = learning[src_port].begin(); p != learning[src_port].end(); ++p){ //find & erase group_name from port
if (*p == group_name) {
learning[src_port].erase(p);
p--;
break;
}
}
bool found = false;
itr = sourceAddr.find(group_name);
for(j = 0; j < connection_size; j++){ //check if anybody needs message of group
if (connection[j][2] == itr->second)
continue;
int port_num = connection[j][0];
for(k = 0; k < learning[port_num].size(); k++){
if(learning[port_num][k] == group_name){
found = true;
break;
}
}
}
if (!found) //send prune message upward
write(itr->second, buffer, strlen(buffer));
}
else if (tokens[0] == "graft"){
string group_name = tokens[1];
itr = sourceAddr.find(group_name);
if (itr != sourceAddr.end()){ //multicast tree has been created
bool found = false;
for (j = 0; j < learning[src_port].size(); j++){
if (learning[src_port][j] == group_name){
found = true;
break;
}
}
if (!found){
learning[src_port].push_back(group_name);
}
write(itr->second, buffer, strlen(buffer));
}
}
}
}
}
return 0;
}
<file_sep>/functions.cpp
#include "functions.h"
vector<string> input_tokenizer(char* input){
istringstream line(input);
string token;
vector<string> tokens;
while(line >> token)
tokens.push_back(token);
return tokens;
}
void make_pipe(string router_ip, string router_port, int flag, int& in_fd, int& out_fd){
const char* myfifo1 = &("pipes/" + router_ip + "-" + router_port + "-in")[0];
mkfifo(myfifo1, 0666);
if (flag == 1)
in_fd = open(myfifo1, O_RDONLY);
else if (flag == 2)
in_fd = open(myfifo1, O_WRONLY);
const char* myfifo2 = &("pipes/" + router_ip + "-" + router_port + "-out")[0];
mkfifo(myfifo2, 0666);
if (flag == 1)
out_fd = open(myfifo2, O_WRONLY);
else if (flag == 2)
out_fd = open(myfifo2, O_RDONLY);
}
void add_connection(int connection[][4], int& connection_size, int port_number, int read_fd, int write_fd){
connection[connection_size][0] = port_number;
connection[connection_size][1] = read_fd;
connection[connection_size][2] = write_fd;
connection[connection_size][3] = 1;
connection_size++;
}
void WriteInFile(string name, string input){
string filename = "files/#"+ name;
ofstream outfile;
outfile.open(filename, ios::app);
outfile << input << endl;
outfile.close();
}
vector<string> read_file_chunk(string file_name){
const int BUFFER_SIZE = 512;
vector<char> buffer (BUFFER_SIZE + 1, 0);
ifstream ifile(file_name, std::ifstream::binary);
vector<string> chunks;
if (ifile.fail()){
cout << "No such file.\n";
return chunks;
}
while(1)
{
ifile.read(buffer.data(), BUFFER_SIZE);
streamsize s = ((ifile) ? BUFFER_SIZE : ifile.gcount());
buffer[s] = 0;
chunks.push_back(buffer.data());
if(!ifile) break;
}
ifile.close();
return chunks;
}
|
0efc41cf095904e37d19a27012123a5c69531029
|
[
"Makefile",
"C++"
] | 6 |
Makefile
|
MehdiSaraie/CN-CA3
|
2067ed5df52340edc6e823069817d230ceb23457
|
56d68b58c4fa97a11890fec53f1ba3c164d7edec
|
refs/heads/master
|
<file_sep>import React from 'react'
import Layout from '../components/Layout/'
import Seo from '../components/seo'
import SocialLinks from '../components/SocialLinks'
import { MainContent } from '../styles/base'
const AboutPage = () => (
<Layout>
<Seo
title="Sobre mim"
description="Saiba um pouco mais sobre mim."
/>
<MainContent>
<h1>Sobre mim</h1>
<p>
Oi! Espero que esteja tudo bem com você também! Meu nome é <NAME>, tenho 25 anos e sou de João Pessoa, na Paraíba.
Atualmente trabalho como Engenheiro DevOps na <a href="https://www.livelo.com.br/" target="_blank" rel="noopener noreferrer"> Livelo </a> e tenho um Bacharelado em Ciências da Computação pelo Centro Universitário de João Pessoa.
Eu sempre fui apaixonado por tecnologia e, durante minha formação, descobri que gostava da área de Infraestrutura e Redes.
Isso me motivou a me aprofundar em Administração de Sistemas.
</p>
<p>
Durante o meu estágio e primeiro emprego, atuei como Analista de Suporte e SysAdmin de níveis 1 e 2.
A maioria dos servidores com os quais trabalhei era Linux, especificamente CentOS.
Por isso, estou sempre buscando aprender sobre novas tecnologias e serviços.
</p>
<p>
Além de ter experiência em administração de servidores, tenho me especializado em Cloud,
aprendendo sobre os principais provedores de nuvem, como AWS, Azure e Oracle Cloud.
Sou certificado em todas as certificações de nível associate da AWS e possuo a certificação Azure Fundamentals.
Sempre tive o desejo de iniciar um blog para compartilhar minha jornada no mercado de trabalho e documentar
meus estudos para poder consultá-los facilmente no futuro.
</p>
<p>
Para o ano de 2023, meu objetivo é me aprofundar em algumas tecnologias e metodologias DevOps,
como Kubernetes, Terraform e Python. Além disso, pretendo finalizar meus estudos para obter a
certificação Solutions Architect Professional da Amazon. Eu planejo compartilhar em meu blog o
que já aprendi até agora, bem como meus novos estudos e metas.
</p>
<h2>Habilidades</h2>
<ul>
<li>Linux</li>
<li>Nginx/Apache</li>
<li>cPanel/Plesk</li>
<li>Kubernetes</li>
<li>Bash</li>
<li>Docker</li>
<li>Terraform</li>
<li>AWS</li>
<li>O que ainda não sei busco aprender.</li>
</ul>
<h2>Contato</h2>
<p>
Você pode entrar em contato comigo através de qualquer uma das minhas
redes sociais.
</p>
<SocialLinks/>
</MainContent>
</Layout>
)
export default AboutPage
<file_sep>---
image: /assets/img/bash.png
title: Análise de performance com PIDSTAT
description: >-
O pidstat é uma ferramenta de monitoramento, que torna possível acompanhar
cada processo individualmente no Linux.
date: '2020-06-07'
category: linux
background: '#EE0000'
tags:
- Bash
categories:
- Linux
---
Pidstat quer dizer PID Statistics, a ferramenta fornece várias informações, o que inclui o uso da CPU, memória e até o uso do disco e estatísticas de uso das threads associadas as tarefas executadas por cada processo.
Para poder executar este comando, você precisa instalar o pacote de ferramentas sysstat. Segue abaixo o processo de instalação:
```bash
#CentOS/Fedora
yum install sysstat
#Ubuntu/Debian
sudo apt-get install sysstat
```
Para obter as estatísticas referentes a todos os processos use a opção`-p ALL`(note as maiúsculas), tal como você pode observar no exemplo abaixo:
```bash
thiago@DESKTOP-PUAQN5J:~$ pidstat -p ALL
Linux 3.13.0-39-generic (case-530U3C-530U4C-532U3C) 25-11-2014 _x86_64_ (4 CPU)
16:06:47 UID PID %usr %system %guest %CPU CPU Command
16:06:47 0 1 0,00 0,00 0,00 0,01 3 init
16:06:47 0 2 0,00 0,00 0,00 0,00 0 kthreadd
16:06:47 0 3 0,00 0,00 0,00 0,00 0 ksoftirqd/0
16:06:47 0 5 0,00 0,00 0,00 0,00 0 kworker/0:0H
16:06:47 0 7 0,00 0,03 0,00 0,03 3 rcu_sched
...
16:06:47 0 29597 0,00 0,00 0,00 0,00 3 kworker/3:1H
16:06:47 0 29599 0,00 0,00 0,00 0,00 3 irq/43-mei_me
16:06:47 0 31144 0,00 0,00 0,00 0,00 2 kworker/u16:1
16:06:47 0 31290 0,00 0,00 0,00 0,00 2 kworker/u17:1
16:06:47 0 31448 0,00 0,00 0,00 0,00 2 kworker/2:0
```
Acima, você pode observar as informações de uso da CPU para todos os processos em execução.\
Se quiser, pode ver os valores referentes a um processo (PID) em particular:
```bash
thiago@DESKTOP-PUAQN5J:~$ pidstat -p 29597
Linux 3.13.0-39-generic (case-530U3C-530U4C-532U3C) 25-11-2014 _x86_64_ (4 CPU)
16:19:48 UID PID %usr %system %guest %CPU CPU Command
16:19:48 0 29597 0,00 0,00 0,00 0,00 3 kworker/3:1H
```
## Como listar estatísticas de performance baseado no nome do processo
Para resolver este problema, use a opção do comando`-C`. Para exibir as informações pros processos que cujos nomes contenham a palavra Apache ficará da seguinte forma:
```bash
thiago@DESKTOP-PUAQN5J:~$ pidstat -C apache
Linux 3.13.0-39-generic (case-530U3C-530U4C-532U3C) 25-11-2014 _x86_64_ (4 CPU)
17:10:42 UID PID %usr %system %guest %CPU CPU Command
17:10:42 0 1342 0,00 0,00 0,00 0,00 2 apache2
```
Para repetir um comando, dentro de um intervalo, acrescente um número correspondente às vezes em segundos.\
Vamos configurar a sua saída para 5 segundos acrescentando o valor 5, ele passará a repetir o comando a cada 5 segundo:
```bash
thiago@DESKTOP-PUAQN5J:~$ pidstat -C apache 5
17:10:44 UID PID %usr %system %guest %CPU CPU Command
17:10:44 0 1342 0,00 0,00 0,00 0,00 2 apache2
17:10:49 UID PID %usr %system %guest %CPU CPU Command
17:10:49 0 1342 0,00 1,00 0,00 1,00 2 apache2
```
## Como exibir estatísticas de Entrada/Saída de processos
Para exibir o relatório estatístico de Entrada/Saída de um determinado processo, a cada 1 segundo, use a opção `-d`, da seguinte forma:
```bash
thiago@DESKTOP-PUAQN5J:~$ pidstat -p 10993 -d 1
Linux 3.13.0-39-generic (case-530U3C-530U4C-532U3C) 25-11-2014 _x86_64_(4 CPU)
19:41:19 UID PID kB_rd/s kB_wr/s kB_ccwr/s Command
19:41:20 1000 10993 0,00 96,00 0,00 firefox
19:41:21 1000 10993 0,00 0,00 0,00 firefox
19:41:22 1000 10993 0,00 128,00 0,00 firefox
19:41:23 1000 10993 0,00 256,00 0,00 firefox
19:41:24 1000 10993 0,00 160,00 0,00 firefox
19:41:25 1000 10993 0,00 160,00 0,00 firefox
19:41:26 1000 10993 0,00 160,00 0,00 firefox
19:41:27 1000 10993 0,00 128,00 0,00 firefox
^C
Média: 1000 10993 0,00 136,00 0,00 firefox
```
Acima é possível verificar as taxas de leitura e gravação no disco em Kb/s.
## Como mostrar utilização de memória por processos específicos
Aqui, entra em uso a opção -r, conforme o exemplo abaixo, para exibir utilização da memória, referentes a uma determinada tarefa (PID):
```bash
thiago@DESKTOP-PUAQN5J:~$ pidstat -p 10993 -r 1
Linux 3.13.0-39-generic (case-530U3C-530U4C-532U3C) 25-11-2014 _x86_64_(4 CPU)
19:58:46 UID PID minflt/s majflt/s VSZ RSS %MEM Command
19:58:47 1000 10993 22,00 0,00 1602560 432344 11,55 firefox
19:58:48 1000 10993 36,00 0,00 1602560 432592 11,56 firefox
19:58:49 1000 10993 27,00 0,00 1594364 432728 11,56 firefox
19:58:50 1000 10993 20,00 0,00 1594364 432992 11,57 firefox
19:58:51 1000 10993 27,00 0,00 1594364 432992 11,57 firefox
^C
Média: 1000 10993 26,40 0,00 1597642 432730 11,56 firefox
```
## Como exibir comandos em execução e seus argumentos
Com a utilização do `-d` teremos acesso a informação completa do comando em execução pelo processo em questão, observe:
```bash
thiago@DESKTOP-PUAQN5J:~$ pidstat -C chrome -l
Linux 3.13.0-40-generic (case-530U3C-530U4C-532U3C) 26-11-2014 _x86_64_ (4 CPU)
15:28:17 UID PID %usr %system %guest %CPU CPU Command
15:28:17 1000 10651 0,02 0,01 0,00 0,03 2 /opt/google/chrome/chrome --incognito
15:28:17 1000 10662 0,00 0,00 0,00 0,00 0 /opt/google/chrome/chrome --type=zygote --enable-crash-reporter=BFA8A187-CB5C-B8FF-FDD3-F84DA1B302F1
15:28:17 1000 10691 0,00 0,00 0,00 0,00 2 /opt/google/chrome/chrome --type=gpu-process --channel=10651.0.2015679771 --enable-crash-reporter=BFA8A187-CB5C-B8FF-FDD3-F84DA
15:28:17 1000 10710 0,00 0,00 0,00 0,00 1 /opt/google/chrome/chrome --type=renderer --disable-databases --enable-deferred-image-decoding --lang=pt-BR --force-fieldtrials
15:28:17 1000 10717 0,00 0,00 0,00 0,00 3 /opt/google/chrome/chrome --type=renderer --enable-deferred-image-decoding --lang=pt-BR --force-fieldtrials=AutoReloadExperimen
```
O pacote Sysstat possui outras funcionalidades, como o comando `sar`. Ele é usado para coletar, relatar e salvar CPU, memória e uso de E / S no Unix, como o sistema operacional. O comando `sar` produz os relatórios rapidamente e também pode salvar os relatórios nos arquivos de log.
Por hoje é só, em breve traremos um novo artigo sobre o `sar` e como utilizá-lo para ter acesso a esses relatórios.
<file_sep>---
image: /assets/img/AWS.png
title: Criação de EC2 utilizando Cloudformation
description: O AWS CloudFormation é um serviço de infraestrutura como código
(IaC) que permite modelar, provisionar e gerenciar recursos da AWS.
date: 2022-04-19
category: aws
background: "#FF9900"
tags:
- aws
- iac
- cloudformation
categories:
- aws
- iac
- cloudformation
---
Apesar de hoje possuímos diversas ferramentas disponíveis para utilização de infraestrutura como código, como o Terraform, a AWS também possui a sua ferramenta nativa para atingir tais objetivos.
Tecnicamente CloudFormation é a forma oficial de definir infraestrutura como código na nuvem da AWS, portanto, é uma peça fundamental para possibilitar processos de entrega contínua e DevOps.
Diferente do Terraform, com o CloudFormation temos duas formas de realizar a declaração de infraestrutura, podemos utilizar tanto o Json como o Yaml, fica a critério de cada um porém acredito que o Yaml fica melhor para visualização e compreensão das definições.
## AS SEÇÕES DO TEMPLATE
A estrutura completa de um template pode se tornar complexa, mas as mais importantes só as seções:
* `AWSTemplateFormatVersion`: Declara a versão do template.
* `Description`: Breve descrição do template, que pode ajudar a compreender quando existe uma grande quantidade de stacks.
* `Resources`: Onde todos os recursos que devem ser provisionados são declarados
* `Outputs`: Permite a visualização rápida de atributos de recursos criados utilizando a linha de comando e o console da aws. Quando é utilizado o parâmetro export ainda permite que outros stacks façam referência a esses atributos, permitindo um compartilhar informações entre diferentes stacks.
## PRIMEIRO TEMPLATE
Sabendo das necessidades que um template do CloudFormation tem, criaremos um template que irá criar uma EC2, um Security Group e atachar um Elastic IP.
Sabendo que os recursos são declarados dentro da sessão Resources, vamos então iniciar pela definição da nossa EC2. Precisamos declarar algumas informações como ImageId, InstanceType, SecurityGroups e para isso vamos adicionar dentro da sessão resources a seguinte definição:
```yaml
MyInstance:
Type: AWS::EC2::Instance
Properties:
AvailabilityZone: us-east-1a
ImageId: ami-03ededff12e34e59e
InstanceType: t2.micro
KeyName: Thiago
SecurityGroups:
- !Ref SSHSecurityGroup
Tags:
- Key: Environment
Value: Test
- Key: Name
Value: CloudFormation-Ec2
```
Com a nossa instância declarada, vamos então atribuir um Elastic IP, assim mantemos um IP público fixo para a nossa EC2, para isso basta adicionar o seguinte bloco:
```yaml
MyEIP:
Type: AWS::EC2::EIP
Properties:
InstanceId: !Ref MyInstance
```
Dessa forma, falta apenas que criarmos um Security Group liberando a comunicação para SSH, iremos liberar para toda a internet, mas apenas por que isso e um lab, em ambiente real, filtre quem pode acessar suas instâncias.
```yaml
SSHSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Enable SSH access via port 22
SecurityGroupIngress:
- CidrIp: 0.0.0.0/0
FromPort: 22
IpProtocol: tcp
ToPort: 22
```
Bom, dessa forma devemos ter um template semelhante ao abaixo:
```yaml
---
Resources:
MyInstance:
Type: AWS::EC2::Instance
Properties:
AvailabilityZone: us-east-1a
ImageId: ami-03ededff12e34e59e
InstanceType: t2.micro
KeyName: Thiago
SecurityGroups:
- !Ref SSHSecurityGroup
Tags:
- Key: Environment
Value: Test
- Key: Name
Value: CloudFormation-Ec2
# an elastic IP for our instance
MyEIP:
Type: AWS::EC2::EIP
Properties:
InstanceId: !Ref MyInstance
# our EC2 security group
SSHSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Enable SSH access via port 22
SecurityGroupIngress:
- CidrIp: 0.0.0.0/0
FromPort: 22
IpProtocol: tcp
ToPort: 22
```
## CRIAR UMA STACK
Basta buscar na barra de pesquisa do console pelo serviço CloudFormation, caso não tenha nenhuma stack, será retornado uma tela semelhante a abaixo, clique em `Create Stack`:

Basta clicar na opção `Template Ready` e em seguida `Upload a template file`, la você deve enviar o arquivo yaml que criamos durante esse artigo:

Basta adicionar o nome da Stack e seguir as próximas configurações clicando em `Next` até a etapa de review e clicar em `Create Stack`:

Pronto, feito isso, a nossa stack foi criada e agora basta que você acompanhe a criação através da aba events, por la teremos visualizações sobre a etapa de criação e também em caso de erro.

Por fim, após o término de todo processo de deploy da stack, podemos acessar a aba resources e por lá verificar todos os recursos criados e seus respectivos ids:

Bom, é isso, espero que tenham curtido e entendido um pouco sobre como lançar instâncias através do CloudFormation. Deixo também o link da documentação referente ao recurso [`AWS::EC2::Instance`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html) para vocês verificarem todas as possibilidades de personalização.<file_sep>---
image: /assets/img/bash.png
title: Hospedar página de manutenção no Cloudflare
description: "Em alguns tipos de procedimentos, como uma migração, precisamos
deixar o ambiente fora do ar, seja para evitar inconsistência ou aguardar uma
propagação DNS. "
date: 2021-06-04
category: dev
background: "#EB7728"
tags:
- Cloudflare
- HTML
- DNS
- CDN
- WORKER
categories:
- WORKER
- Cloudflare
- HTML
---
Pensando nisso, vamos utilizar um serviço bastante conhecido no mercado que é o Cloudflare, para hospedar uma página de manutenção estática que será disponibilizada diretamente na estrutura de CDN deles. \
\
Antes disso, vamos falar um pouco sobre o que é o Cloudflare, de maneira bem simplificada, CloudFlare é um serviço de CDN que cria uma cópia em cache do seu site e distribui ela por centenas de servidores ao redor do mundo, reduzindo a carga no seu servidor principal primário e aumentando a velocidade de carregamento das suas páginas enviando elas a seus visitantes a partir do servidor proxy mais próximo dele. \
\
Apesar de algumas funcionalidades do Cloudflare serem pagas, disponibiliza uma serie de serviços gratuitos e uma delas será a que utilizaremos, conta com uma funcionalidade chamada worker. \
\
O Worker é uma funcionalidade do Cloudflare que permite hospedar código javascript e htmldiretamente na infra-estrutura do deles. Com a conta gratuita podemos realizar a criação de um worker e definir as rotas que vão utiliza-lo. \
\
Primeiro de tudo precisamos que o seu site esteja apontado para o DNS do Cloudflare, para isso basta criar uma conta no site deles e realizar o apontamento do seu domínio para os DNS disponibilizado.
Feito isso, vamos na aba `Workers` > `Gerenciar Workers` e em seguida basta cliar em `Crie um worker`, você será direcionado a uma página semelhante a essa:

Pode remover todo o conteúdo pré existente e preencher com o código abaixo:
```javascript
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
/**
* Respond to the request
* @param {Request} request
*/
async function handleRequest(request) {
let modifiedHeaders = new Headers()
modifiedHeaders.set('Content-Type', 'text/html')
modifiedHeaders.append('Pragma', 'no-cache')
return new Response(maintenancepage, {headers: modifiedHeaders})
}
let maintenancepage = `
<!doctype html>
<title>Site Maintenance</title>
<meta charset="utf-8">
<style>
.content {
background-color: rgba(255, 255, 255, 0.75);
background-size: 100%;
color: inherit;
padding: 1px 100px 10px 100px;
border-radius: 15px;
}
h1 { font-size: 40pt;}
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 75%; margin: 0 auto; }
a:hover { color: #333; text-decoration: none; }
</style>
<article>
<div class="background">
<div class="content">
<h1>Em manutenção!</h1>
<p>Pedimos desculpas pelo transtorno, no momento estamos em manutenção, agradecemos a compreensão.</p>
<p>— <B>Direção</B></p>
</div>
</div>
</article>
`;
```
Nesse ambiente estamos criando uma página HTML simples e você poderá editá-la conforme acharmos melhor, deixaremos simples pois será apenas para uso temporário enquanto estivermos realizando algum procedimento no qual o site não deve ficar disponibilizado para o público.
Feito isso, basta clicar no botão `Salvar e Implantar` e partir para a configuração da rota. Para que a página venha a funcionar vamos precisar criar uma rota apontando para esse worker, para isso vamos em `Workers` > `Adicionar rota`, nessa tela você pode colocar um subdomínio, wildcard, caminho absoluto, faça de acordo com a sua necessidade. No nosso caso vamos deixar apenas para o nosso site principal e apontaremos para o nosso worker:

Pronto, basta que acesse o url configurado e verá que agora a página retornada será a de manutenção semelhante a essa:

Espero que tenham gostado, até a próxima!<file_sep>---
image: /assets/img/git.png
title: Git para iniciantes
description: >-
Esse artigo é algo introdutório, o básico para começar a operar com git e
repositórios remotos
date: '2020-01-16 10:50:33'
category: dev
background: '#EB7728'
tags:
- Git
---
Nesse exemplo será utilizado o GitHub porém sinta-se livre para utilizar a plataforma que tiver mais vivência.
Primeiramente realize o download e a instalação do git em sua estação de trabalho, após a instalação, inicie o “git bash” se for windows ou o seu terminal, se for linux, partiremos então para configuração inicial, inserindo seu nome e e-mail (email do github)
```bash
git config --global user.name “<NAME>”
git config --global user.email “<EMAIL>”
```
Após a configuração global, vamos agora criar uma chave SSH para acesso no GitHub, no próprio terminal insira os comandos a seguir:
```bash
ssh-keygen -t rsa -b 4096 -C <EMAIL>;
Generating public/private rsa key pair.
Enter a file in which to save the key (/c/Users/usuario/.ssh/id_rsa):[Aperte Enter]
Enter passphrase (empty for no passphrase): [Aperte Enter]
Enter same passphrase again: [Aperte Enter]
```
Após a criação da chave SSH vamos copiar o arquivo gerado para inserir como chave no nosso GitHub para isso vamos entrar na referida chave
```bash
cd .ssh/
cat id_rsa.pub
```
Copie todo o conteúdo contido nesse arquivo (exemplo de arquivo abaixo)
```bash
ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAACAQDBcakNkMSLIlMluPzhlT7fbVaUFTglGa6RGbT9d39wz3wtO7
m63GBWQCS<KEY>== <EMAIL>
```
Acessando o site [](https://github.com/)[GitHub ](https://github.com/)em configuração “settings” existirá uma opção chamada *“SSH GPG KEYS”* em *“ADD NEW SSH KEY”* você insere o nome da sua máquina “Máquina Trabalho” e a chave SSH logo em seguida. Após a criação da chave SSH e inserção da mesma no git vamos testar para validar a chave, volte para o terminal e realize o devido comando:
```bash
ssh -T [email protected]
# Attempts to ssh to GitHub
The authenticity of host 'github.com (IP ADDRESS)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)?[DIGITE yes]
Hi username! You've successfully authenticated, but GitHub does not
provide shell access.
```
Pronto com a chave SSH criada e conexão com o GitHub estabelecida vamos a alguns comandos básicos, para clonar um repositório criado no GitHub vamos primeiro no repositório e clicamos em *"clone or download"*
Vamos então escolher o destino da pasta que será clonada e seguimos com a realização do seguinte comando para clonagem:
```bash
git clone [email protected]:usuario/pasta.git
```
Feito isso a pasta foi clonada para o caminho configurado, pelo terminal de comando acessaremos a pasta:
```bash
cd pasta/
```
Para começar a usar o git é necessário a adição de novos arquivos e diretórios, dessa forma, basta seguir com a criação dos arquivos e após feito executar o seguinte comando:
```bash
git add .
```
Para commitar arquivos modificados realizamos o seguinte comando:
```bash
git commit -am “comentário sobre modificações”
```
Para enviar os arquivos modificados para o repositório realizamos o seguinte comando:
```bash
git push -u origin master
```
Para atualizar os arquivos locais para os atuais do GitHub realizamos o seguinte comando:
```bash
git pull
```
Até a próxima!
<file_sep>---
image: /assets/img/Iptables.png
title: IPTables compreensão básica
description: >-
Será visto o fluxo de funcionamento do IPTables e seus comandos de forma
básica.
date: '2020-01-27 05:16:28'
category: linux
background: '#EE0000'
tags:
- iptables
---
Em máquinas Linux, é possível a utilização do IPTables como interface de firewall. Ele esta disponível em praticamente todas (se não todas) as distribuições Linux. O Linux em si possui um módulo que controla esse fluxo de pacotes chamado de Netfilter. O Iptables não é nada mais, nada menos, do que um front-end para o Netfilter.
Desta forma, sabendo administrar o Iptables, você conseguirá trabalhar em qualquer distribuição Linux.
## Conceitos
O mais confuso para quem começa a estudar sobre Iptables são as criações de regras, para isso é necessário compreender bem a sua divisão e como as suas tabelas e chains funcionam
## Table
Note que, toda e qualquer regra do Iptables será aplicada em uma table, que é simplesmente o contexto geral da nossa regra. Por exemplo, as regras direcionadas ao servidor em questão serão tratadas na table padrão filter, outra table bastante comum é a nat para realização de Network Address Translation (basicamente, converter IP privado em IP público).
## Chain
Depois, temos a chain, que é o que vem depois da table. No nosso caso, a table filter possui as chains INPUT, FORWARD e OUTPUT. Já a table nat, possui as chains PREROUTING, INPUT, OUTPUT e POSTROUTING. Nesse artigo, por se tratar de um artigo para entendimento básico, iremos abordar apenas a table filter, tratando as requisições recebidas na máquina/servidor.
* Input: Regras para pacotes que estão sendo recebidos pela máquina.
* Output: Regras para pacotes que estão saindo da máquina.
* Foward: Regras para pacotes que estão entrando em nossa máquina e que está sendo redirecionada para outro ponto.
## Special Value
O special value é a ação que a máquina irá tomar quando uma determinada regra for atingida. Neste caso, temos o ACCEPT, DROP e REJECT.
* ACCEPT: O pacote será aceito.
* DROP: O pacote será dropado.
* REJECT: O pacote será rejeitado, isso é, será enviado um sinal para o cliente de que o pacote foi rejeitado.
## Prática
### Listar regras existentes, quando a tabela não é especificada é utilizada a filter como padrão
```bash
iptables -L # Listar todas as regras
iptables -L -n # Lista sem resolução de nomes
iptables -t filter -L -n # Lista todas as regras da tabela filter
iptables -t nat -L -n # Lista todas as regras da tabela nat
iptables -L INPUT -n --line-numbers # Exibe numero de linhas nas listagens
iptables -F # Limpa todas as regras
```
Uma coisa importante para sabermos é que as regras são lidas de cima para baixo. Então, a primeira condição que bater, será aplicada. Antes de seguir com a aplicação de algumas regras é interessante ter em mente algumas informações:
* Quais os serviços esse servidor irá executar e quais portas serão utilizadas
* Determinar quais são os destinos/remetentes confiáveis.
* Determinar qual politica adotar, Accept ou Drop.
No cenário em questão, supomos que a máquina será um servidor web e necessita das portas 80 e 443 liberadas para que o acesso ao serviço seja possível, para isso teremos de executar o seguinte comando:
```bash
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tcp --dport 443 -j ACCEPT
```
Como não determinamos a tabela, fica implícito ao IPTables que a table utilizada é a filter, o ***\-I*** determina a chain que será utilizada, nesse caso será a INPUT, como a requisição será tratada na máquina, o ***\-p tcp*** determina que o protocolo utilizado será o TCP, podendo ser alterado pada ***\-p udp*** quando UDP. O trecho ***\--dport*** informa a porta que será atingida pelo pacote, nesse caso determinamos as portas 80 e 443, portas padrões para servidores web, o ***\-j*** irá determinar o special value, nesse caso a máquina deverá aceitar.
## Alterando a politica padrão
O padrão determinado pelo IPTables é a politica de ***ACCEPT***, na maioria dos casos é necessário o bloqueio total e ir realizando a liberação de acordo com a necessidade de cada serviço ou ambiente. Para mudar a politica padrão de uma tabela, basta seguir da seguinte forma:
```bash
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
```
Com a politica ajustada para negar as conexões basta seguir com a liberação do acesso para os endereços que julga confiáveis ou que devem ter acesso a máquina, bata utilizar o seguinte modelo para
```bash
iptables -t filter -I INPUT -s IPORIGEM -p tcp --dport PORTA -j ACCEPT
```
É comum que seja adotado a adição de comentários, para que possa saber o motivo da adição qual ou mais informações sobre o procedimento, para adicionar um comentário na regra adicionada, basta seguir da seguinte forma:
```bash
iptables -t fitler -I OUTPUT -s IPORIGEM -p tcp --dport 10050 -m comment --comment "Teste" -J ACCEPT
```
## Remoção e salvando regras
Sabendo o funcionamento das tabelas, precisamos também como remover regras, caso não necessário ou por adição de forma equivocada, para remover a regra, o ideal é que antes liste as tabelas listando o numero das linhas:
```bash
iptables -L INPUT -n --line-numbers
```
Com o numero da linha, basta seguir com a remoção da regra usando o parâmetro ***\-D***
```bash
iptables -D INPUT 5
```
Feito todos os procedimentos, basta salvar, lembrando que sempre que realizar uma edição das regras é necessário salvar para que o firewall da máquina saibas quais regras iniciar em caso de reinicialização da máquina ou do serviço:
```bash
/sbin/service iptables save
#ou
service iptables save
#ou
iptables-save
```
Bom, esse foi um artigo bem curto e direto, o IPTables é um mundo de possibilidade, futuramente voltaremos com mais artigos aprofundando mais nas regras para NAT.
<file_sep>---
image: /assets/img/HashiCorp-Terraform-logo.png
title: Introdução a Terraform com Atlantis
description: O Atlantis é uma aplicação que, através de Pull Requests, permite
fazer GitOps para Terraform.
date: 2022-01-17
category: devops
background: "#05A6F0"
tags:
- devops
- terraform
- atlantis
- gitops
- ci
- cd
- aws
- ecs
- fargate
categories:
- devops
- terraform
- atlantis
- gitops
- ci
- cd
- aws
- ecs
- fargate
---
Ele funciona ouvindo Webhooks de plataformas de Git como: Github, Gitlab ou do Bitbucket e retorna o output dos comandos `terraform plan` e `terraform apply` através de comentários.
De uma forma mais simples, o Atlantis atua como uma "ponte" entre o Terraform e a plataforma de Git, tornando os plans e applies muito mais colaborativos. Mas por quê? Infraestrutura como código é uma abordagem de automação de infraestrutura baseada em princípios de desenvolvimento de software, com reviews, testes, CI/CD.
# Antes de iniciar
A partir do momento que o Atlantis é adotado, é ele quem define qual versão do Terraform está rodando e é ele quem conhece as secrets e keys dos provedores de cloud, serviços.
É sempre bom acompanhar as releases do projeto para ver se a versão mais recente do Terraform já possui suporte pelo Atlantis. E não necessariamente usar a versão mais recente do Atlantis exige atualizar seus projetos, por exemplo é possível usar a versão mais recente do Atlantis e para cada repositório/projeto usar uma versão diferente do Terraform.
Qualquer que seja a estrutura utilizada, o Atlantis vai rodar sem problemas. É possível utilizar:
* Monorepo com vários projetos
* Único repo com um único projeto
* Monorepo com vários projetos e + módulos
* Multirepo (basta ter um webhook para cada um deles)
* É possível também utilizar Workspaces.
# Configuração
Para subir o ambiente com Atlantis, vamos utilizar a AWS para hospeda-lo e o Terraform para criar toda a stack necessária para a utilização do Atlantis.
Utilizaremos o módulo oficial do Atlantis para Terraform, para ter mais informações sobre como o módulo funciona ou como personaliza-lo você pode acessar o [link](https://registry.terraform.io/modules/terraform-aws-modules/atlantis/aws/latest).
## 1- Módulo
Primeiramente precisamos ter configurado em nosso ambiente as chaves que tenham permissão suficientes na AWS para realização das seguintes ações:
* Criação de Cluster ECS com Fargate
* Acesso ao Route53 para criação de entradas DNS
* EC2 para criação de target groups e ALB
* ACM
Vamos lá, partiremos de um ponto onde entendemos que você irá utiliza-lo em sua infra existente no qual não será necessário criar infraestrutura de rede, como VPC, subnet, etc...
Em nosso arquivo `main.tf` será onde realizaremos a declaração do módulo Atlantis, teremos algumas definições
OBS: As subnets públicas e privadas precisam pertencer a mesma AZ para que a ALB seja criada e possua targets em sua configuração.
Exemplo, uma subnet privada e uma publica na us-east-1a, outra privada e publica na us-east-1b e assim por diante.
```
# VPC
vpc_id = Id da VPC que utilizaremos
private_subnet_ids = Lista de IDS de subnets privadas
public_subnet_ids = Lista de IDS de subnets publicas
# DNS
route53_zone_name = Domínio no R53 para criação das entradas
# Atlantis
atlantis_github_user = Seu usuário do Github
atlantis_github_user_token = Um token para acesso ao Github
atlantis_repo_allowlist = ["github.com/USER/*"]
atlantis_allowed_repo_names = Lista de nomes de repositórios
```
Para criar o token para o Github basta seguir a orientação do [site oficial](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). Sabendo o que precisamos compor, segue abaixo a estrutura que deve ser aplicada:
```
module "atlantis" {
source = "terraform-aws-modules/atlantis/aws"
version = "~> 3.0"
name = "atlantis"
# VPC
vpc_id = "vpc-faa24787"
private_subnet_ids = ["subnet-448b4125"," subnet-2f3dfc0e"]
public_subnet_ids = ["subnet-448b4125"," subnet-2f3dfc0e"]
ecs_service_assign_public_ip = true
# DNS (without trailing dot)
route53_zone_name = "thiago.click"
# Atlantis
atlantis_github_user = "thiagoalexandria"
atlantis_github_user_token = var.git_token
atlantis_repo_allowlist = ["github.com/thiagoalexandria/*"]
atlantis_allowed_repo_names = ["terraform_atlantis"]
allow_unauthenticated_access = true
allow_github_webhooks = true
policies_arn = [
"arn:aws:iam::aws:policy/AdministratorAccess",
"arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy"
]
}
```
Um ponto de atenção é que se atentem a configuração de `policies_arn` nela foi inseria uma politica de acesso total apenas para o LAB, é indicado que crie uma policy com restrição para que o ECS utilize com o Terraform, aplicando deny explicito para funções que você não quer que o terraform execute.
## Webhook
Com a primeira parte pronta, vamos agora criar o bloco no Terraform para criar o nosso webhook de forma automática,dessa forma basta que configuremos da seguinte forma:
```
module "github_webhook"{
source = "terraform-aws-modules/atlantis/aws//modules/github-repository-webhook"
version = "~> 3.0"
github_owner = "thiagoalexandria"
github_token = var.git_token
atlantis_allowed_repo_names = module.atlantis.atlantis_allowed_repo_names
webhook_url = module.atlantis.atlantis_url_events
webhook_secret = module.atlantis.webhook_secret
}
```
Pronto, agora podemos rodar o nosso `terraform plan` e `terraform apply` para criar toda a stack necessária para o nosso ambiente Atlantis.
## Utilização
Com tudo configurado, já estaremos prontos para utilizar o Atlantis em nossos repositórios configurados, o Atlantis vai intermediar dentro de pull/merge requests e nele nos retorna-rá o *plan* e poderemos realizar ou não o *apply*.
Quando abrirmos um `pull request`, teremos uma interação por parte do Atlantis da seguinte forma:

Dessa forma conseguimos expandir o *output* e ter uma visão completa do *plan*

Se estiver tudo de acordo, basta adicionar um comentário com o comando `atlantis apply` e todo o *plan* será aplicado conforme projeto:

Esse é o básico referente a utilização do Atlantis em pipelines com Terraform, o Atlantis é altamente personalizado no qual você é capaz de ajustar o workflow e adicionar outros *steps* para melhor se adaptar a sua utilização, como adicionar uma *stage* de `terraform validade` por exemplo.
Espero trazer outros assuntos sobre o Atlantis e como conseguimos personaliza-lo para diferentes casos de uso.<file_sep>---
image: /assets/img/bash.png
title: Configuracao de Swappiness
description: A memória Swap do sistema operacional vai muito além de um refúgio
do sistemas para momentos de sobrecarga da memória RAM.
date: 2020-12-28
category: linux
background: "#EE0000"
tags:
- linux
---
Quando a RAM acaba, a memória Swap é utilizada para manter o sistema no ar. Porém, ela também é utilizada mesmo quando há RAM disponível. O próprio sistema move caches pouco utilizados da RAM para o Swap, alguns serviços podem também, descarregam seus caches na Swap. Ou seja, a Swap não somente é utilizada quando acaba a memória RAM.
Sabendo disso, existe uma configuração de swap que pode ser feita através do swappiness configurar a flexibilidade do sistema no uso de Swap. Em maioria a sua configuração padrão é de 60, abaixo vou deixar uma imagem sobre os valores:

> O valor “1” é o mínimo que podemos atribuir ao Swappiness, pois o valor “0” indica que o sistema não poderá usar Swap.
Para verificar e alterar as configurações de swappiness basta seguir os passos:
1 - Primeiramente, vejamos o valor atual do swappiness.
```
sysctl -a | grep -i swappiness
```
2 - A saída do comando será similar a esta:
```
vm.swappiness = 60
```
3 - Para mudar a sua configuração, basta editar o arquivo `/etc/sysctl.conf` e adicionar a variável com o valor que deseja:
```
vm.swappiness=10
```
4 - Ajustado a variável execute o coamndo abaixo para a configuração ser aplicada:
```
sysctl -p /etc/sysctl.conf
```
> Talvez seja necessário limpar a swap com os comandos `swapoff -av` e dps liga-la novamente `swapon -av`<file_sep>---
image: /assets/img/az900.png
title: Meu resultado na prova AZ-900
description: Acabei de realizar a prova AZ-900 e tive sucesso!
date: '2020-06-05'
category: news
background: '#D6BA32'
tags:
- AZure
---
Boa tarde pessoal, como prometido, acabei de realizar a minha prova e corri para comentar com vocês sobre o meu resultado no exame Az-900 da Microsoft. Antes de mais nada, creio que seja necessário explicar um pouco mais sobre a maneira com que eu estudei e o material utilizado.
No ultimo post informei sobre o conteúdo disponibilizado pelo [Microsoft Learn](https://docs.microsoft.com/en-us/learn/paths/azure-fundamentals/), porém além dele me guiei pelas aulas do professor [<NAME>](https://www.udemy.com/course/az-900-azure-exam-prep-understanding-cloud-concepts), o seu curso encontra-se disponível na Udemy e foi totalmente atualizado para a nova grade de 2020. Em seu curso é abordado de forma bastante simples o conteúdo cobrado pela prova além de que no final do curso é disponibilizado um teste de conhecimento.
Saliento que o simulado não é um cópia fiel da prova, porém serve para fixar as principais funções e serviços. Partindo para a prova em si, achei as questões bem contextualizadas e objetivas, a minha prova possuía 32 questões e consegui finaliza-la em pouco mais de 30 minutos.

Acabei tendo sucesso na prova, atingindo 810 pontos, indico a todos que tenham interesse em cloud que faça, uma prova bastante descomplicada e disponibilizada gratuitamente por tempo limitado conforme já havia mencionado no nosso [post anterior](https://thiagoalexandria.com.br/microsoft-disponibiliza-certificacao-azure-900-de-forma-gratuita/), até a próxima!
<file_sep>---
image: /assets/img/HashiCorp-Terraform-logo.png
title: Utilizando Terraform para gerenciar usuários para o cluster EKS
description: Criando um Cluster EKS através do Terraform, em alguns casos,
torna-se necessário definir também que alguns usuários possam administra-lo.
date: 2021-05-14
category: devops
background: "#05A6F0"
tags:
- Devops
- eks
- terraform
- aws
categories:
- Devops
- eks
- terraform
- aws
---
Quando você cria um cluster do Amazon EKS, a função ou o usuário da entidade do IAM, que cria o cluster, recebe automaticamente permissões `system:masters` na configuração do RBAC do cluster, no painel de controle.
Para conceder permissão de interagir com o cluster a usuários ou funções adicionais da AWS, e necessário editar o aws-auth ConfigMap no Kubernetes, porém no nosso caso, que ja estamos utilizando o Terraform para criação do cluster, vamos aproveitar para já subir essa configuração na criação do cluster.
### Estrutura
A nossa estrutura basicamente será a seguinte:
```
.
├── main.tf
├── auth.tf
└── variables.tf
```
* `main.tf` Configuração de provider para o kubernetes.
* `auth.tf` Configuração do configmap para o aws-auth.
* `variables.tf` Definiçao das variáveis.
### Provider
Para essa ação não é utilizado o provider da aws, pois quem vai executá-lo será o proprio kubernetes. Dessa forma vamos precisar configurar o provider para o kubernetes, para isso e necessário que tenhamos as seguintes informações:
* `host` O endpoint que sera utilizado para conexão
* `cluster_ca_certificate` O certificado que sera utilizado para autenticação TLS
* `token` O token a ser usado para autenticação no cluster
Bom todas essas informações podem ser obtidas através de outputs configurados no próprio módulo para o master, exeto o token, precisaremos adicionar um data source para obte-lo:
```
data "aws_eks_cluster_auth" "example" {
name = "example"
}
```
Indico que o data source seja inserido dentro do módulo de criaçao do cluster e com isso externalizado através de um output. Fazendo isso teremos um bloco de provider da seguinte forma:
```
provider "kubernetes" {
host = var.cluster_endpoint
cluster_ca_certificate = base64decode(var.cluster_certificate)
token = var.cluster_token
}
```
### AWS-AUTH
Nesse bloco, trabalharemos a disposição e a configuração do nosso aws-auth. Para que possamos personalizá-lo é necessário utilizarmos um resource do kubernetes chamado `kubernetes_config_map`.
Ele e composto por dois blocos, o `metadata` e o `data`, em `metadata` informaremos o que sera modificado, no nosso caso sera o `aws-auth` do namespace `kube-system`.
Já em data, repassaremos os dados que serão inputados no nosso `aws-auth`, utilizaremos o `mapRoles` e `mapUsers` para mapear os usuários e roles adicionais que precisam acessar. Uma observação e para que precisamos ajustar a variável para yaml com o `yamlencode`
```
resource "kubernetes_config_map" "aws_auth" {
metadata {
name = "aws-auth"
namespace = "kube-system"
}
data = {
mapRoles = yamlencode(var.map_additional_iam_roles)
mapUsers = yamlencode(var.map_additional_iam_users)
}
}
```
### Variáveis
Bom, aqui fica a magica, precisamos montar a estrutura de objeto para receber e mapear as Roles e os Usuários. Para isso precisamos entender primeiro o que e necessário para darmos permissão a um usuário e ou a uma role, entao vamos la.
Para adicionarmos a permissão para uma role vamos precisar das seguintes informações:
* `rolearn`
* `username`
* `groups`
Ja para adicionarmos um usuário o processo e praticamente o mesmo, diferenciando apenas que nesse inves de inserir uma `rolearn` utilizamos o `userarn`:
* `userarn`
* `username`
* `groups`
Sabendo disso, vamos montar a nossa lista de objeto para cada um dos cenários:
```
variable "map_additional_iam_roles" {
description = "Additional IAM roles to add to `config-map-aws-auth` ConfigMap"
type = list(object({
rolearn = string
username = string
groups = list(string)
}))
default = []
}
variable "map_additional_iam_users" {
description = "Additional IAM users to add to `config-map-aws-auth` ConfigMap"
type = list(object({
userarn = string
username = string
groups = list(string)
}))
default = []
}
variable "cluster_token" {
description = "Cluster authentication token"
}
variable "cluster_certificate" {
description = "Amazon EKS CA certificate."
}
variable "cluster_endpoint" {
description = "Amazon EKS private API server endpoint."
}
```
Bom, espero que tenha ficado claro e que tenham compreendido bem o cenário, recentemente passei por esse problema e tive uma certa dificuldade com a documentação achando apenas alguns fragmentos de explicações.
Até a proxima.
<file_sep>---
image: /assets/img/AWS.png
title: EKS com ALB controller
description: O ALB é um serviço de balanceamento de carga de aplicativos
oferecido pela AWS. Ele distribui o tráfego de entrada de forma inteligente
entre as instâncias de back-end de sua aplicação, com base nas regras que você
configura. Isso permite que você aproveite automaticamente a escalabilidade e
a disponibilidade de sua aplicação.
date: 2023-01-27
category: aws
background: "#FF9900"
tags:
- aws
- alb
- k8s
- ingress
categories:
- aws
- alb
- k8s
- ingress
---
O ALB controller é um controlador Kubernetes que permite gerenciar seus ALBs do Kubernetes. Ele permite que você crie, configure e gerencie ALBs e suas regras de roteamento diretamente a partir de suas definições de ingress no Kubernetes.
Para alcançarmos o objetivo final do laboratório, é crucial que tenhamos seguido os passos descritos nos artigos recentes, onde configuramos o cluster e criamos o provedor de identidade IAM, são eles o [Criando um cluster](https://thiagoalexandria.com.br/criando-um-cluster-no-amazon-eks/) e [Permissões granulares](https://thiagoalexandria.com.br/criacao-de-permissoes-granulares-do-iam-para-pods/). Sabendo disso vamos então passar pelos seguintes pontos para conseguirmos configurar o controller:
* Instalação do Helm
* Criação de IAM Roles
* Install ALB Controller
* Criação de um ingress para sample app
# Instalação do Helm
Helm é uma ferramenta que facilita a instalação, gerenciamento e configuração de aplicativos em clusters Kubernetes através de pacotes chamados `charts`, além de permitir a criação de templates para configuração de recursos do k8s tornando mais fácil gerenciar aplicações em ambientes K8s. Para realizar a instalação podemos seguir o orientado pela [documentação oficial](https://helm.sh/docs/intro/install/) baseado no seu sistema operacional ou executar o script abaixo que faz a analise e baixa a versão mais recente para o seu dispositivo:
```
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
```
# Criação de IAM Roles
Para permitir que um ambiente interaja com os recursos da AWS, é necessário criar uma IAM Role com o nível mínimo de acesso necessário e atribuí-la ao nosso controlador. Assim como em qualquer outro cenário, essa é uma etapa importante para garantir a segurança dos recursos da AWS. O AWS load balancer controller ja tem uma policy disponibilizada pela aws especialmente para que possamos criar a role, basta seguir o comando abaixo para realizar o download local:
```
curl -O https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.4/docs/install/iam_policy.json
```
Feito o download, basta que executemos o seguinte comando utilizando o aws cli para criar a policy:
```
aws iam create-policy \
--policy-name AWSLoadBalancerControllerIAMPolicy \
--policy-document file://iam_policy.json
```
Agora com policy criada, vamos começar a criação da IAM Role, para isso precisamos saber o ID do nosso OIDC e para descobrir basta executar o seguinte comando:
```
aws eks describe-cluster --name my-eks-lab-cluster --query "cluster.identity.oidc.issuer" --output text | cut -d '/' -f 5
```
Primeiro, vamos criar uma Role adicionando uma relação de confiança através do trust relationships, para criar a função, a namespace que o alb irá executar é a `kube-system` e a service account que terá permissão para acessar a função será `aws-load-balancer-controller`. Lembre-se de substituir, pelos dados da sua conta AWS e o id do OIDC obtido no passo anterior dai execute o seguinte comando para criar um arquivo JSON de política de confiança do IAM:
```
cat >load-balancer-role-trust-policy.json <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::<AWS-ACCOUNT>:oidc-provider/oidc.eks.<AWS-REGION>.amazonaws.com/id/<OIDC-ID>”
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"oidc.eks.<AWS-REGION>.amazonaws.com/id/<OIDC-ID>:aud": "sts.amazonaws.com",
"oidc.eks.<AWS-REGION>.amazonaws.com/id/<OIDC-ID>:sub": "system:serviceaccount:kube-system:aws-load-balancer-controller"
}
}
}
]
}
EOF
```
Com o arquivo JSON criado, vamos agora criar a função de permissão (Role) usando o AWS CLI.
```
aws iam create-role \
--role-name AmazonEKSLoadBalancerControllerRole \
--assume-role-policy-document file://"load-balancer-role-trust-policy.json"
```
Com a função criada, vamos anexar a política que determinará quais permissões o controller poderá assumir, lembre-se de alterar o campo em destaque pelo id da sua conta AWS:
```
aws iam attach-role-policy \
--policy-arn arn:aws:iam::<AWS-ACCOUNT>:policy/AWSLoadBalancerControllerIAMPolicy \
--role-name AmazonEKSLoadBalancerControllerRole
```
# Instalação ALB Controller
O primeiro passo para seguirmos com a instalação é criarmos a `ServiceAccount`, rode o comando abaixo na sua máquina para criar o arquivo de manifesto, mais uma vez, lembra-se de alterar o <AWS-ACCOUNT> pelo id da sua conta:
```
cat >aws-load-balancer-controller-service-account.yaml <<EOF
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/name: aws-load-balancer-controller
name: aws-load-balancer-controller
namespace: kube-system
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::<AWS-ACCOUNT>:role/AmazonEKSLoadBalancerControllerRole
EOF
```
Com a ServiceAccount criada agora teremos como de fato instalar o ALB controller utilizando o `helm` e construirmos o nosso primeiro ingress expondo o serviço para a internet, a instalação utilizando o `helm` é bem simples e basta que executemos o comando abaixo:
```
# Add Helm repo
helm repo add eks https://aws.github.io/eks-charts
# Install
helm install aws-load-balancer-controller eks/aws-load-balancer-controller -n kube-system --set clusterName=my-eks-lab-cluster --set serviceAccount.create=false --set serviceAccount.name=aws-load-balancer-controller --set image.repository=602401143452.dkr.ecr.us-east-1.amazonaws.com/amazon/aws-load-balancer-controller
```
Pronto, com isso ja teremos o load balancer controller criado no cluster, podemos começar a testar e criar os recursos necessários para que os acessos ocorram sem maiores problemas. É necessário que criem um security group para a ALB, que permita o trafego HTTP/HTTPS e dentro do security group dos nodes permita o trafego vindo a partir desse SG, com isso em mente podemos substituir os valores e partir para criação do ingress através do template abaixo:
```
cat >sample-app-ingress.yaml <<EOF
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]'
alb.ingress.kubernetes.io/backend-protocol: HTTP
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/healthcheck-interval-seconds: "5"
alb.ingress.kubernetes.io/healthcheck-path: /
alb.ingress.kubernetes.io/healthcheck-protocol: HTTP
alb.ingress.kubernetes.io/healthcheck-timeout-seconds: "3"
alb.ingress.kubernetes.io/healthy-threshold-count: "2"
alb.ingress.kubernetes.io/load-balancer-attributes: idle_timeout.timeout_seconds=60
alb.ingress.kubernetes.io/target-group-attributes: deregistration_delay.timeout_seconds=60
alb.ingress.kubernetes.io/unhealthy-threshold-count: "2"
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/security-groups: <NOME-SG-ALB>
alb.ingress.kubernetes.io/subnets: <LISTA-SUBNETS>
alb.ingress.kubernetes.io/tags: env=test,app=eks-sample-linux-app
labels:
env: dev
app: eks-sample-linux-app
name: eks-sample-linux-app
namespace: eks-sample-app
spec:
rules:
- http:
paths:
- backend:
service:
name: eks-sample-linux-service
port:
number: 80
path: /*
pathType: ImplementationSpecific
EOF
```
Dessa forma o ingress será criado, disparando então a criação do application load balancer que dentro do console AWS irá criar o target group apontando para o nosso pod. O processo pode ser acompanhado através do console da AWS.
Espero que tenham compreendido bem todo o processo de criação e disponibilização, deixarei o link da [documentação](https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.1/guide/ingress/annotations/) contento todos as annotations possíveis, assim vocês podem analisar outras abordagem como forçar redirecionamento para HTTPS, utilizar um certificado importado no ACM e entre outras.<file_sep>---
image: /assets/img/AWS.png
title: Criando um Cluster no Amazon EKS
description: "Amazon Elastic Kubernetes Service (EKS) é um serviço gerenciado do
Kubernetes da Amazon Web Services (AWS) que permite que você execute, gerencie
e escala facilmente clusters do Kubernetes no AWS. "
date: 2023-01-13
category: aws
background: "#FF9900"
tags:
- eks
- k8s
- aws
categories:
- eks
- k8s
- aws
---
Antes de partirmos para a criação do cluster EKS precisamos dar um paço para tras e entender o que é o Kubernetes e quais pontos o serviço gerenciado veio para resolver. O Kubernetes é um sistema de orquestração de contêineres que permite gerenciar aplicativos em contêineres em um cluster de máquinas. Com o EKS, você pode usar o Kubernetes para gerenciar aplicativos em contêineres no AWS sem precisar instalar e gerenciar manualmente o controlador do Kubernetes.
Usar o EKS tem várias vantagens sobre gerenciar manualmente um cluster do Kubernetes. Algumas das vantagens incluem:
* Facilidade de uso: o EKS cuida de tarefas complexas, como a configuração e o gerenciamento do controlador do Kubernetes, permitindo que você se concentre em desenvolver e executar aplicativos.
* Escalabilidade automática: o EKS gerencia automaticamente a escalabilidade do cluster do Kubernetes, permitindo que você adicione ou remova nós com facilidade.
* Integração com outros serviços do AWS: o EKS se integra com outros serviços do AWS, como o Elastic Load Balancing (ELB) e o Amazon RDS, para fornecer uma solução completa para aplicativos em contêineres.
* Alta disponibilidade: o EKS fornece uma alta disponibilidade do controlador do Kubernetes, permitindo que você execute aplicativos críticos de negócios de forma confiável.
Em resumo, EKS é um serviço da AWS que facilita a criação, configuração e escalabilidade de cluster Kubernetes de forma segura e simples. Isso permite que as equipes de DevOps ou o desenvolvedor possam se concentrar em suas aplicações, enquanto a AWS cuida das preocupações de infraestrutura do cluster.
Sabendo disso vamos então passar pelos seguintes pontos para conseguirmos criar o nosso cluster e subir a nossa primeira aplicação de teste:
* Cluster IAM Role
* Criar EKS Cluster
* Atualizar kubeconfig
* SSM Daemonset
* Node IAM Role
* Criar Node Group
* Deploy Sample App
## Cluster IAM Role
Vamos primeiro criar a Role adicionando uma relação de confiança através do trust relationships. Vamos a partir dai determinar que o serviço AWS podem assumir essa Role, por se tratar do Cluster EKS, a politica seguirá conforme declarado abaixo, basta que execute o seguinte comando para criar um arquivo JSON de política de confiança do IAM:
```
cat >eks-cluster-trust-policy.json <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "eks.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
EOF
```
Com o arquivo JSON criado, vamos agora criar a função de permissão (Role) usando o AWS CLI.
```
aws iam create-role --role-name EksClusterRole --assume-role-policy-document file://"eks-cluster-trust-policy.json"
```
Com a função criada, vamos anexar a política que determinará quais permissões o cluster poderá assumir.
```
aws iam attach-role-policy --policy-arn arn:aws:iam::aws:policy/AmazonEKSClusterPolicy --role-name EksClusterRole
```
# Criar EKS Cluster
Temos várias opções diferentes para criar um cluster, como o EKSCTL e o AWS CLI, mas para obter uma visão mais completa do processo de criação, vamos utilizar o console da Amazon. Para criar um cluster EKS, acesse o link do console da [Amazon EKS](https://console.aws.amazon.com/eks/home#/clusters).
Escolha Add cluster e, em seguida, Create.

Vamos preencher algumas informações na primeira tela de configuração, precisamos preencher os campos de Name, Kubernetes Versions, Cluster Service Role, Secrets encryption ( Opcional ) e Tags, feito isso podemos avançar para a próxima tela de configuração.

Na página Specify networking vamos precisar inserir as informações de VPC, Subnets, Security Groups (Opcional), IP address family e o tipo de Endpoint, para o nosso laboratório vamos seguir com o endpoint Público.

Vamos pular a parte de configuração de logs, uma vez que esse é apenas um laboratório, mas lembre-se que podemos habilitar os seguintes logs do control plane:
* API server
* Audit
* Authenticator
* Controller manager
* Scheduler
Todos os logs ficam disponíveis através do CloudWatch, podendo ser consumido diretamente pelo console da AWS ou utilizando alguma outra ferramenta como por exemplo o AWS Opensearch.
Por fim, basta confirmar as próximas telas, onde serão apresentados os plugins que são instalados por padrão no cluster. Em seguida, será necessário revisar e confirmar para iniciar a criação do cluster.
# Atualizar kubeconfig
Com o nosso cluster criado, podemos testar o acesso ao endpoint do API Service do nosso cluster fazendo a atualização do contexto do `kubeconfig` através do seguinte comando no AWS cli.
```
aws eks update-kubeconfig --region us-east-2 --name my-eks-lab-cluster
```
Obtendo sucesso, passamos a ter acesso dentro do cluster e podemos realizar chamadas com o `kubectl` como o do exemplo abaixo:

# SSM Daemonset
No EKS, devido à uma serie de diretrizes de segurança, quando trabalhamos com Managed Node Groups os Nodes possuem apenas uma chave SSH anexadas a eles, definida no momento da criação dos Grupos.
Para isso vamos utilizar o DaemonSet do Kubernetes para instalar o SSM Agent em todos os Nodes que vierem a fazer parte do nosso Cluster, em vez de instalá-lo manualmente ou substituir a AMI o DaemonSet usa um CronJob no Node para programar a instalação do SSM Agent.
Copie o texto abaixo para criar o manifesto necessário para aplicarmos no nosso Cluster:
```
cat << EOF > ssm_daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
k8s-app: ssm-installer
name: ssm-installer
namespace: kube-system
spec:
selector:
matchLabels:
k8s-app: ssm-installer
template:
metadata:
labels:
k8s-app: ssm-installer
spec:
containers:
- name: sleeper
image: busybox
command: ['sh', '-c', 'echo I keep things running! && sleep 3600']
initContainers:
- image: amazonlinux
imagePullPolicy: Always
name: ssm
command: ["/bin/bash"]
args: ["-c","echo '* * * * * root yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm & rm -rf /etc/cron.d/ssmstart' > /etc/cron.d/ssmstart"]
securityContext:
allowPrivilegeEscalation: true
volumeMounts:
- mountPath: /etc/cron.d
name: cronfile
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumes:
- name: cronfile
hostPath:
path: /etc/cron.d
type: Directory
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
terminationGracePeriodSeconds: 30
EOF
```
Para aplicar, basta utilizar o comando do `kubectl`:
```
kubectl apply -f ssm_daemonset.yaml
```
# Node IAM Role
Assim como necessário para o Cluster, precisamos criar uma Role especifica para utilização do nosso Node Group, e para isso existe um padrão simples de IAM Role, assim como para o Cluster vamos precisar criar uma politica adicionando uma relação de confiança através do trust relationships:
```
cat >node-trust-relationship.json <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
EOF
```
Com o arquivo JSON criado, vamos agora criar a função de permissão (Role) usando o AWS CLI.
```
aws iam create-role \
--role-name EKSNodeRole \
--assume-role-policy-document file://"node-trust-relationship.json"
```
Criada a função, vamos anexar a política que determinará quais permissões o Node poderá assumir:
```
aws iam attach-role-policy \
--policy-arn arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy \
--role-name EKSNodeRole
aws iam attach-role-policy \
--policy-arn arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly \
--role-name EKSNodeRole
aws iam attach-role-policy \
--policy-arn arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy \
--role-name EKSNodeRole
aws iam attach-role-policy \
--policy-arn arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforSSM \
--role-name EKSNodeRole
```
# Criar Node Group
Para adicionar um grupo de nós ao nosso cluster, basta acessar o console da AWS e clicar no nome do cluster recém criado. Nessa tela encontraremos informações relevantes sobre o cluster e uma aba chamada `compute` destinado a criação e gerenciamento dos Node Groups:

Para adicionar o Node, basta clicar em add node group e então iniciaremos o wizard para criação do recurso. Inicialmente precisamos preencher as seguintes informações, Nome, Node IAM role e Tags, as demais informações são opcionais como Kubernetes labels, Kubernetes taints. Como vamos utilizar Managed Nodes vamos ignorar a configuração de Launch Templates.

Na próxima tela, vamos determinar a parte computacional, então vamos escolher a familia das instancias EC2 e as configurações de scaling. Essa fica em aberto não existe uma configuração correta, vai depender da sua necessidade, por se tratar de um lab podemos seguir com apenas uma maquina t3a.medium:

Ainda nessa tela temos uma configuração muito importante para o Node Group que é a configurar o máximo de nodes que podem ficar indisponíveis ou que podem ser tolerados para realizarmos uma atualização no Node Group.

Na ultima tela temos a definição de rede, onde será possível definir quais subnets vão ser utilizadas, um ponto de atenção é que para subnets publicas é obrigatório que as subnets disponibilizem IPs públicos para as instancias por padrão.
# Deploy Sample App
Bom, nessa altura do campeonato devemos estar com o Cluster EKS criado e com o Node disponível, para realizar um teste vamos subir um `pod` simples, composto por um deployment e um service responsáveis por subir um Nginx na namespace `eks-sample-app`. Primeiro precisamos criar a namespace:
```
kubectl create namespace eks-sample-app
```
Para criamos o Nginx, rode o comando abaixo na sua máquina para criar o arquivo de deployment:
```
cat << EOF > eks-sample-app.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: eks-sample-linux-deployment
namespace: eks-sample-app
labels:
app: eks-sample-linux-app
spec:
replicas: 3
selector:
matchLabels:
app: eks-sample-linux-app
template:
metadata:
labels:
app: eks-sample-linux-app
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- arm64
containers:
- name: nginx
image: public.ecr.aws/nginx/nginx:1.21
ports:
- name: http
containerPort: 80
imagePullPolicy: IfNotPresent
nodeSelector:
kubernetes.io/os: linux
EOF
```
Arquivo criado, basta que apliquemos no cluster:
```
kubectl create -f eks-sample-app.yaml
```
Um `service` permite acessar todas as réplicas através de um único endereço IP ou nome, então para isso rode o comando abaixo na sua máquina para criar o arquivo yaml:
```
cat << EOF > eks-sample-app-service.yaml
apiVersion: v1
kind: Service
metadata:
name: eks-sample-linux-service
namespace: eks-sample-app
labels:
app: eks-sample-linux-app
spec:
selector:
app: eks-sample-linux-app
ports:
- protocol: TCP
port: 80
targetPort: 80
EOF
```
Assim como o deployment, basta aplicar no Cluster com o `kubectl`:
```
kubectl create -f eks-sample-linux-service.yaml
```
Vamos utilizar o seguinte comando para retornar todo o conteúdo criado na namespace:
```
kubectl get all -n eks-sample-app
```

Com tudo funcionando, podemos testar o acesso ao nosso `Nginx` através do port-foward, sendo possível acessar o `service` criado utilizando a infraestrutura do cluster, para isso basta executar o comando abaixo e acessar no seu navegador através do `http://localhost:8080`:
```
kubectl port-forward svc/eks-sample-linux-service 8080:80 -n eks-sample-app
```

# Considerações finais
Espero que tenham aproveitado o lab e que os pontos principais referente a criação e funcionamento do EKS tenha sido explanado de forma simples, até a próxima!<file_sep>---
image: /assets/img/AWS.png
title: Como configurar um bucket para aceitar apenas conexões HTTPS
description: O Amazon S3 oferece criptografia in transit e criptografia at
rest. Criptografia in transit refere-se a HTTPS e criptografia at rest
refere-se a criptografia do lado do cliente ou do lado do servidor.
date: 2021-09-16
category: aws
background: "#FF9900"
tags:
- aws
- s3
- seguranca
- iam
- ""
categories:
- aws
- s3
- seguranca
- iam
- ""
---
Por padrão o S3 aceita requisições HTTP e HTTPS, por outro lado todos os serviços interno da amazon dão preferência a utilização por HTTPS, por exemplo o AWS CLI ao chamar algum serviço utilizará sempre o endpoint seguro com TLS/SSL.
Dessa forma, para que tenhamos a garantia de que o acesso aos nosso buckets possuam uma segurança durante o trafego, in transit, precisamos fazer com que ele de preferência apenas para HTTPS e passe a negar a utilização por HTTP.
Sabendo disso, vamos elaborar um Bucket policy que ira restringir o acesso inseguro, aceitando apenas quando recebido por HTTPS.
### 1. Criar um bucket
Nesse passo não tem mistério, basta que acesse o console do s3 e realize a criação de um bucket permitindo o acesso externo, precisamos do acesso externo para exemplificar o bloqueio por parte da politica. Utilizaremos um bucket fictício chamado `lab-s3-http`.
### 2. Ajustar o bucket policy
Apos criar o bucket, acesse a aba de `Permissions` e la procure por `Bucket policy` em seguida clique em `Edit`.
Pronto, com o editor aberto, precisamos criar uma policy da seguinte forma:
```
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "SecureTransport",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::lab-s3-http",
"arn:aws:s3:::lab-s3-http/*"
],
"Condition": {
"Bool": {
"aws:SecureTransport": "false"
}
}
}
]
}
```
O que essa politica faz?
A regra de `SecureTransport` ira bloquear qualquer ação que venha a ser realizada para o bucket em questão cujo a flag de SecureTransport venha como false, ou seja tudo que vir por meio de HTTP não será aceito pela policy.
OBS: Lembre-se de no bloco de `Recource` alterar os recursos para o nome do seu bucket.
### 3. Testar o acesso
Para realizar o teste e validar que o bucket só encontra-se disponível atraves de HTTP dessa forma, faça o upload de um arquivo dentro do bucket e após feito copie a url de acesso inserindo no navegador o `http://` e observe que o bloqueio retornara na tela uma mensagem semelhante a essa:

Teste agora o acesso utilizando https e veja que o mesmo url abre a imagem:

### 4. Utilizar o AWS Config para monitorar os buckets
Podemos utilizar o AWS Config para monitorar a nossa infraestrutura caso fuja do padrão de compliance que desejamos, dessa forma podemos criar uma Config baseada na politica ja existente da Amazon chamada `s3-bucket-ssl-requests-only`.

Você pode incrementar o config adicionando uma ação de correção que lhe notifique por e-mail através do `SNS` quando um bucket for identificado como fora de conformidade.
Espero que tenham curtido a ideia e habilitem nos buckets de voces!<file_sep>---
image: /assets/img/HashiCorp-Terraform-logo.png
title: Atlantis com workflow personalizado
description: Workflows personalizados podem ser definidos para substituir os
comandos padrões que o Atlantis executa.
date: 2022-02-18
category: devops
background: "#05A6F0"
tags:
- devops
- terraform
- atlantis
- gitops
- ci
- cd
- aws
- ecs
- fargate
categories:
- devops
- terraform
- atlantis
- gitops
- ci
- cd
- aws
- ecs
- fargate
---
Antes de começarmos é interessante que leia um pouco sobre a nossa [ultima publicação](https://thiagoalexandria.com.br/introdu%C3%A7%C3%A3o-a-terraform-com-atlantis/) e como nós o configuramos utilizando o Terraform e AWS.
Por padrão, o fluxo do Atlantis é com o básico do Terraform com o ***plan*** e ***apply***. Como mencionado no nosso último post sobre Atlantis, abordamos a possibilidade de criar ***Workfows*** personalizados para que possamos ajustar o processo de integração da forma que melhor atende nossas necessidades.
Criaremos um arquivo chamado `repos.yaml` para que possamos desenvolver o nosso próprio ***[Workflow](https://www.runatlantis.io/docs/custom-workflows.html)***, durante a `stage` de ***plan*** será feito a inclusão de uma ação de ***validate***:
```
repos:
- id: /.*/
allow_custom_workflows: true
allowed_overrides:
- workflow
workflow: default
workflows:
default:
plan:
steps:
- init
- run: terraform validate -no-color
- plan
apply:
steps:
- apply
```
Para que possamos utilizar o ***Workflow*** em questão, vamos precisar carrega-lo no nosso ambiente com Atlantis, para isso será necessário que configuremos dentro no nosso módulo adicionando a diretiva `custom_environment_variables` com a variável de ambiente `ATLANTIS_REPO_CONFIG_JSON` que receberá o nosso `repos.yaml` como valor:
```
custom_environment_variables = [
{
"name": "ATLANTIS_REPO_CONFIG_JSON",
"value": jsonencode(yamldecode(file("${path.module}/repos.yaml")))
}
]
```
Após aplicar a mudança dentro da nossa infraestrutura, basta que a gente realize o teste, vamos editar o projeto e ver se a nossa mudança é aplicada dentro do nosso `merge`:

Observe que no inicio do `Output` ele retorna o output do `terraform validate` informando que a configuração é valida, dessa forma é possível realizarmos várias personalizações e integrações.
Espero que tenham entendido a ideia do que seja um ***Workflow*** personalizado e qualquer dúvida pode mandar nos comentários!<file_sep>---
image: /assets/img/bash.png
title: Gerenciamento básico de arquivos
description: >-
Entender melhor os comandos antes de utiliza-los é muito importante, então
segue alguns dos mais comuns.
date: '2020-02-13'
category: linux
background: '#EE0000'
tags:
- Bash
categories:
- Linux
---
É muito comum vermos os tutoriais sobre linux informando diversas variantes de comandos como ***ls, mkdir, cp, mv*** e não informar para que as serve. Irei compartilhar alguns dos comandos que mais utilizo dentro do meu dia a dia como analista de sistemas, assim como qual a sua utilidade e suas principais variantes.
Vou dividir essa serie de postagens em **"Gerenciamento básico de arquivos", "Fluxos, Pipes e Redirecionamentos" e "Criar, Monitorar e Encerrar Processos"**, iniciaremos abordando o Gerenciamento básico de arquivos, através dos comandos ***cd, ls, file, touch, cp, mv, rm, mkdir, rmdir, find***.
Antes de começarmos, vou repassar alguns atalhos para facilitar a nossa utilização do terminal, o mais comum é o "TAB" para realizar o autocomplete, porém existem outros que podemos utilizar para aumentar a nossa agilidade durante os procedimentos, são eles:
```bash
Ctrl+c: Cancela o comando executado
Ctrl+d: Desloga da sessão atual (exit)
Ctrl+u: Apaga a linha inteira
Ctrl+a: Vai para o inicio da linha (Home)
Ctrl+l: Limpa a tela
Seta ^: Mostra os ultimos comandos digitados
```
Existem outros, porém esses são os que julgo mais importantes e que utilizo com mais frequência.
## Comandos Básicos
Quando começamos a utilizar o terminal, principalmente no linux, é normal não sabermos como navegar pelo filesystem do sistema operacional, em que pasta estamos, como listar o conteúdo da pasta, então segue alguns comandos para facilitar esse processo de aprendizagem:
```bash
cd - Entrar no diretório desejado
#Acessar diretório:
thiago@pc:~$ cd Downloads/
thiago@pc:~/Downloads$
#Votlar um nível no diretório:
thiago@pc:~/Downloads$ cd ..
thiago@pc:~$
#Volta para o diretório anterior:
thiago@pc:~$ cd -
/home/thiago/Downloads
thiago@pc:~/Downloads$
#Voltando 2 níveis no sistema de arquivo:
thiago@pc:~/Downloads$ cd ../..
thiago@pc:/home$
```
Para listagem de arquivos e diretórios temos o comando ***ls*** e algumas variações que nos trazem mais informações sobre o conteúdo listado:
```bash
#Listagem de arquivos e diretórios
thiago@pc:~$ ls
Área de Trabalho Downloads Desktop Vídeos
#Listagem de arquivos e arquivos ocultas:
thiago@pc:~$ ls -a
. Área de Trabalho Downloads
.. .gconf .purple
#Listagem detalhada de arquivos e diretório:
thiago@pc:~$ ls -l #Pode ser usada também ls -la para add listagem ocultas
total 85900
drwxr-xr-x 2 thiago thiago 4096 Mai 23 13:10 Área de Trabalho
drwxr-xr-x 2 thiago thiago 4096 Mai 10 15:01 Desktop
#Listagem detalhada para visualização de tamanho de pastas:
thiago@pc:~$ ls -lh
total 84M
drwxr-xr-x 2 thiago thiago 4,0K Mai 23 13:10 Área de Trabalho
drwxr-xr-x 2 thiago thiago 4,0K Mai 10 15:01 Desktop
```
Podemos também verificar que tipo de arquivo é exibido, por exemplo de uma image, conseguimos verificar se de fato o arquivo .png é uma imagem, para isso, utilizamos o comando ***file***
```bash
thiago@pc:~/Downloads$ file email.png
email.png: PNG image data, 1074 x 824, 8-bit/color RGB, non-interlaced
```
## Manipulação de arquivos
É bastante comum termos de criar, mover, copiar arquivos no nosso dia a dia, através do terminal isso também é comum e possuímos alguns comandos para realizar essa manipulação de arquivos, para copiar utilizando o comando ***cp:***
```bash
# Copiar um arquivo para um determinado local:
thiago@pc:~/Downloads$ cp codigo-aluno.txt /home/thiago/Documentos/
thiago@pc:~/Downloads$ ls -l /home/thiago/Documentos/
-rw-rw-r-- 1 thiago thiago 38 Jun 9 14:41 codigo-aluno.txt
# Copiando diretórios com o comando cp de forma recursiva:
thiago@pc:~/Downloads$ cp -rv Copia/ /tmp/
'Copia/' -> '/tmp/Copia'
'Copia/texto.txt' -> '/tmp/Copia/texto.txt'
# Copias com preservação de permissão:
thiago@pc:~/Downloads$ cp -p texto.txt /tmp/
# Copiar um arquivo para outro arquivo de nome diferente:
thiago@pc:~/Downloads$ cp texto.txt novotexto.txt
```
Para a realização da criação de arquivos, você pode utilizar diversos comandos, como por exemplo, através de um editor de texto como ***nano*** e ***vim***, porém nesse caso será utilizado o comando ***touch*** pois é bastante simples:
```bash
# Criar um arquivo em brando utilizando o touch
thiago@pc:~$ touch linux.txt
```
Assim como a necessidade de criação dos arquivos, precisamos muitas vezes realizar a remoção de alguns desses, seja para liberação de espaço como também para remoção de arquivos indesejados, para isso é utilizado o comando ***rm*** porém, bastante cuidado para não remover conteúdo critico do sistema:
```bash
# rm Caminho/Completo/do/Arquivo.txt remove sem que seja perguntado nada
thiago@pc:/tmp/teste$ rm teste2/arq5.txt
# Remoção com solicitação de permissão
thiago@pc:/tmp/teste$ rm -i teste2/arq2.txt
rm: remover arquivo comum vazio 'teste2/arq2.txt'? y
thiago@pc:/tmp/teste$
# rm -v nome_do_arquivo (verbose, mostra todas as interações)
thiago@pc:/tmp/teste$ rm -v teste2/arq*
removido 'teste2/arq1.txt'
removido 'teste2/arq2.txt'
# rm -r Diretorio/ (remoção de tudo que existe na pasta diretorio inclusive a pasta)
thiago@pc:/tmp/teste$ rm -r -v teste3/
removido 'teste3/arq1.txt'
removido 'teste3/arq2.txt'
removed directory 'teste3/'
```
Para a criação e manipulação de diretórios, temos os comandos ***mkdir*** e ***rmdir:***
```bash
# Criação de diretório
thiago@pc:/tmp/teste$ mkdir -v teste5
mkdir: foi criado o diretório 'teste5'
# Criando arvoré de diretório
thiago@pc:/tmp/teste$ mkdir -v -p teste10/teste9
mkdir: foi criado o diretório 'teste10'
mkdir: foi criado o diretório 'teste10/teste9'
# Removendo arvore de diretórios vazias
thiago@pc:/tmp/teste$ rmdir -v -p teste10/teste
rmdir: removendo o diretório 'teste10/teste9'
rmdir: removendo o diretório 'teste10'
```
## Busca e compactação
A busca de arquivos é algo bastante util, quando precisamos achar todos os arquivos de configurações de um serviço, todos os arquivos de backup, e para ele, utilizamos o comando ***find*** que pode ser utilizado em conjunto com alguns outros comandos como ***exec*** e ***xargs***, porém nesse exemplo o nosso intuito é apenas identificar os arquivos que foram achados:
```bash
# Achar todos os arquivos .conf
thiago@pc:~$ find Downloads/ -name "*.conf"
Downloads/Teste/httpd.conf
Downloads/Teste/exim.conf
```
Já na compactação de conteúdo, temos várias ferramentas que podem ser utilizadas, como ***tar, gzip, bzip2, xz*** porém utilizaremos o tar com gzip para agrupar e compactar os arquivos:
```bash
# Agrupamento e extração de arquivos utilizando Tar:
c create
x extract
t list
f determina nome do .tar
p preserva permissões originais
v verbose para visualizar atualização
```
Sabendo os parâmetros do comando, vamos seguir agrupando alguns arquivos
```bash
# Criando arquivo agrupado
thiago@pc:~/Downloads/Teste$ tar cpvf exemplo.tar *.conf
httpd.conf
exim.conf
```
Após agrupado, podemos compactar, utilizando o ***gzip***, basta indicar o arquivo:
```bash
thiago@pc:~/Downloads/Teste$ gzip exemplo.tar
```
Podemos fazer o processo de compactação diretamente pelo comando ***tar***, basta adicionar o parâmetro ***z*** para compactar e ***x*** para extrair:
```bash
# Compactar
thiago@pc:~/Downloads/Teste$ tar zcvf exemplo.tar.gz *.conf
httpd.conf
exim.conf
# Descompactar
thiago@pc:~/Downloads/Teste$ tar zxvf exemplo.tar.gz
./httpd.conf
./exim.conf
```
Espero que tenham gostado do conteúdo abordado, nas próximas postagens, vamos abordar **"Fluxos, Pipes e Redirecionamentos".**
<file_sep>---
image: /assets/img/AWS.png
title: Diminuindo disco EBS em instância EC2
description: ' Talvez você esteja se perguntando, podemos diminuir o tamanho do volume do EBS? A resposta é não. É impossível diminuir o tamanho do volume do EBS. Quando você tem 100GB de EBS e decide modificá-lo para 30GB, você receberá um erro. Mas não precisa se preocupar, existe uma forma de contornarmos e aplicar reduções utilizando um disco menor.'
date: '2020-04-30'
category: aws
background: '#FF9900'
tags:
- AWS
- EBS
- EC2
categories:
- AWS
---
A Amazon não permite a redução de disco, por motivos obvies ligado ao mapeamento dos dado dentro da estrutura de armazenamento. Porém existe uma forma de clonarmos e substituir o disco por um de menor capacidade, existem duas formas de fazermos isso, é um procedimento um pouco complexo.
Nesse primeiro artigo iremos abordar uma das formas de substituição, posteriormente irei falar mais sobre uma outra forma para ambientes um pouco mais complexos, vamos lá:
1. Realizar um Snapshot do volume original.
2. Criar um novo e menor volume EBS.
3. Conectar o novo volume.
4. Formatar o novo volume.
5. Montar o novo volume.
6. Copiar os dados do volume antigo para o novo.
7. Preparar o novo volume.
8. Substituir o novo volume na instância.
### Antes de iniciar
Supomos que o ambiente que sofrerá a intervenção esteja disposta da seguinte forma
1. Uma instância chamada `resize-machine` na zona `us-east-1a.`
2. Um volume EBS de **100GB** chamado de `old-volume.`
3. Será feito a redução para **30GB** utilizando o `novo-volume.`
``
### Tire um snapshot do volume
Na página de Volumes selecione o disco que deseja e tire um snapshot por precaução
### Crie o novo volume EBS com 30GB
1. Acesse a opção Elastic Block Store Volumes em EC2.
2. Clique em **Create Volume.**
3. Selecione o mesmo tipo de volume utilizado no volume antigo.
4. Determine o tamanho do novo volume, no nosso caso **30.**
5. Escolha a mesma availability zone para armazenar o `novo-volume` `us-east-1a`.
6. Adicione a Tag: Name com valor : novo-volume
### Conecte o novo volume no EC2
1. Botão direito no volume
2. Clique em "Attach Volume"
3. Selecione a instância `resize-machine`
4. Clique em "Attach"
Assim que acessarmos a máquina liste os discos para ver o novo volume disponível com o comando `lsblk`, no nosso caso o disco disponível é o `/dev/xvdf`.
### Formatar o novo volume
1. Cheque se o volume de fato não possui nenhum arquivo utilizando o comando`file -s /dev/xvdf`.
2. Se o retorno for `/dev/xvdf: data`, significa que o volume esta vazio e pronto para formatação.
3. Formate o disco utilizando o comando`mkfs -t ext4 /dev/xvdf`.
### Montar o novo volume
1. Crie um diretório para poder montarmos o volume `mkdir /mnt/resize`.
2. Monte o novo volume no diretório que criamos `mount /dev/resize`.
3. Cheque com o comando `df -h` se o disco foi montado sem problemas.
### Copiar os dados do volume antigo para o novo.
1. Nesse passo utilizaremos o `rsync` para copiar todo o disco antigo para o novo volume, para evitar problemas com timeout, indicamos a execução do comando dentro de uma screen.
2. Para criar uma nova screen basta acessar o servidor e digitar o comando `screen`.
3. Na nova screen basta executar o seguinte comando `rsync -axv --progress / /mnt/resize`.
Você pode sair da screen e voltar depois caso seja muito dado, para isso segue alguns comandos básicos para screen:

### Preparar o novo volume
1. será necessário instalar o `grub` no novo disco, para isso execute o comando `grub2-install --root-directory=/mnt/resize/ --force /dev/xvdf.`
2. Desmonte o `novo-volume` com o comando `umount /mnt/new-volume`.
3. Verifique as UUID dos discos para que possamos cloná-las `blkid`.
4. Com as UUID copiadas, vamos substitui-las com o comando `tune2fs -U UUID /dev/xvdf`.
5. Feito isso podemos sair e desligar a máquina e trocar os discos.
### Substituir o novo volume na instância
1. Pare a instância `resize-machine`.
2. Remova o disco `old-volume` e `new-volume`.
3. Conecte o `new-volume` no ponto de montagem que estava o antigo no nosso caso será o `/dev/sda1`.
4. Inicie a instância `resize-machine`.
Pronto, feito a troca do disco, basta iniciar a máquina novamente e validar todas as partições e serviços que operam no servidor. No próximo post vou abordar uma segunda forma para realizarmos esse procedimento, indicado para ambientes mais complexos e particionados.
<file_sep>---
image: /assets/img/AWS.png
title: AWS Certified Solutions Architect - Associate
description: >-
Amazon Web Services é a plataforma de nuvem mais abrangente e amplamente
adotada do mundo. A AWS oferece mais de 175 serviços completos para cloud
computing
date: '2020-04-10'
category: aws
background: '#FF9900'
tags:
- AWS
- CERTIFICACAO
categories:
- AWS
---
Em 2020 defini como meta pessoal correr atrás da minha primeira grande certificação, eu já cheguei a tirar algumas certificações voltadas a plataforma de hospedagem como o cPanel e Plesk, porém creio que nada se compara as certificações como LPI e as da AWS.
Escolher a Solutions Architect da Amazon não foi atoa, sei que existem outras plataformas como Google Cloud e Microsoft Azure, porém a Amazon foi uma das pioneiras e hoje possui uma busca maior por profissionais especializados nessa plataforma. A AWS possui um programa formal de certificação composto das seguintes certificações:

Estou tendo a oportunidade de trabalhar diretamente com a plataforma da Amazon e pelo fato da empresa em que trabalho ser Partner, comecei meus estudos através do curso disponibilizado pela Amazon chamado "AWS Technical Professional", esse curso rápido repassa de forma dinâmica os principais serviços disponibilizados pela empresa e as suas aplicabilidades. Isso ajudou bastante para compreender melhor e partir para um curso voltado a certificação em sí.
Estou seguindo o blueprint da disponibilizado pela página oficial da certificação e de forma paralela assistindo o curso da Udemy do [<NAME>](https://www.udemy.com/course/certificacao-amazon-aws-2019-solutions-architect/), além de consultar constantemente a documentação de cada serviço. Recebi também muitas indicações para o curso da *[Cloud Guru](https://acloud.guru/)* que também tem disponível na *[Udemy](https://www.udemy.com/aws-certified-solutions-architect-associate/)* então assim que finalizar o curso já partirei para esse, com o objetivo de ter pontos de vistas de diferentes profissionais.
Espero poder fazer a prova por volta do mês de Setembro/Outubro, vai depender do dólar, até lá tentarei compartilhar alguns pontos referente aos meus estudos, com o intuito de fixar melhor cada tópico e trazer de forma prática a proposta de cada serviço.
<file_sep>---
image: /assets/img/AWS.png
title: "Processo de criptografia de EBS "
description: Vários serviços da Amazon oferece o serviço de criptografia em
repouso e não é diferente com o EBS, utilizando o KMS, com isso todo snapshot
criados a partir de uma EBS criptografada também será criptografado.
date: 2021-11-12
category: aws
background: "#FF9900"
tags:
- aws
- ebs
- kms
- criptografia
- ec2
categories:
- aws
- ebs
- kms
- criptografia
- ec2
---
Quando você cria um volume do EBS criptografado e o anexa a um tipo de instância com suporte, os seguintes tipos de dados são criptografados:
* Dados em repouso dentro do volume
* Todos os dados que são movidos entre o volume e a instância
* Todos os snapshots criados a partir do volume
* Todos os volumes criados a partir desses snapshots
Antes de mais nada, habilite a criptografia padrão de volumes, novos volumes criados a partir de entao ja surgem com a criptografia por padrao.
#### 1. Acesse o Ec2 dashboard.
#### 2. Em **`Account Attributes`** selecione a opção **`EBS encryption`**.

#### 3. Clique em **`Manage`** e em seguida `enable`.

# Criptografar recursos não criptografados
Não é possível criptografar diretamente volumes ou snapshots não criptografados. No entanto, você pode criar volumes ou snapshots criptografados a partir de volumes ou snapshots não criptografados.
# Criptogrando volumes não criptografados
#### 1. Acesse o console e vá até a opção **`EC2 > Volumes`**
#### 2. Observe que existe uma coluna com o nome **Encryption** lá será possível analisar os volumes que não estão criptografados.

#### 3. Selecione o disco que será criptografado e em seguida clique com o botão direito e **Create snapshot**
> OBS: coloque uma tag com o nome do snapshot para facilitar a busca.


#### 4. Acesse agora o menu **`EC2 > Snapshots`** e busque pelo snapshot gerado.
#### 5. Selecione com botão direito e selecione a opção **`Create Volume`**.

#### 6. Nessa etapa as opções de criptografia vao ser preenchidas automaticamente, um ponto de atenção é escolher a **`Availability Zone`** identica ao do volume que irá ser substituido.

#### 7. Com o volume criado e disponível para uso, você precisa desligar a máquina Ec2.

#### 8. Acesse o menu **`EC2 > Volumes`** e filtre pelos volumes criado e utilizado pela maquina.

#### 9. Anote o "`Attachment information`" disponível nas informações do volume atachado na Ec2 para que possamos utilizar com o novo volume:

#### 10. Desatache o disco e atache o volume criptografado

#### 11. Ligue a Ec2.
# Considerações
Uma vez que o processo causa downtime no ambiente, é indicado que realize o mesmo fora do horário comercial e com Gmud aprovada.<file_sep>#!/bin/sh
# Last Update: July 26 2019
<< 'CHANGELOG'
1.0 - 10/07/2019 [ Author: <NAME> ]
* Initial release
* Função supas
* Aliasse principais
1.1 - 13/07 ~ 24/07 [ Author: <NAME> ]
* Adição de principais funções usando api do WHM e cPanel
* Ajustes das funções com validação de contas
* Correção das seguintes funções
* reseller_verify
* Criação das funções abaixo:
* changemail_password
* global_spambox
* autossl
1.2 - 25/07 ~ 29/07 [Author: <NAME>]
* Correção de condição de parada nas verificações com if
* Correção grep para grep -w em funções de verificação
* Adição do aliase spfxuxu para rotacionamento
* Adição de novas funções:
* maillocate_verify
* checkmx
* allowremotesmtp
* roundcubeplugin
* Ajuste das funções:
* mail_verify
* domain_verify
1.3 - 27/11 [Author: <NAME>]
* Correção no bug em retornos do grep -w nas funções de validação ( mail_verify, domain_verify ...)
1.4 - 27/01 [Author: <NAME>]
* Criação da função mailogin_history
CHANGELOG
# Função principal, listar todas as funções disponíveis
function supas (){
echo -e "\nAmbiente de Suporte :: Lista de Funcoes\n=======================================\n"
echo -e "-----------------Apache-----------------"
echo -e "apache_status\t\t->\tFullstatus do Apache"
echo -e "edit_http\t\t->\tAbre o arquivo pre_virtualhost_global.conf para edição"
echo -e "restrict_http\t\t->\tBloqueia o acesso web da conta cPanel"
echo -e "-----------------SPAM-----------------"
echo -e "disable_spamdel\t\t->\tDesabilitar Auto Delete do SpamAssassin de uma conta"
echo -e "enable_spamass\t\t->\tAtivar SpamAssassin para uma conta"
echo -e "conf_spamass\t\t->\tConfigurar score do SpamAssassin de uma conta"
echo -e "global_spambox\t\t->\tHabilitar Spam Box para todos do servidor"
echo -e "-----------------EMAIL-----------------"
echo -e "mailogin_history\t->\tRelatório de login das contas de e-mail de um domínio"
echo -e "mail_usage_report\t->\tRelatório de todas as contas de e-mail do servidor"
echo -e "cpusermail_usage\t->\tRelatório das contas de e-mail de uma conta cPanel"
echo -e "changemail_password\t->\tAlterar senha de conta para uma aleatória"
echo -e "nomail\t\t\t->\tDesabilitar envio de e-mail de uma conta cPanel"
echo -e "yesmail\t\t\t->\tHabilitar envio de e-mail de uma conta cPanel"
echo -e "delfrozen\t\t->\tRemover e-mails frozen da fila"
echo -e "deldonmail\t\t->\tRemover e-mails de todo domínio da fila"
echo -e "delusermail\t\t->\tRemover e-mails de uma conta da fila"
echo -e "sendmail\t\t->\tEnviar e-mail"
echo -e "mq\t\t\t->\tFila de e-mail para auditoria"
echo -e "checkmx\t\t\t->\tVerifica roteamento de e-mail e entradas MX do domínio"
echo -e "-----------------WHM-----------------"
echo -e "cpanel_session\t\t->\tAcesso cPanel sem senha"
echo -e "suspend_reseller\t->\tSuspender Reseller"
echo -e "unsuspend_reseller\t->\tRemover suspensão do Reseller"
echo -e "autossl\t\t\t->\tGerar certificado ssl para conta"
echo -e "servicestatus\t\t->\tVerificar status de serviços mais comuns"
echo -e "-----------------cPanel-----------------"
echo -e "restrict_mailacct\t->\tDesabilitar conta de e-mail Login/Envio/Recebimento"
echo -e "unrestrict_mailacct\t->\tRemover bloqueio de conta de e-mail Login/Envio/Recebimento"
echo -e "create_backup\t\t->\tGerar backup da conta em sua home"
echo -e "check_backup\t\t->\tVerificar backups disponíveis para a conta"
echo -e "-----------------Outros-----------------"
echo -e "phpinfo\t\t\t->\tAdiciona o phpinfo no diretório atual"
echo -e "\nEnviar sugestoes para <EMAIL>\n" ;}
supas;
alias ls="ls -al --color=always";export LESS="r";
#PRESCRIPTS
function domain_verify(){
verifydomain=$(grep -w $domain /etc/trueuserdomains | cut -d: -f1 | head -1)
if [ "$verifydomain" != "$domain" ]; then
echo -e "The domain \033[1;33m$domain\033[0m does not exist: \033[0;31m[ERROR]\033[0m"
kill -INT $$;
fi;
}
function mail_verify(){
mailuser=$(echo $user | cut -d@ -f1 | head -1)
if [[ ! -d "/home/$account/mail/$domain/$mailuser" ]]; then
echo -e "The mail account \033[1;33m$user\033[0m does not exist: \033[0;31m[ERROR]\033[0m"
kill -INT $$;
fi;
}
function acct_verify(){
verifyuser=$(grep -w $user /etc/trueuserdomains | cut -d: -f2 | head -1 | sed 's/ //g' )
if [ "$verifyuser" != "$user" ]; then
echo -e "The user \033[1;33m$user\033[0m does not exist: \033[0;31m[ERROR]\033[0m"
kill -INT $$;
fi;
}
function reseller_verify(){
verifyreseller=$(grep -w $user /etc/trueuserowners | cut -d: -f2 | head -1 | sed 's/ //g')
if [ "$verifyreseller" != "$user" ]; then
echo -e "The user \033[1;33m$user\033[0m are not a reseller: \033[0;31m[ERROR]\033[0m"
kill -INT $$;
fi;
}
function maillocate_verify(){
local=$(grep -w $domain /etc/localdomains | head -1)
if [ "$local" != "$domain" ]; then
echo -e "The domain \033[1;33m$domain\033[0m are configured as remote domain "
else
echo -e "The domain \033[1;33m$domain\033[0m are configured as local domain "
fi;
}
#Apache
function apache_status() {
/usr/local/apache/bin/apachectl fullstatus;}
function edit_http() {
vim /usr/local/apache/conf/includes/pre_virtualhost_global.conf; /scripts/restartsrv_httpd;
}
function restrict_http() {
SCRIPT_PATH="/scripts/restartsrv_httpd"
NOW=$(date +"%m-%d-%y")
user=${1}
acct_verify
ticket=${2}
echo -e "<Directory \"/home/$user/public_html\">\n AllowOverride none\n order deny,allow\n errordocument 403 \"Temporarily closed for maintenance.\n #\" ~$agent on $NOW Ticket: $ticket \n</Directory>\n\n" >> /usr/local/apache/conf/includes/pre_virtualhost_global.conf;
"$SCRIPT_PATH";}
function phpinfo() { usuario=$(pwd | cut -d\/ -f3);echo "<?php phpinfo(); ?>" >> phpinfo.php; chmod 644 phpinfo.php; chown $usuario: phpinfo.php;}
function permdatabase() {
echo "Database:"
read database;
echo "User:"
read user;
echo "Pass:"
read pass;
mysql -u root -e "GRANT ALL ON $database.* TO $user@'localhost' IDENTIFIED BY '$pass';"
echo "#finalizado# Teste com a senha informada!"
echo "mysql -u $user -p";}
#EXIM MAIL
function mq() { exim -bp | grep "<*>" | awk {'print $4'} | sort | uniq -c | sort -n ;}
function sendmail() {
origem=${1}
destino=${2}
echo TesteHD |exim -r $origem -v -odf $destino;
}
function delusermail() {
emailacct=${1}
exiqgrep -i -f $emailacct | xargs exim -Mrm;
}
function deldonmail() {
domain=${1}
exim -bpu | grep $domain | awk {'print $3'} | xargs exim -Mrm;
}
function delfrozen() {
exim -bpu | grep "<>" | awk '{print $3}' | xargs exim -Mrm;
}
#API CPANEL
#SSL
function autossl(){
user=${1}
acct_verify
SCRIPT_PATH="/usr/local/cpanel/bin/autossl_check"
"$SCRIPT_PATH" --user=$user;
}
#MAIL
function mail_usage_report() {
for i in `grep : /etc/trueuserowners | cut -d: -f1`; do echo "cPanelUser:$i" >> apilist ; uapi --user=$i Email list_pops_with_disk >> apilist; >> apilist; done ; sed 's/ //g' apilist > maillist && grep -E '^diskused:|^login:|^cPanelUser:' maillist; rm -rf apilist maillist ;}
function cpusermail_usage() {
user=${1}
acct_verify
uapi --user=$user Email list_pops_with_disk >> apilist; >> apilist; sed 's/ //g' apilist > maillist && grep -E '^diskused:|^login:' maillist; rm -rf apilist maillist;
}
function nomail() {
user=${1}
acct_verify
whmapi1 suspend_outgoing_email user=$user >>/dev/null
echo -e "The cPanel account \033[1;33m$user\033[0m have outgoing email suspended ";
}
function yesmail() {
user=${1}
acct_verify
whmapi1 unsuspend_outgoing_email user=$user >>/dev/null
echo -e "The cPanel account \033[1;33m$user\033[0m have outgoing email unsuspended ";
}
function restrict_mailacct(){
user=${1}
domain=$(echo $user | cut -d@ -f2)
domain_verify
account=$(grep $domain /etc/trueuserdomains | cut -d: -f2 | head -1 | sed 's/ //g')
mail_verify
uapi --user=$account Email suspend_login email=$user >> /dev/null
uapi --user=$account Email suspend_incoming email=$user >> /dev/null
uapi --user=$account Email suspend_outgoing email=$user >> /dev/null
echo -e "The mail account \033[1;33m$user\033[0m are suspended"
}
function unrestrict_mailacct(){
user=${1}
domain=$(echo $user | cut -d@ -f2)
domain_verify
account=$(grep $domain /etc/trueuserdomains | cut -d: -f2 | head -1| sed 's/ //g')
mail_verify
uapi --user=$account Email unsuspend_login email=$user >> /dev/null
uapi --user=$account Email unsuspend_incoming email=$user >> /dev/null
uapi --user=$account Email unsuspend_outgoing email=$user >> /dev/null
echo -e "The mail account \033[1;33m$user\033[0m are unsuspended"
}
function changemail_password(){
user=${1}
domain=$(echo $user | cut -d@ -f2)
domain_verify
account=$(grep $domain /etc/trueuserdomains | cut -d: -f2 | head -1 | sed 's/ //g')
mail_verify
password=$(openssl rand 10 -base64)
uapi --user=$account Email passwd_pop email=$user password=$password domain=$domain >> /dev/null
echo -e "The mail account \033[1;33m$user\033[0m have a new password \033[1;33m$password\033[0m";
}
function checkmx(){
domain=${1}
maillocate_verify
echo -e "\nDNS Mx entries from $domain:"
whmapi1 listmxs domain=$domain | grep exchange:
}
#SPAM
function disable_spamdel() {
user=${1}
acct_verify
uapi --user=$user Email disable_spam_autodelete >> /dev/null
echo -e "Auto Delete do SpamAssassin da conta $user desativada";
}
function enable_spamass() {
user=${1}
acct_verify
uapi --user=$user Email enable_spam_assassin >> /dev/null
echo -e "SpamAssassin da conta $user ativado";
}
function conf_spamass() {
user=${1}
acct_verify
echo "Score:"
read score;
uapi --user=$user SpamAssassin update_user_preference preference=required_score value-0=$score >> /dev/null
echo -e "Atualizado o escore do SpamAssassin da conta $user para $score";
}
function global_spambox(){
whmapi1 set_tweaksetting key=skipspambox value=0 ; for i in `grep : /etc/trueuserowners | cut -d: -f1`; do uapi --user=$i Email enable_spam_box; done
}
#BACKUP
function create_backup() {
user=${1}
acct_verify
uapi --user=$user Backup fullbackup_to_homedir >> /dev/null
echo -e "Backup iniciado com sucesso, verifique a home da conta $user em breve";
}
function check_backup() {
user=${1}
acct_verify
uapi --user=$user Backup list_backups | awk 'NR==6, NR==10 {print NR,$0}' | cut -d':' -f3 | awk '{print $3}';
}
#WHM
function cpanel_session() {
whmapi1 create_user_session user=root service=whostmgrd locale=en | awk 'NR==8 {print NR,$0}' | cut -d':' -f2- ;
}
function suspend_reseller() {
user=${1}
reseller_verify
echo "Motivo:"
read reason;
whmapi1 suspendreseller user=$user reason=$reason >> /dev/null
echo -e "A revenda do usuário \033[1;33m$user\033[0m foi suspensa pelo seguinte motivo: \033[1;33m$reason\033[0m ";
}
function unsuspend_reseller() {
user=${1};
reseller_verify
whmapi1 unsuspendreseller user=$user >> /dev/null
echo -e "A suspensão da revenda do usuário \033[1;33m$user\033[0m foi removida";
}
function servicestatus(){
services=(tailwatchd httpd mysql exim sshd ftpd crond imap pop)
for i in "${services[@]}"; do
user=$(whmapi1 servicestatus service=$i | grep running | sed 's/ //g' | cut -d: -f2)
if [ "$user" != "0" ]; then
echo -e "The \033[1;33m$i\033[0m service are running. \033[0;32m[OK]\033[0m"
else
echo -e "The \033[1;33m$i\033[0m service is down. \033[0;31m[ERROR]\033[0m"
fi; done;
}
function mailogin_history(){
domain=${1}
domain_verify
user=$(grep $domain /etc/trueuserdomains | cut -d: -f2 | head -1| sed 's/ //g')
ll /home/$user/mail/$domain/ | awk '{print $9}' | sed '/^$/d;s/$/@'$domain'/' > /root/list
for i in `cat /root/list`; do LAST_LOG=$(grep $i /var/log/maillog | egrep "Login: user=" | tail -1 | cut -d " " -f 1-3); echo -e "útimo acesso da conta: $i foi em: $LAST_LOG" >> /home/$user/last_log; done; sed -E -i '/\.+@/d' /home/$user/last_log
chown $user: /home/$user/last_log
rm -rvf /root/list
echo -e "The mail login history for domain \033[1;33m$domain\033[0m has finished, see /home/$user/last_log";
}
<file_sep>---
image: /assets/img/Zabbix.png
title: Configuração Zabbix Server com Grafana
description: >-
Aprenda como instalar e configurar um servidor Zabbix e realizar a integração
com o Grafana
date: '2020-03-06'
category: linux
background: '#EE0000'
tags:
- Zabbix
- Grafana
- Monitoramento
- Linux
- CentOs
---
O Zabbix é uma excelente ferramenta de monitoramento que coleta dados de servidores, máquinas virtuais e outros tipos de dispositivos de rede, alertando sempre que um problema for identificado. Possui também notificações ricas em recursos sobre problemas emergentes, apesar de ser uma ferramenta poderosa quando se fala em software de monitoramento de ativos de rede, o mesmo ainda carece de dashboards mais amigáveis e com isso temos o Grafana, que é um plugin que consome a API do Zabbix e realiza a criação de diversos dashboards e gráficos de forma muito mais simplificada.
Nesse artigo iremos configurar e instalar o Zabbix server em um servidor CentOs7 e posteriormente será feito a sua integração com o Grafana, no qual realizaremos algumas configurações com as informações monitoradas a partir do Zabbix server.
Com uma instalação limpa do CentOs iremos seguir primeiro desabilitando o firewalld e o selinux porém sinta-se livre para caso deseje trabalhar com esses serviços ativos.
```bash
systemctl stop firewalld
systemctl disable firewalld
```
Para desativar o selinux basta acessar o arquivo de configuração e mudar para disabled, lembrando que para mudança no selinux é necessário um reinicialização para aplicar as modificações:
```bash
vi /etc/selinux/config
SELINUX=disabled
reboot
```
Após feito, vamos adicionar o repositório do Zabbix e fazer a instalação dos pacotes:
```bash
rpm -ivh https://repo.zabbix.com/zabbix/4.5/rhel/7/x86_64/zabbix-release-4.5-2.el7.noarch.rpm
```
O processo de instalação do Zabbix via repositório é bem simples, basta executar o comando abaixo:
```bash
yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent
```
### Instalação MariaDB
Será feito a instalação do MariaDB como serviço de banco de dados, pois é considerado o SGDB mais utilizado pelo Zabbix e suas releases de atualização vem com bastantes novidades.
```bash
vi /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
```
Após ter adicionado o repositório do MariaDB no /etc/yum.repos.d/MariaDB.repo basta realizar um update no yum e seguir com as instalações:
```bash
yum update -y
yum install -y MariaDB-server MariaDB-client MariaDB-devel
```
Após a instalação execute os comandos para habilitar e iniciar o serviço:
```bash
sudo systemctl enable mariadb
sudo systemctl start mariadb
```
Em seguida execute o comando mysql_secure_installation para fazer ajustes de segurança:
```bash
mysql_secure_installation
Enter current password for root (enter for none): <ENTER>
Set root password? [Y/n] y
New password: < <PASSWORD> UMA SENHA >
Re-enter new password: <<PASSWORD>>
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
```
FEito a configuração, crie a base de dados e o usuário para o Zabbix e em seguida exportaremos as tabelas necessária para o funcionamento do software:
```bash
$ mysql -p -uroot
MariaDB>create database zabbix character set utf8 collate utf8_bin;
MariaDB>grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
MariaDB>flush privileges;
MariaDB>exit
Bye
```
Importe os schemas e os dados para funcionamento do Zabbix Server, na versão 4.5.2 o zabbix-server-mysql vem na versão 5.0:
```bash
zcat /usr/share/doc/zabbix-server-mysql-5.0.0/create.sql.gz | mysql -uzabbix -p zabbix
```
Feito a importação, basta seguir com a configuração no arquivo de configuração do Zabbix ajustando o banco de dados e suas credencias de acesso:
```bash
vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=<<PASSWORD>>
```
Logo em seguida habilite e inicie o serviço:
```bash
sudo systemctl enable zabbix-server
sudo systemctl start zabbix-server
```
### Instalação Nginx
Agora será feito a instalação do Nginx e do php-fpm, mas antes é necessário instalar o epel-release:
```bash
yum install -y epel-release
yum install -y nginx php-fpm php-common
```
Com o nginx instalado, basta seguir com a configuração do Virtual Host, vou deixar um [link direto](https://gist.githubusercontent.com/thiagoalexandria/593a285acafd4e7e5c7441cbc28c0529/raw/caed91256c59bce2eee4ba807faea04c7afb188e/Nginx-zabbix.conf) para um pré configurado e a partir dele podem fazer as suas personalizações, o arquivo deve ser criado no path abaixo
```bash
vi /etc/nginx/conf.d/zabbix.conf
```
Configure o pool para php-fpm da seguinte forma:
```bash
mkdir /var/lib/php/zabbix-php-fpm
chmod 770 /var/lib/php/zabbix-php-fpm/
chown root:nginx /var/lib/php/zabbix-php-fpm/
chown nginx:nginx /etc/zabbix/web/
```
Crie o arquivo zabbix.conf no /etc/php-fpm.d/ tendo como referencia o seguinte [arquivo](https://gist.githubusercontent.com/thiagoalexandria/ddbb3feda4d7754d5dbed3bb1da78f4b/raw/2b742235aba84aab4afea1b4915e9184550cbb06/PHP-FPM.zabbix.conf), feito a configuração, basta habilitar e iniciar os serviços:
```bash
systemctl enable php-fpm
systemctl enable nginx
systemctl start php-fpm
systemctl start nginx
```
Após iniciar os serviços, basta seguir com a finalização da configuração do Zabbix através do Browser em http://<<server_ou_ip>/zabbix, o processo seguinte é bastante intuitivo, basta completar com as informações de banco de dados e portas.
### Instalação e integração com Grafana
Nesse passo, será feito a instalação do Grafana em outro servidor, também CentOs 7, e esse será alimentado pela as informações do servidor Zabbix. Nesse cenário o mesmo também pode ser feito através de outro contêiner, o objetivo é apenas evitar a concentração de todos os serviços em um único servidor.
Para que possamos seguir com a instalação do Grafana em sua última versão, iremos adicionar o seu repositório no yum.repo:
```bash
vi /etc/yum.repos.d/grafana.repo
[grafana]
name=grafana
baseurl=https://packages.grafana.com/enterprise/rpm
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packages.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
```
Feito isso, basta seguir com a instalação utilizando o yum:
```bash
yum install -y grafana
```
Realizaremos também a instalação do Nginx, basta seguir os mesmos passos feitos para o Zabbix, feito a instalação siga com a criação do Virtual Host, segue o [arquivo modelo](https://gist.githubusercontent.com/thiagoalexandria/c0d2debc189f4ab1d4bee75e9c4390cc/raw/84eb3483eca60ddc2f4cd3cddf1de6cdd38f7c30/Nginx-grafana.conf) para consulta:
```bash
vi /etc/nginx/conf.d/grafana.conf
```
Agora será feito a instalação do plugin do Zabbix para o Grafana, utilizaremos o seguinte comando para isso:
```bash
grafana-cli plugins install alexanderzobnin-zabbix-app
systemctl restart grafana-server
```
Reiniciado o nginx, você deve ativar o plug-in, na interface da web, vá para a configuração e o plug-in. Basta seguir com o acesso através http://<<server_ou_ip>/grafana as credenciais padrões para acesso são :
```
user: admin
pass: <PASSWORD>
```
Em "Configuration > Plugins" busque por Zabbix e clique em "Enable". Agora será possível adicionar uma nova data source. Clique na logo do Grafana e navegue até Data sources. Em seguida, clique no botão Add data source. Você verá a página de configuração da fonte de dados:

Configure da seguinte forma:
```
Digite um nome para esta data source no campo Name.
Marque a opção Padrão para que essa data source seja pré-selecionada nos painéis que você criar.
Selecione Zabbix na lista Type.
Preencha o campo URL com o caminho completo para a API do Zabbix, que será http: //your_zabbix_server_ip_address/zabbix/api_jsonrpc.php.
Preencha os campos Username e Password com o nome de usuário e a senha do Z<PASSWORD>.
Habilite a opção Trends; aumentará o desempenho da Grafana.
```
Pronto, o nosso servidor Grafana já encontra-se integrado com o nosso servidor Zabbix e dessa forma basta seguir com a criação dos dashboards de acordo com a necessidade dos itens a serem monitorados.
Fontes:
https://www.zabbix.com/documentation/5.0/manual/installation/install_from_packages/frontend_on_rhel7
https://www.zabbix.com/documentation/5.0/manual/appendix/install/nginx
https://grafana.com/docs/grafana/latest/installation/rpm/
https://grafana.com/docs/grafana/latest/installation/behind_proxy/
<file_sep>---
image: /assets/img/HashiCorp-Terraform-logo.png
title: Launch template personalizado para EKS com terraform
description: Uma das problemáticas de criar um cluster EKS sem muita
personalização é que ele acaba gerenciando bastante recurso limitando a sua
utilização.
date: 2021-10-20
category: devops
background: "#05A6F0"
tags:
- devops
- aws
- eks
- kubernetes
- terraform
categories:
- devops
- aws
- eks
- kubernetes
- terraform
---
Um dos problemas de quando criamos um cluster sem especificar um launch template é que ele vai acabar criando as máquinas com o Amazon Linux 2 porém essas que são utilizadas pelo EKS são as únicas que não possuem o SSM instalado por padrão.
A problemática aparece quando precisamos acessar os nodes, para qualquer tipo de ação ou análise a nível de host. Uma vez que os endereços variam sempre que o autoscale group cria um novo nó para o node group, acaba inviabilizando o acesso por ssh + chave privada quando pensamos em praticidade.
Pensando nisso, partimos para a abordagem de criarmos um launch template que realize a instalação do SSM e quando precisarmos realizar uma nova personalização teríamos liberdade para gerenciá-la.
Entao vamos la, nessa publicação não vamos abordar a configuração do cluster em geral, apenas a configuração de um módulo para launch template que será consumido durante o provisionamento do seu node group.
### Estrutura:
A estrutura de arquivos que utilizaremos, será a seguinte:
```
├── launch.tf
├── output.tf
├── userdata.tpl
└── variables.tf
```
* `launch.tf` = Arquivo principal que irá conter as informações do nosso launch template.
* `output.tf` = Arquivo que realizará o output das informações importantes para serem consumidas em outros módulos.
* `userdata.tpl` = Template que compõem o userdata da nossa instância.
* `variables.tf` = Arquivo de variáveis do módulo.
### Inputs
Nesse modulo precisaremos dos seguintes inputs:
* `Instance_type` = Definição da instância que será criada pelo launch template
* `kubernetes_version` = Versão do kubernetes utilizada pelo cluster
* `cluster_certificate` = Certificado CA do cluster EKS
* `cluster_endpoint` = API endpoint do cluster EKS
* `sg` = Lista de security groups adicional
* `cluster_security_group` = security group do cluster
* `cluster_name` = Nome do cluster
### Configuração
No arquivo launch.tf vamos precisar primeiro obter o ID da `AMI` que será utilizado pelo kubernetes e para isso vamos criar um `data source` buscando e utilizaremos a versão do kubernetes como parâmetro:
```
data "aws_ssm_parameter" "eks_ami" {
name = "/aws/service/eks/optimized-ami/${var.kubernetes_version}/amazon-linux-2/recommended/image_id"
}
```
Feito isso, temos o ID da `AMI` do amazon linux referente a versão do nosso Kubernetes. Com essa informação vamos criar o nosso recurso de launch template:
```
resource "aws_launch_template" "eks_launch_template" {
image_id = data.aws_ssm_parameter.eks_ami.value
instance_type = var.instance_type
name = "eks_launch_template-${var.cluster_name}"
update_default_version = true
vpc_security_group_ids = tolist([var.sg, var.cluster_security_group])
user_data = base64encode(templatefile("${path.module}/userdata.tpl", { CLUSTER_NAME = var.cluster_name, B64_CLUSTER_CA = var.cluster_certificate, API_SERVER_URL = var.cluster_endpoint }))
}
```
Observe que o arquivo `userdata` começa a valer agora, uma vez que vamos utilizá-lo para definir de fato o parâmetro user_data do launch template, nele vamos personalizar com a configuração para cadastrá-lo no cluster e instalar o SSM:
```
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="==MYBOUNDARY=="
--==MYBOUNDARY==
Content-Type: text/x-shellscript; charset="us-ascii"
#!/bin/bash
set -ex
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
yum install -y amazon-ssm-agent
systemctl enable amazon-ssm-agent && systemctl start amazon-ssm-agent
/etc/eks/bootstrap.sh ${CLUSTER_NAME} --b64-cluster-ca ${B64_CLUSTER_CA} --apiserver-endpoint ${API_SERVER_URL}
--==MYBOUNDARY==--\
```
Bom, feito isso praticamente o nosso launch template encontra-se pronto e basta que os devidos outputs sejam configurados para que ele possa ser parametrizado dentro da criação do seu node group, as informações necessárias são as seguintes.
```
output "launch_template_name" {
value = aws_launch_template.eks_launch_template.name
}
output "launch_template_version" {
value = aws_launch_template.eks_launch_template.latest_version
}
```
É isso pessoal, espero que essa publicação seja útil e que tenham gostado!<file_sep>---
image: /assets/img/Hyperv.png
title: 'Habilitando Hyper-V Windows 10 Pro '
description: >-
Nesse artigo será demonstrado como habilitar o Hyper-V em máquinas que possuem
o Windows 10 Pro como sistema operacional e uma breve explicação sobre a
administração utilizando o PowerShell
date: '2020-03-07'
category: win
background: '#00A82D'
tags:
- Windows
- Hyper-V
- PowerShell
- Virtualizacao
categories:
- Windows
- Hyper-V
- PowerShell
- Virtualizacao
---
O Hyper-V é uma tecnologia de virtualização baseada em Hipervisor nativo proprietário da Microsoft e encontra-se presente em alguns de seus sistemas operacionais em forma de feature, podendo também ser encontrado como Hyper-V Os. O Hyper-V encontra-se disponível no Windows 8 e 10 Pro assim como no Windows Server.
Existem algumas limitações quanto a utilização do Hyper-V em versões Server do Windows porém nesse artigo iremos abordar apenas a sua instalação no Windows 10 pro. Antes de seguir com o procedimento, é necessário que certifique-se sobre alguns pontos cruciais para o funcionamento do Hyper-V, são eles:
* Windows 10 Enterprise, pro ou Education
* Processador de 64 bits com SLAT (Conversão de Endereços de Segundo Nível).
* Suporte de CPU para extensão do modo de monitor da VM (VT-c em CPUs Intel).
* Mínimo de 4 GB de memória.
Habilite o Hyper-V utilizando o PowerShell, dessa forma execute o mesmo com permissão de administração, após feito, basta executar o seguinte comando:
```powershell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
```
Quando a instalação for concluída, será solicitado a reinicialização do computador. Após feito, basta pesquisar por "Gerenciador do Hyper-V", ao clicar teremos uma imagem semelhante a essa:

Através da interface é possível realizar todo o procedimento de gerenciamento e configuração do Hyper-V, a criação de máquinas virtuais ocorre através da opção "Ação" no menu de opções superior além de também ser possível a criação utilizando PowerShell quando necessário a automatização de processos. Irei abordar alguns pontos que julgo necessário e no final seguiremos com a criação de uma máquina virtual utilizando a linha de comando faltando apenas a instalação do sistema operacional.
### Configurações do Hyper-V
O Hyper-V possui algumas configurações padrões, como por exemplo, o local cujo será armazenado os discos virtais e das máquinas virtuais. Acesse a opção "Ação > Configurações do Hyper-V" iremos mudar o local padrão para um disco a parte ao disco principal, nesse caso utilizaremos os seguintes locais para Discos Rígidos Virtuais e Máquinas Virtuais respectivamente:
```
D:\Hyper V\Virtual Hard Disks\
D:\Hyper V\Virtual Machines
```
Também é importante que realizemos a criação de um comutador virtual externo, o comutador é uma interface de rede e o seu tipo determina o que a máquina terá de acesso. Existem três tipos de comutadores, Externo, Interno e Particular:
```
Externo: Comutador que se associa ao adaptador de rede físico de forma que as máquinas virtuais possam acessar uma rede física
Interno: Comutador virtual interno que não fornece conectividade para a conexão de rede física.
Particular: Comutador virtual que só pode ser usado pelas máquinas virtuais.
```
Sabendo a diferença, seguiremos com a criação do comutador externo através do PowerShell, utilizando o seguinte comando:
```powershell
New-VMSwitch -Name Externo -SwitchType external
```
Com a criação do comutador externo, já poderemos criar máquinas virtuais com acesso a rede física e consequentemente, com acesso a internet. Seguiremos com a criação de uma máquina virtual Teste, para isso basta seguir com a criação utilizando o modulo "New-VM" do Hyper-V:
```powershell
New-VM -Name Teste -Generation 2 -MemoryStartupBytes 1GB -NewVHDPath 'D:\Hyper V\Teste\Teste.vhdx' -NewVHDSizeBytes 100GB
```
Em seguida, associaremos o comutador externo a nossa nova máquina:
```powershell
Connect-VMNetworkAdapter -VMName Teste -SwitchName Externo
```
Basta agora configurar a ISO que será utilizada utilizando o comando Add-VMDvdDrive especificando o path com a iso, da seguinte forma:
```powershell
Add-VMDvdDrive -VMName Teste -Path D:\Iso\Windows.iso
```
Com todos os pontos configurados, basta iniciar a máquina virtual e seguir com a instalação do sistema operacional, utilize os seguinte comandos para iniciar a máquina virtual e em seguida acessa-la:
```powershell
Start-VM -Name Teste
.\vmconnect.exe HOSTNAME Teste
```
Espero que gostem da perspectiva de configuração e gerenciamento utilizando os cmdlet powershell para gerenciamento do Hyper-V.
Até a próxima!
<file_sep>---
image: /assets/img/HashiCorp-Terraform-logo.png
title: "Terraform: Criando módulos"
description: A possibilidade de utilizar módulos em nosso código Terraform faz
com que possamos ter a reutilização de código, evitando a repetições bem como
nos dando flexibilidade para criarmos dezenas de recursos similares porém com
suas respectivas particularidades utilizando-se da mesma base de código.
date: 2021-01-28
category: devops
background: "#05A6F0"
tags:
- Devops
- Terraform
categories:
- Devops
- Terraform
---
Daremos continuidade aos estudos de Terraform, configurando o nosso primeiro módulo, podendo assim reutilizar em vários momentos. Teremos como base o mesmo código que escrevemos no nosso ultimo artigo sobre Terraform: Variáveis de Outputs, portanto se você não o leu, recomendo fortemente que o faça [clicando aqui](https://thiagoalexandria.com.br/terraform-variaveis-e-outputs/).
Um módulo é um contêiner para vários recursos usados juntos. Os módulos podem ser usados para criar abstrações leves, para que você possa descrever sua infraestrutura em termos de arquitetura, em vez de diretamente em termos de objetos físicos.
Os arquivos `.tf` em seu diretório de trabalho formam juntos o módulo raiz. Esse módulo pode chamar outros módulos e conectá-los, passando os valores de saída (outputs) de um para os valores de entrada (inputs) de outro.
## Estrutura de um Módulo
Módulos reutilizáveis são definidos usando todos os mesmos conceitos de linguagem de configuração que usamos nos módulos raiz. Mais comumente, os módulos usam:
* Input aceitam valores do módulo chamado.
* Output para retornar resultados, que ele pode usar para preencher argumentos em outro lugar.
* Resources para definir um ou mais objetos de infraestrutura que o módulo gerenciará.
Para definir um módulo, basta criar um novo diretório para ele e coloque um ou mais arquivos `.tf` dentro, da mesma forma que faria em um `root module`. O Terraform pode carregar módulos de forma local ou de repositórios remotos. Se um módulo for reutilizado por várias configurações, você pode colocá-lo em seu próprio repositório de controle de versão.
## Criando nosso próprio Módulo
Após entender como funciona e qual a estrutura de um módulo, iremos configurar o nosso [projeto anterior](https://thiagoalexandria.com.br/terraform-variaveis-e-outputs/) em um módulo. Dessa forma iremos criar um diretório chamado "modules" dentro do nosso projeto e iremos criar os seguintes arquivos:
```
├── modules
| └─── Ec2
│ ├── main.tf
│ └── variables.tf
└── main.tf
```
Para construir o nosso módulo, precisamos ajusta-lo para trabalhar de forma genérica, então repassaremos todos os parâmetros em forma de variável. O nosso `Ec2/main.tf` ficará da seguinte forma:
```
resource "aws_instance" "Teste" {
ami = var.inst_ami
instance_type = var.inst_type
key_name = var.inst_key
tags = var.tags
}
```
O nosso arquivo `variables.tf` terá a declaração das variáveis porém sem nenhuma configuração pré ajustada:
```
variable "inst_ami" {
type = "string"
}
variable "inst_type" {
type = "string"
}
variable "inst_key" {
type = "string"
}
variable "tags" {
type = "map"
}
```
Feito isso, já temos o nosso módulo em branco para receber as variáveis como input através do carregamento do módulo. Nosso arquivo `main.tf` na raiz do projeto deverá carregar o módulo e repassar as variáveis:
```
provider "aws" {
region = "us-east-1"
shared_credentials_file = "/home/thiago/.aws/credentials"
profile = "default"
}
module "server" {
source = "./modules/Ec2"
inst_ami = "ami-01d025118d8e760db"
inst_type = "t2.micro"
inst_key = "Thiago"
tags = {"Name" = "lab-terraform-tst", "Ambiente" = "Desenvolvimento"}
}
```
Dessa forma, iremos carregar o módulo Ec2 e repassaremos os valores das variáveis que o módulo espera receber, com isso conseguimos reutilizar a mesma estrutura e chamar o módulo várias vezes para aplicações diferentes, por exemplo, subir duas máquinas com configurações diferentes:
```
provider "aws" {
region = "us-east-1"
shared_credentials_file = "/home/thiago/.aws/credentials"
profile = "default"
}
module "server" {
source = "./modules/Ec2"
inst_ami = "ami-01d025118d8e760db"
inst_type = "t2.micro"
inst_key = "Thiago"
tags = {"Name" = "lab-terraform-tst", "Ambiente" = "Desenvolvimento"}
}
module "server2" {
source = "./modules/Ec2"
inst_ami = "ami-u40jymjdk5040h8f"
inst_type = "t2.2xlarge"
inst_key = "Thiago2"
tags = {"Name" = "lab-terraform-prd", "Ambiente" = "Produção"}
}
```
Bom, esse foi um pouco de como criar e trabalhar com módulos em projetos com Terraform, espero que tenham curtido, em breve falaremos sobre gerenciamento de versões e backends valeu!<file_sep>---
image: /assets/img/bash.png
title: Edicao basica de arquivos vi e vim
description: vi é um editor de textos, padrão nos sistemas Unix, criado na
década de 70. Vim é uma versao melhorada do vi
date: 2021-02-25
category: linux
background: "#EE0000"
tags:
- Linux
categories:
- Linux
---
Estranhamos bastante o fato de usarmos o terminal como editor de textos. Parece inútil e lento para editar textos, uma vez que não podemos usar o mouse.
É aí que a gente se engana. Não percebemos, mas, para editar texto, o mouse mais atrapalha que ajuda, pois temos que constantemente tirar as mãos do teclado e leva-las até o mouse e vice-versa.
Sabendo que o vi é um editor de texto, vamos aprender os principais comandos, e alguns atalhos que são bastante úteis no dia a dia.
### Edição básica
Para editar um arquivo utilizando o vim, basta utilizar o comando da seguinte forma `vim /path/arquivo.txt`, dessa forma você será direcionado para uma tema semelhante a essa:

Existem algumas formas de começarmos a editar um arquivo com o `vim`:
* `i` Inicia o modo de inserção
* `a` Inicia o modo de inserção com um append para o próximo caractere
* `A` Inicia o modo de inserção com um append no fim da linha
* `o` Inicia o modo de inserção com uma nova linha
* `u` Recupera a última alteração
* `U` Recupera a linha até antes de todas as edições serem feitas nela
Assim como podemos editar, temos alguns comandos para deletar:
* `dd` Deleta toda a linha
* `dnd` Deleta uma quantidade de linhas, onde `n` é o numero de linhas que deseja remover
* `D` Remove o conteúdo de uma linha
Feito a a edição do arquivo, temos que salvar e se nesessário sair do arquivo, para isso temos os seguintes comandos, lembre-se que precisamos apertar a tecla `esc` para sair do modo de edição e `:` para inserirmos alguns comandos:
* `w` Salva o arquivo porém não saimos do arquivo
* `wq` Salvar e sair do arquivo
* `ZZ` Outra forma de sair e salvar o arquivo
* `q!` Utilizado para sair sem salvar, igorando as edições
### Navegação
Por se tratar de um editor de texto utilizado em terminais, temos alguns comandos para facilitar a nossa navegação dentro do arquivo, assim como para realizar buscas:
* `gg` Vai para o inicio do arquivo
* `G` Vai para o final do arquivo
* `23G` vai para a 23ª linha
* `Ctrl+f | Ctrl+b` Page up e Page Down
* `Ctrl+e | Ctrl+y` Scroll up e Scroll down
* `/` Realizar pesquisas
* `e` Coloca o cursor no fim da palavra
* `w` Coloca o cursor na próxima palavra
* `b` Coloca o cursos na palavra anterior
### Copiar e colar
Assim como nos editores normais, temos a funcionalidade de copiar e colar, porém não é feito com ctrl+c e v, para isso é utilizado o comando `y`de yanke e `p`de put
* `y$` Copia tudo ate o fim da linha
* `2yy` Copia o atual e as duas seguintes linhas
* `p` Cola o conteudo copiado
O vim tem alguns outros comandos que podem ser imcoporados, como a utilização de regex, repetições e replaces, dessa forma vou deixar uma imagem logo abaixo que é uma tabela periodica, contendo várias informações sobre os comandos e sua finalidade:

Bom, espero que tenham curtido, pretendo trazer mais conteúdo focados em serviços e sobre o meu dia a dia como devops dessa forma o vim encontra-se presente em todas as nossas tarefas falando em manuseio e edição de arquivos.
Até a próxima!<file_sep>---
image: /assets/img/samba.png
title: Criação e administração de um servidor Samba!
description: Aprenda a criar e configurar um servidor com Samba.
date: '2020-01-07 09:50:00'
category: linux
background: '#EE0000'
tags:
- samba
---
Nesse tutorial estarei explicando como configurar o Samba em um servidor com CentOS 7, exemplificarei o compartilhamento público e seguro. O Samba é um software livre gratuito que provem o compartilhamento de arquivos e impressoras de forma semelhante ao windows.
Primeiramente será demonstrado como prosseguir com a instalação do Samba com compartilhamento público. Para instalar o serviço do Samba, rode:
```bash
yum install -y samba samba-client samba-common
```
Iremos utilizar a versão disponibilizada pelos repositórios do CentOS, sinta-se livre para utilizar a versão desejada.
Para prosseguir com a configuração do Samba, basta seguir para o seu arquivo de configuração /etc/samba/smb.conf. É importante que guarde uma cópia do arquivo original para utilização futuras, para isso basta seguir com a cópia:
```bash
cp /etc/samba/smb.conf /etc/samba/smb.conf.orig
```
Para iniciar com a configuração do arquivo de forma limpa podemos prosseguir com limpeza do arquivo da seguinte forma:
```bash
cat /dev/null >> /etc/samba/smb.conf
```
Após a limpeza, estaremos iniciando as configurações do arquivo, antes disso estarei informando alguns detalhes quanto as tags que podem ser utilizadas, são elas:
\[global]
Define as configurações que afetam o servidor samba de forma global, como o próprio nome já sugere, fazendo efeito em todos os compartilhamentos existentes na máquina. Por exemplo, o grupo de trabalho, nome do servidor, restrições de acesso por nome.
\[homes]
Especifica opções de acesso a diretórios home de usuários, o diretório home é disponibilizado somente para seu dono, após se autenticar no sistema.
\[printers]
Define opções gerais para controle das impressoras do sistema. Este compartilhamento mapeia os nomes de todas as impressoras encontradas no /etc/printcap. Configurações especiais podem ser feitas separadamente.
Então, seguiremos, inicialmente, com a configuração do smb.conf, para iniciar iremos prosseguir com a criação do \[global] da seguinte maneira:
```bash
[global]
# nome da máquina na rede
netbios name = SRV_ARQ
# nome do grupo de trabalho que a máquina pertencerá
workgroup = WORKGROUP
# String que será mostrada junto com a descrição do servidor
server string = Servidor de arquivos com samba
# nível de segurança user somente aceita usuários autenticados após o envio
# de login/senha
security = user
# Conta que será mapeada para o usuário guest
guest account = nobody
```
Com o global devidamente configurado, partiremos para configuração da pasta home dos usuários que irão se conectar ao servidor, para isso configuraremos a tag \[homes]:
```bash
# Mapeia o diretório home do usuário autenticado.
[homes]
comment = Diretório do Usuário
# Padrão para criação de arquivos no compartilhamento
create mask = 0750
# Padrão para a criação de diretórios no compartilhamento
directory mask = 0750
# Define se o compartilhamento será ou não exibido na procura de rede
browseable = No
```
Para a criação do compartilhamento publico, seguiremos com a seguinte sintaxe:
```bash
[Publico]
comment = Publico
# Caminho da pasta no servidor
path = /samba/Publico
# Permite a conexão sem necessidade de autenticação
public = yes
# Permite modificações
writable = yes
# Define se o compartilhamento será ou não exibido na procura de rede
browsable =yes
```
Com o arquivo devidamente configurado, precisamos prosseguir com a criação da pasta que será utilizada para armazenamento dos arquivos públicos, note que no path escolhi o caminho /samba/Publico, então iremos criar esse caminho e posteriormente o compartilharemos de fato, utilizando os seguinte comandos:
```bash
mkdir -p /samba/Publico
chcon -t samba_share_t /samba/Publico
```
Desta forma o compartilhamento publico já encontra-se funcional, em um ambiente de produção se fará necessário a liberação das portas que o samba utiliza para utilização do serviço, em um ambiente CentOS7 por padrão é utilizado o firewalld, então para prosseguir com a liberação, basta seguir com os comandos:
```bash
firewall-cmd --permanent --zone=public --add-service=samba
firewall-cmd --reload
```
Caso esteja utilizando diretamente no iptables, basta prosseguir com a liberação das portas UDP 137-138 e TCP 139, 445, note que liberei apenas o trafego gerado na minha interface ens33, que é a interface para minha rede interna, mude de acordo com a sua necessidade.
```bash
iptables -A INPUT -i ens33 -p udp --dport 137:138 -j ACCEPT
iptables -A INPUT -i ens33 -p tcp --dport 139 -j ACCEPT
iptables -A INPUT -i ens33 -p tcp --dport 445 -j ACCEPT
service iptables save
```
Com todas as configurações realizadas, vamos iniciar o serviço e incluir para inicialização do sistema, para isso basta seguir com os comandos abaixo:
```bash
systemctl enable smb.service
systemctl enable nmb.service
systemctl restart smb.service
systemctl restart nmb.service
```
Agora, através do seu computador, basta acessar a máquina através da descoberta de rede do seu computador, note que o compartilhamento já está ativo:

----

----
Agora com o compartilhamento público realizado, seguiremos com a realização do compartilhamento privado, seguiremos com a criação da entrada no arquivo de configuração do samba, seguindo o padrão abaixo:
```bash
[Privado]
comment = Compartilhamento Privado
path = /samba/Privado
# Usuário ou grupos válidos
valid users = @privado
guest ok = no
read only = no
writable = yes
browsable = yes
create mask = 0750
directory mask = 0750
```
Prosseguiremos com a criação de compartilhamento da pasta, da mesma forma que realizado para pasta publica:
```bash
mkdir -p /samba/Privado
chcon -t samba_share_t /samba/Privado
```
Com a pasta criada, alteraremos a permissão de acesso e o grupo dono para que apenas as pessoas do grupo “privado” possam acessar, para isso devemos prosseguir com os seguintes comandos:
```bash
chmod 0770 /samba/Privado
chown -R root:privado /samba/Privado
```
Desta forma, apenas os usuários do grupo privado terá acesso a pasta “Privado”, prosseguiremos com a criação de um usuário, inclusão deste no grupo criado e adicionaremos o seu usuário junto ao samba:
```bash
useradd teste
passwd teste
groupadd privado
useradd teste -G privado
smbpasswd -a teste
```
Agora na sua máquina windows, quando realizar a tentativa de acesso a pasta privada, note que será solicitada um login para autenticação, entre com as suas credenciais e o seu usuário terá as permissões de utilização da pasta privada.
Espero que tenham alcançado os objetivos iniciais e entendido um pouco mais sobre a configuração de um servidor com samba, caso tenha alguma dúvida ou note que ficou faltando algo, basta informar!
Fontes:
https://wiki.samba.org/index.php/User_Documentation https://wiki.samba.org/index.php/Setting_up_Samba_as_a_Standalone_Server
<file_sep>---
image: /assets/img/bash.png
title: Habilitar MFA para acesso ssh
description: Adicionar uma camada extra de segurança com autenticação de 2 fatores.
date: 2020-12-28
category: linux
background: "#EE0000"
tags:
- linux
- mfa
---
## Instalando o módulo
```
sudo yum install google-authenticator
```
Com o módulo instalado utilizamos o software que vem com o PAM para gerar a chave para o usuário que desejamos adicionar o segundo fator de autenticação. A chave é gerada individualmente para cada usuário, não sendo utilizada para todo o sistema.
### Configurando o OpenSSH
1. Adicionar a linha no final do arquivo e comente a linha `auth substack password-auth`
```
vim /etc/pam.d/sshd
auth required pam_google_authenticator.so nullok
```
1.1 Para adicionar exceções basta colocar o grupo do usuário no `/etc/pam.d/sshd` da seguinte forma
```
auth [success=done default=ignore] pam_succeed_if.so user ingroup GRUPO
```
2. Ajuste as seguintes variáveis no `/etc/ssh/sshd_config`
```
PasswordAuthentication no
ChallengeResponseAuthentication yes
AuthenticationMethods publickey,password publickey,keyboard-interactive
```
2.1 Caso seja necessário criar exceção para determinados usuários, basta adicionar o seguinte bloco na linha abaixo ao AuthenticationMethods `/etc/ssh/sshd_config`
```
Match User USUÁRIO
AuthenticationMethods publickey,password publickey
Match all
```
3. Reinicie o serviço SSH
```
systemctl restart sshd.service
```
### Criação de usuário
1. Gere a configuração do MFA com o seguinte comando:
```
google-authenticator
```
2 Ordem de respostas:
```
Do you want authentication tokens to be time-based (y/n) y
Do you want me to update your "/home/usuario/.google_authenticator" file (y/n) y
By default, tokens are good for 30 seconds. In order to compensate forpossible time-skew between the client and the server, we allow an extratoken before and after the current time. If you experience problems withpoor time synchronization, you can increase the window from its defaultsize of +-1min (window size of 3) to about +-4min (window size of 17 acceptable tokens). Do you want to do so? (y/n) n
If the computer that you are logging into isn't hardened against brute-forcelogin attempts, you can enable rate-limiting for the authentication module.By default, this limits attackers to no more than 3 login attempts every 30s.Do you want to enable rate-limiting (y/n)
```
3. Basta cadastrar o dispositivo com a secret key retornada e salvar os códigos de emergência para caso seja necessário acesso sem o dispositivo para gerar token.
<file_sep>import "lazysizes"
require("prismjs/themes/prism.css")<file_sep>---
image: /assets/img/template.png
title: O que estou estudando
description: >-
Com a chegada da pandemia tenho dedicado meu tempo em aprender e aperfeiçoar
algumas tecnlogias.
date: '2020-08-28'
category: news
background: '#D6BA32'
tags:
- Study
---
Sem muita enrolação, tenho focado bastante em estudar e aprender algumas tecnologias e ferramentas do mundo devops. Tenho me dedicado em tecnologias como Terraform e Ansible e tenho gostado bastante de entrar nesse mundo da automação e Infra as Code, o poder de poder realizar processos complexos de forma simplificada é o desejo de todo analista de infraestrutura / sistemas.
Recentemente iniciei os estudos em Docker porém já tenho um plano de estudo envolvendo outras tecnologias, então segue abaixo a minha meta de estudos para o restante do ano:
- Python
- Kubernetes
- Vault
- Packer
Além disso tenho focado também no meu desenvolvimento pessoal, estou lendo o livro "O poder o hábito".
Manter-se atualizado na área de TI parece impossível mas dedicando pouco mais de 30 minutos diariamente para estudar e ler tem feito total diferença, além do resultado direto com a minha produtividade, tem sido incrível praticar o que venho estudando.
<file_sep>---
image: /assets/img/AWS.png
title: AWS Certified Developer – Associate
description: No dia 13 de Abril me certifiquei como Developer Associate,
certificação essa que reune diversos tópicos sobre desenvolver soluções e
integrações através de produtos da AWS.
date: 2022-04-14
category: aws
background: "#FF9900"
tags:
- aws
- developer
- certified
- exam
- associate
categories:
- aws
- developer
- certified
- exam
- associate
---
A DVA-C01 foi de longe umas das provas mais legais de se estudar, acredito que apesar do nome, ela não é uma certificação voltada apenas a desenvolvedores, trazendo para a prova muitos conceitos referente a integração continua, observabilidade e serverless.
A maior barreira referente aos estudos eram quando tinha que estudar alguns topicos voltado a camada mais baixa de comunicação com a AWS e identificar quais API Calls seriam correspondente para o cenario proposto, sobre os demais conteúdos, é muito importante focar bem na integração de API Gateway e Lambda, SQS, Elastic Beanstalk, AWS X-RAY, DynamoDB e IAM.
Utilizei a Udemy novamente e por ter gostado muito do [Stéphane Maarek](https://www.udemy.com/share/101WgC3@EagtxFq1-Ju7uuilgifqR1q_ABE0SSWqS589t0Otsf52ip3swS-4YBUxHCPkv7sXlw==/) quando estava estudando para a Solutions Arquitetech, segui com o material disponibilizado por ele, como sempre trazendo um nível de detalhes e praticas que ajudam a trazer visão para os cenários e como eles funcionam.
Para poder participar do programa de certificação da empresa tive que comprar e agendar a minha prova em Março, tive um mês de estudo focado para a prova, como vim de um ritimo de estudo para a de arquiteto, achei tranquilo o prazo. Aproveitei o voucher de 50% oferecido pela Amazon como incentivo por ter passado na Solutions Architect pagando penas $75.
Lembrando para os que pretendem realizar a prova esse ano, a AWS esta dando 50% off para a [Developer](https://pages.awscloud.com/LATAM-launch-STR-aws-certification-disc-br-deva-2022-interest.html) e [Architect](https://pages.awscloud.com/LATAM-launch-STR-aws-certification-disc-br-saa-2022-interest.html) Associate basta solicitar através do link.
Mantive a prova em inglês por conta do material de estudo, e para não pegar possíveis erros de tradução, utilizei a acomodação de 30 minutos extras por não ter o inglês como minha lingua principal, próximo a reta final da prova, por volta de 1 semana antes, comecei a realizar apenas simulados e a partir dai revisar os pontos de maior dificuldade.
Utilizei como base dois cursos de simulados, todos no padrão da prova, 65 questoes e 130 min foram eles o feito por [Stéphane](https://www.udemy.com/share/101WNq3@wmJLp8pxHHT_5ps5fOT2vAtXg-P1LVJxdh93qprp3mxy80Be6C2kO-u0MyTmpEzfNQ==/) e os simulados do [Tutorials Dojo](https://www.udemy.com/share/101WLy3@OgsqYJ9DzLUgn_3LK8paL26SuDDnn6KUdl3Hy49mntRAEbzWHXDV2mMqpVlPUiZRVA==/) também na Udemy.
Minha dica para realização dessa prova é, estudem mas não se apeguem a todos os detalhes de todos os serviços, aprenda de fato sobre o princípio de aplicações Serverless. Não precisa enfiar a cara em todos os white papers e decorar todas as chamadas de API, pois o que vai lhe ajudar na prova é ler muito as questões.
Estudem o material e realizem quantos simulados puderem, entenda a explicação do porque de cada resposta e com certeza teremos uma boa pontuação.<file_sep>---
image: /assets/img/AWS.png
title: Setup WAF classic para bloqueio do LOG4j
description: No final de Novembro de 2021, pesquisadores relataram a descoberta
de uma falha no Apache Log4j, ferramenta presente em uma infinidade de
sistemas, que permite execução remota de código e tem nível de gravidade CVSS
10 de 10.
date: 2022-01-26
category: aws
background: "#FF9900"
tags:
- cve
- log4j
- waf
- classic
- aws
- seguranca
- sec
- devops
categories:
- cve
- log4j
- waf
- classic
- aws
- seguranca
- sec
- devops
---
Nesse artigo aprenderemos uma forma de mitigar a vulnerabilidade a nível de WAF, para que ele não chegue a nossa aplicação. Dessa forma, vamos utilizar o serviço AWS WAF Classic.
## Criar a condição
Entre no painel de configurações do WAF e dentro do campo ***CONDITION*** vamos selecionar o tipo `String and Regex Matching`:

Feito isso, vamos seguir a seguinte lógica para criar uma lista de regras igual a da lista abaixo:
```
Body contains: "${lower:${lower:jndi}}" after converting to lowercase.
Body contains: "jndi:" after converting to lowercase.
Header 'authorization' contains: "jndi:" after converting to lowercase.
Header 'content-type' contains: "jndi:" after converting to lowercase.
Header 'user-agent' contains: "jndi" after converting to lowercase.
HTTP method contains: "jndi:" after converting to lowercase.
URI contains: "jndi:" after converting to lowercase.
URI contains: "${::-j}ndi:" after converting to lowercase.
URI contains: "${lower:${lower:jndi}}" after converting to lowercase.
URI contains: "${::-j}${::-n}${::-d}${::-i}:" after converting to lowercase.
```
No fim, você terá algo semelhante a essa imagem:

## Regra
Criar uma nova regra, para isso selecione a opção ***RULE*** no menu lateral:

Configure associada a ***CONDITION*** que acabamos de criar, configure da seguinte forma:

# Web-ACL
Com a regra criada, basta que configuremos dentro da Web-ACLs utilizada no ambiente e definir a ***ACTION*** como ***BLOCK***, dessa forma vamos bloquear qualquer requisição que de ***match*** com a nossa regra.

Pronto, com o WAF configurado, teremos uma camada extra de proteção fazendo com que a ação maliciosa seja barrada antes de chegar na nossa aplicação.<file_sep>---
image: /assets/img/openvpn.png
title: OpenVPN para utilização Client to Server
description: >-
O OpenVPN é uma solução VPN Secure Socket Layer (SSL) de recursos completos
que acomoda uma ampla variedade de configurações.
date: '2020-02-12 19:28:50'
category: linux
background: '#EE0000'
tags:
- vpn
categories:
- Openvpn
---
Neste tutorial, você configurará o OpenVPN em um servidor CentOS 7 e, em seguida, o configurará para ser acessível a partir de uma máquina cliente.Neste tutorial, você configurará o OpenVPN em um servidor CentOS 7 e, em seguida, o configurará para ser acessível a partir de uma máquina cliente.
### Instalando o OpenVPN:
Para começar, vamos instalar o OpenVPN no servidor. Prosseguiremos também com a instalação do Easy RSA, uma ferramenta de gerenciamento de infraestrutura de chave pública que nos ajudará a configurar uma autoridade de certificação (CA) interna para uso com nossa VPN. Faça o login no servidor como usuário root e atualize as listas de pacotes para certificar-se de ter todas as versões mais recentes.
```bash
yum update -y
```
O repositório Extra Packages for Enterprise Linux (EPEL) é um repositório adicional gerenciado pelo Projeto Fedora contendo pacotes que não são padrões. O OpenVPN não está disponível nos repositórios padrões do CentOS, mas está disponível no EPEL, então instale o EPEL com o seguinte comando:
```bash
yum install epel-release -y
```
Atualizaremos novamente a lista de pacotes e em seguida a instalação do OpenVPN:
```bash
yum update -y && yum install -y openvpn easy-rsa
```
Primeiro crie uma cópia do diretório easy-rsa do sistema para o /etc/openvpn/easyrsa:
```bash
mkdir -p /etc/openvpn/easyrsa
cd /usr/share/easy-rsa/3.0.X
cp -rf * /etc/openvpn/easyrsa && cd /etc/openvpn/easyrsa
```
Com os arquivos copiados, inicialize o easry-rsa pki, o processo de inicialização limpa o conteúdo do diretório pki no easy-rsa 3 e cria os subdiretórios private e reqs:
```bash
[root@localhost easyrsa] # ./easyrsa init-pki
init-pki completo; agora você pode criar uma CA ou solicitações.
Seu diretório PKI recém-criado é: /etc/openvpn/easyrsa/pki
```
Para gerar o certificado CA basta utilizar o sub comando build-ca,você será solicitado a fornecer uma senha para sua chave CA, juntamente com algumas informações organizacionais. Você precisará digitar essa senha sempre que assinar uma solicitação de certificado para um servidor ou certificado de cliente:
```bash
[root@localhost easyrsa]# ./easyrsa build-ca
Generating a 2048 bit RSA private key
...........................+++
...........................................+++
writing new private key to '/etc/openvpn/easyrsa/pki/private/ca.key.docNHm1tdU'
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Common Name (eg: your user, host, or server name) [Easy-RSA CA]:server
CA creation complete and you may now import and sign cert requests.
Your new CA certificate file for publishing is at:
/etc/openvpn/easyrsa/pki/ca.crt
```
Em seguida, execute comandos para inicializar e criar seus arquivos CA e gerar parâmetros Diffie-Hellman no easy-rsa 3.
```bash
[root@localhost easyrsa]# ./easyrsa gen-dh
Generating DH parameters, 2048 bit long safe prime, generator 2
This is going to take a long time
.....................................................+........................................................................+...+..............++*++*
DH parameters of size 2048 created at /etc/openvpn/easyrsa/pki/dh.pem
```
Em seguida, gere um certificado para o servidor OpenVPN e assine-o. No exemplo abaixo, criamos uma chave chamada "*server*" para corresponder às chaves que referenciamos em nosso arquivo de configuração do servidor. Criamos esse certificado sem uma senha para que o servidor OpenVPN possa acessá-lo sem exigir a interação do sysadmin a cada vez, mas você será solicitado a fornecer a senha do *ca* criado anteriormente ao assinar o certificado do servidor:
```bash
[root@localhost easyrsa]# ./easyrsa gen-req server nopass
Generating a 2048 bit RSA private key
.....................................+++
.........................................+++
writing new private key to '/etc/openvpn/easyrsa/pki/private/server.key.c<KEY>'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Common Name (eg: your user, host, or server name) [server]:
Keypair and certificate request completed. Your files are:
req: /etc/openvpn/easyrsa/pki/reqs/server.req
key: /etc/openvpn/easyrsa/pki/private/server.key
```
```bash
[root@server easyrsa]# ./easyrsa sign server server
You are about to sign the following certificate.
Please check over the details shown below for accuracy. Note that this request
has not been cryptographically verified. Please be sure it came from a trusted
source or that you have verified the request checksum with the sender.
Request subject, to be signed as a server certificate for 3650 days:
subject=
commonName = server
Type the word 'yes' to continue, or any other input to abort.
Confirm request details: yes
Using configuration from ./openssl-1.0.cnf
Enter pass phrase for /etc/openvpn/easyrsa/pki/private/ca.key:
Check that the request matches the signature
Signature ok
```
Agora criamos um diretório keys e copiamos as chaves e certificados importantes que precisamos para o servidor OpenVPN a partir do diretório easy-rsa:
```bash
mkdir /etc/openvpn/easyrsa/keys/
chmod 750 /etc/openvpn/easyrsa/keys
cp -a /etc/openvpn/easyrsa/pki/ca.crt /etc/openvpn/easyrsa/keys
cp -a /etc/openvpn/easyrsa/pki/dh.pem /etc/openvpn/easyrsa/keysdh2048.pem
cp -a /etc/openvpn/easyrsa/pki/issued/server.crt /etc/openvpn/easyrsa/keys/
cp -a /etc/openvpn/easyrsa/pki/private/server.key /etc/openvpn/easyrsa/keys
```
#### Configuração do server.conf
OpenVPN possui exemplos de arquivos de configuração em seu diretório de documentação. Vamos copiar o arquivo server.conf para iniciarmos a configuração do nosso servidor VPN.
```bash
cp /usr/share/doc/openvpn-*/sample/sample-config-files/server.conf /etc/openvpn
```
Vou deixar um link para o arquivo de configuração "enxuto" no [Gist](https://gist.githubusercontent.com/thiagoalexandria/4b419a2fb9cc8962290a2d0950ccb210/raw/44eab659ab7b1f04262ff6c97bb133841394c1c0/openvpn-server.conf), assim basta alterar apenas as informações de "server" para o seu host. Em seguida basta seguir desabilitando o firewalld e selinux (após ajustar o selinux é necessário reiniciar).
```bash
systemctl stop firewalld
systemctl disable firewalld
sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
reboot
```
Após a reinicialização, libere o NAT para o funcionamento do openvpn:
```bash
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
```
Com todas as configurações realizadas, ativaremos e iniciaremos o serviço do openvpn:
```bash
systemctl enable openvpn@server
systemctl start openvpn@server
systemctl status openvpn@server
```
#### Gerando certificados para cliente
Será utilizado o script easyrsa, acesse o diretório /etc/openvpn/easyrsa, no exemplo seguiremos com a criação de um certificado para o cliente "Teste" passando o parâmetro "***nopass***" para não ser necessário atribuir uma senha:
```bash
[root@localhost easyrsa]# ./easyrsa gen-req Teste nopass
Generating a 2048 bit RSA private key
.............+++
...........................................................................................................+++
writing new private key to '/etc/openvpn/easyrsa/pki/private/Teste.key.3h2S55BG8q'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Common Name (eg: your user, host, or server name) [Teste]:
Keypair and certificate request completed. Your files are:
req: /etc/openvpn/easyrsa/pki/reqs/Teste.req
key: /etc/openvpn/easyrsa/pki/private/Teste.key
```
Criado o certificado, basta assinar cliente, lembre-se de inserir a senha do CA:
```bash
[root@localhost easyrsa]# ./easyrsa sign client Teste
You are about to sign the following certificate.
Please check over the details shown below for accuracy. Note that this request
has not been cryptographically verified. Please be sure it came from a trusted
source or that you have verified the request checksum with the sender.
Request subject, to be signed as a client certificate for 3650 days:
subject=
commonName = Teste
Type the word 'yes' to continue, or any other input to abort.
Confirm request details: yes
Using configuration from ./openssl-1.0.cnf
Enter pass phrase for /etc/openvpn/easy-rsa/pki/private/ca.key:
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
commonName :ASN.1 12:'Teste'
Certificate is to be certified until Apr 13 14:11:20 2029 GMT (3650 days)
Write out database with 1 new entries
Data Base Updated
Certificate created at: /etc/openvpn/easyrsa/pki/issued/Teste.crt
```
Copie as chaves do cliente para o diretório de keys
```bash
cp -a /etc/openvpn/easyrsa/pki/issued/deepak.crt /etc/openvpn/easyrsa/keys/
cp -a /etc/openvpn/easyrsa/pki/private/deepak.key /etc/openvpn/easyrsa/keys/
```
Pronto, basta encaminhar os arquivos criados para o cliente e o ca.crt para a pessoa que vai utilizados, além disso é necessário que encaminhe também um arquivo *.ovpn* para que o cliente inclua no seu cliente, segue um exemplo para [Download](https://gist.githubusercontent.com/thiagoalexandria/c477dad3196128bdff93400c908aa3a2/raw/a540e6621b8a49e930af60ee100d47ea03565490/cliente.ovpn). Basta seguir com a mudança do nome do crt e key conforme o nome gerado para o cliente e ajustar as configurações de server para o seu.
#### Configuração Cliente Windows
Baixar e instalar o programa cliente da [OpenVPN](https://openvpn.net/index.php/open-source/downloads.html). Após a instalação do cliente OpenVPN, acessar a aba Compatibilidade e habilitar a opção "Executar este programa como administrador", feito isso acesse a pasta de instalação do OpenVPN e localizar a pasta config.
```
C:\Arquivos de Programas\OpenVPN\config
C:\Arquivos de Programas (x86)\OpenVPN\config
```
Após extrair o conteúdo do cliente, ca, key, crt e ovpn para subpasta config e realizar o teste de conexão.
<file_sep>---
image: /assets/img/wsl.png
title: Configurar o NodeJs no WSL
description: >-
Um guia para instalação do node.js configurado no subsistema do Windows para
Linux (WSL).
date: '2020-02-17'
category: win
background: '#00A82D'
tags:
- wsl
- nodejs
- node
- windows
- windows10
---
Existem diversas formas de realizarmos uma instalação do node.js no linux, porém é interessante que utilizemos um gerenciador de versão, dessa forma poderemos atualiza-lo de forma muito mais rápida e prática. Nesse caso será utilizado o indicado pela Microsoft, instalaremos o nvm e a partir dele será feito a instalação.
Primeiramente, certifique de que tenha o ***curl*** instalado na sua distro WSL, feito isso instale o NVM, com o seguinte comando:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
```
Instalado o NVM, será necessário fechar e abrir novamente o seu terminal, para que o mesmo seja atualizado e possamos seguir com a configuração do node.js. Iniciado o terminal, execute o comando abaixo para verificar as versões instaladas
```bash
nvm ls
```
Nesse ponto você pode optar entre a instalação de dois tipos de versões, a versão mais recente ou a versão mais estável, dessa forma os comandos são os listados abaixo respectivamente:
```bash
nvm install node
nvm install --lts
```
Agora você deve ver a versão que acabou de instalar listada utilizando o comando *nvm ls.* Para alterar a versão do node. js que você deseja usar para um projeto, crie um novo diretório, em seguida, digite ***nvm use node*** para alternar para a versão atual ou ***nvm use --lts*** para alternar para a versão LTS.
<file_sep>---
image: /assets/img/bash.png
title: CSF como firewall em servidores linux
description: >-
O CSF é um um firewall SPI (Stateful Packet Inspection), login/detecção de
intrusão e aplicativo de segurança para servidores Linux.
date: '2020-11-13'
category: linux
background: '#EE0000'
tags:
- Linux
- firewall
---
O CSF é um firewall que possui diversas configurações para proteção de intrusão e ataques como Portflood e Synflood, Bruteforce e bloqueio por região. O CSF opera com um nível de abstração com o iptables, a sua administração ocorre de forma mais simples, vamos abordar aqui alguns conceitos básicos e em seguida algumas configurações para conter ataques em serviços web.
Antes de começarmos é interessante informar que o CSF pode ser instalado nos seguintes sistemas:
```
RedHat Enterprise v6 to v8
CentOS v6 - v8
CloudLinux v6 - v8
Fedora v30
openSUSE v10 - v12
Debian v8 - v10
Ubuntu v18 - v20
Slackware v12
```
Segue o processo de instalação do CSF:
```
cd /usr/src
rm -fv csf.tgz
wget https://download.configserver.com/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
```
Depois de instalado, é necessário validar se o seu servidor já possui os módulos do iptables necessário para o CSF:
```
perl /usr/local/csf/bin/csftest.pl
Talvez os pacotes abaixo precisem ser instalado
yum install perl-libwww-perl.noarch perl-LWP-Protocol-https.noarch perl-GDGraph
```
Após a instalação, basta executar o comando `csf -s` para inicializar o serviço, com o CSF inicializado, temos alguns comandos bem simples para o seu gerenciamento, por exemplo para reinicializar e parar o CSF temos os seguintes comandos:
```
# Flush/Parar firewall
csf -f
# Reiniciar o firewall e as regras
csf -r
```
Para Liberar ou bloquear um IP basta utilizar a seguinte estrutura:
```
# Libera o IP e adiciona no arquivo de allow /etc/csf/csf.allow
csf -a [IP.add.re.ss] [comment]
# Bloqueia o IP e adiciona no arquivo de deny /etc/csf/csf.deny
csf -d [IP.add.re.ss] [comment]
# Remove o bloqueio do IP do e remove do arquivo /etc/csf/csf.deny
csf -dr [IP.add.re.ss]
# Remove e libera todas as entradas do arquivo /etc/csf/csf.deny
csf -df
```
É possível também realizar consultas a bloqueios temporários, consultas por IP e realizar liberações por porta:
```
# Consulta nas regras do iptables e ip6tables (por exemplo, IP, CIDR, número da porta)
csf -g [IP.add.re.ss]
# Lista todas os bloqueios e liberações temporárias
csf -t
# Remova um IP da proibição temporária de IP ou da lista de permissões.
csf -tr [IP.add.re.ss]
# Libera todos os IPs das entradas temporárias
csf -tf
# Sintax para permitir que um IP use uma porta determinada em csf.allow
192.168.1.2:22
```
Além dessa interface por linha de comando, o CSF possui um arquivo de configuração no qual é possível determinar as portas TCP e UDP que devem ser liberadas ou é possível realizar a liberação através do arquivo csf.allow com a sintaxe de `ip:pora`, o caminho direto para o arquivo é o `/etc/csf/csf.conf`.
Como dito anteriormente, é possível configurar alguns parâmetros no arquivo de configuração do CSF para limitar e mitigar ataques DoS, para isso trabalharemos da seguinte forma:
1. Limitação de conexão
2. Proteção Port Flood
3. Rastreio de conexão
4. Proteção Synflood
# Limitação de conexão (CONNLIMIT)
Essa opção pode ser usada para limitar o uso de recursos/limite de conexões de um endereço de IP específico, limitando o número de novas conexões por endereço de IP, isso pode ser feito para portas específicas. Por exemplo, é normal que durante um ataque limitemos as conexões dos principais serviços como serviço web e ssh, por exemplo, limitaremos em 20 novas conexões, basta buscar por `CONNLIMIT = ""` no arquivo de configuração do CSF e aplicar a seguinte personalização:
```
# A limitação se da por porta:limite
CONNLIMIT = "80;20,443;20"
```
# Proteção Port Flood
Essa opção limita o número de conexões por intervalo de tempo para novas conexões feitas em portas específicas. PORTFLOOD é utilizado da seguinte forma: "porta;protocolo;número_de_hits;intervalo_em_segundos", basta buscar por `PORTFLOOD = ""`
```
PORTFLOOD = "80;tcp;20;5,443;tcp;20;5"
```
A configuração `"PORTA;tcp;20;5"` irá bloquear qualquer um que tiver mais de 20 requisições na porta 80 em 5 segundos.
# Rastreio de Conexão
Ativar a opção `CT_LIMIT` fará com que o firewall comece a realizar o rastreio de todas as conexões de endereços de IP para o seu servidor. Ele opera de forma bem simples, se o total de conexões for maior que o valor configurado, então o endereço de IP em questão será bloqueado. Isso pode ser usado para prevenir alguns tipos de ataques DoS. Nesse caso estaremos configurando as opções `CT_LIMIT = "0"` e `CT_INTERVAL = "30"`:
```
CT_LIMIT = 300
CT_INTERVAL = 30
```
# **Proteção Synflood**
Essa opção ajusta o iptables para fornecer uma proteção referente a tentativas de envio de pacotes TCP / SYN. Você deve ajustar o RATE para que os falsos-positivos sejam mínimos, dessa forma a configuração mais indicada para ataque desse gênero é a seguinte:
```
SYNFLOOD = "1"
SYNFLOOD_RATE = "100/s"
SYNFLOOD_BURST = "150"
```
Bom pessoal, espero que tenham curtido, foi um material bem extenso mas que agregará bastante na segurança dos serviços evitando que o seu ambiente fique fora do ar.
Valeu!
<file_sep>---
image: /assets/img/AWS.png
title: Permitir conexões SSH por meio do Session Manager
description: Você pode permitir que usuários em seu Conta da AWS para usar o AWS
CLI para estabelecer conexões SSH com instâncias usando SSM.
date: 2022-02-01
category: aws
background: "#FF9900"
tags:
- AWS
- SSM
- SSH
- Security
categories:
- AWS
- SSM
- SSH
- Security
---
Os usuários que se conectam usando SSH também podem copiar arquivos entre suas máquinas locais e as instâncias gerenciadas usando o comando SCP. Você pode usar essa funcionalidade para se conectar a instâncias sem abrir a necessidade de abrir portas, VPC ou manter bastion hosts.
Para que isso seja possível precisamos primeiro realizar a instalação do Session Manager plugin na sua máquina, dessa forma basta que realize a instalação baseada no seu sistema [operacional](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html).
# Configuração
Atualize o arquivo de configuração do seu SSH para permitir que executemos um comando por proxy que vai iniciar uma sessão pelo Session Manager e permitir que tenha trafego de informações por essa conexão.
Crie o arquivo de config da seguinte forma:
```
vi ~.ssh/config.
```
Dentro dele basta inserir o seguinte conteúdo:
```
# SSH over Session Manager
host i-* mi-*
ProxyCommand sh -c "aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'"
```
# Criando uma sessão
Para iniciar uma sessão, você utilizara o comando SSH normalmente e a configuração ajustada acima irá fazer o proxy para o SSM:
```
ssh -i minha-chave.pem username@instance-id
```
Observe:

Da mesma forma, se precisarmos enviar um arquivo via SCP vamos realizar da seguinte forma:
```
scp -i minha-chave.pem arquivo-1.txt usrname@instance-id/home/ec2-user/
```
Observe:

Bom, essa é uma forma alternativa para que possamos acessar as nossas instâncias na AWS, espero que gostem!<file_sep>---
image: /assets/img/AWS.png
title: Criação de permissões granulares do IAM para Pods
description: Se você está trabalhando com o EKS, provavelmente já ouviu falar de
OIDC. Mas o que é esse recurso e como ele funciona?
date: 2023-01-20
category: aws
background: "#FF9900"
tags:
- aws
- k8s
- oidc
- iam
- eks
categories:
- aws
- k8s
- oidc
- iam
- eks
---
O OIDC é uma forma de autenticação que usa tokens para garantir que somente as pessoas certas tenham acesso ao seu cluster EKS e às ações que podem realizar nele. Ele é configurado usando o EKS e o IAM da AWS. Em resumo, ele funciona como uma porta de entrada para garantir a segurança do seu cluster EKS.
Partindo do pressuposto de que estamos dando continuidade ao artigo [criação de cluster EKS](https://thiagoalexandria.com.br/criando-um-cluster-no-amazon-eks/) vamos então criar um laboratório com uma aplicação que terá permissão para acessar o S3, então antes de seguir vamos abordar os seguintes pontos:
* Criação do IAM Identity Providers
* IAM Policies e Role
* Bucket S3
* Sample App
# Criação do IAM Identity Provider
Por padrão o nosso Cluster ja entrega um endpoint criado para o OIDC, o que precisamos fazer é criar um IAM Identity Provider, o processo pode ser feito utilizando o console da AWS através do painel IAM na opção Identity providers mas nesse laboratório vamos simplificar a criação utilizando o `eksctl`. O `eksctl` é uma ferramenta da AWS que facilita a criação e gerenciamento de clusters no EKS. Ele te permite fazer tarefas comuns como criar clusters, escalonar nós e gerenciar configurações de segurança de forma rápida.
Para instalar o utilitário de linha de comando, siga os passos abaixo baseado no seu sistema operacional Linux e macOS:
```
#Mac
brew upgrade eksctl && { brew link --overwrite eksctl; } || { brew tap weaveworks/tap; brew install weaveworks/tap/eksctl; }
#Linux
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
sudo mv /tmp/eksctl /usr/local/bin
```
Agora que tudo está instalado, vamos criar nosso provedor de identidade para o OIDC. Para isso, basta usar o seguinte comando:
```
eksctl utils associate-iam-oidc-provider --cluster my-eks-lab-cluster --approve
```
Vamos acessar o console AWS para confirmar a criação:

# IAM Policies e Roles
Agora que temos o provedor de identidade podemos criar as nossas IAM Policies e Roles para que a nossa futura aplicação consiga utiliza-las. Para isso precisamos saber o ID do nosso OIDC e para descobrir basta executar o seguinte comando:
```
aws eks describe-cluster --name my-eks-lab-cluster --query "cluster.identity.oidc.issuer" --output text | cut -d '/' -f 5
```
Teremos um retorno semelhante a imagem abaixo:

Primeiro, vamos criar uma Role adicionando uma relação de confiança através do trust relationships, para criar a função, vamos considerar que vamos usar a namespace "eks-s3-example" e a service account que terá permissão para acessar a função será "eks-s3-example-iam-role-sa".
Lembre-se de substituir <AWS-ACCOUNT>, <AWS-REGION> e <OIDC-ID> pelos dados da sua conta AWS e o id do OIDC obtido no passo anterior dai execute o seguinte comando para criar um arquivo JSON de política de confiança do IAM:
```
cat << EOF > SampleAppS3AccessroleAssumeRole.json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::<AWS-ACCOUNT>:oidc-provider/oidc.eks.<AWS-REGION>.amazonaws.com/id/<OIDC-ID>”
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"oidc.eks.<AWS-REGION>.amazonaws.com/id/<OIDC-ID>:aud": "sts.amazonaws.com",
"oidc.eks.<AWS-REGION>.amazonaws.com/id/<OIDC-ID>:sub": "system:serviceaccount:eks-s3-example:eks-s3-example-iam-role-sa"
}
}
}
]
}
EOF
```
Com o arquivo JSON criado, vamos agora criar a função de permissão (Role) usando o AWS CLI.
```
aws iam create-role \
--role-name SampleAppS3Accessrole \
--assume-role-policy-document file://"SampleAppS3AccessroleAssumeRole.json"
```
Com a função criada, vamos anexar a política que determinará quais permissões a aplicação poderá assumir.
```
aws iam attach-role-policy \
--policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess \
--role-name SampleAppS3Accessrole
```
# Bucket S3
Para o laboratório, vamos precisar criar um bucket s3, esse processo pode ser executado através do console da AWS ou utilizando o CLI através do seguinte comando, lembre-se que o nome do bucket precisa ser único de forma global, então insira um nome personalizado:
```
aws s3api create-bucket \
--bucket eks-s3-example-app-bucket \
--region us-east-1
```
# Sample App
Bom, nessa altura do campeonato devemos estar com tudo criado, para realizar um teste vamos criar manifesto do tipo job, para tudo funcionar da forma que esperamos precisamos criar a namespace:
```
kubectl create namespace eks-s3-example
```
Para criamos o service account, rode o comando abaixo na sua máquina para criar o arquivo de manifesto, mais uma vez, lembra-se de alterar o `<AWS-ACCOUNT>` pelo id da sua conta:
```
cat << EOF > eks-s3-service-account.yaml
apiVersion: v1
automountServiceAccountToken: true
kind: ServiceAccount
metadata:
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::<AWS-ACCOUNT>:role/SampleAppS3Accessrole
labels:
env: dev
app: eks-s3-example
name: eks-s3-example-iam-role-sa
namespace: eks-s3-example
EOF
```
Basta então criarmos o nosso `Job` seguindo o seguinte manifesto, lembre se alterar o `<BUCKET-NAME>` pelo nome do seu bucket criado anteriormente:
```
cat << EOF > eks-s3-job.yaml
apiVersion: batch/v1
kind: Job
metadata:
name: eks-s3-example
namespace: eks-s3-example
spec:
template:
metadata:
labels:
app: eks-s3-example
spec:
serviceAccountName: eks-s3-example-iam-role-sa
containers:
- name: eks-s3-test
image: amazon/aws-cli:latest
args: \["s3", "ls”, "s3://<BUCKET-NAME>"]
restartPolicy: Never
EOF
```
Para termos uma visão melhor da execução, adicionei um arquivo chamado `aws.png` no bucket e então o resultado da listagem do bucket deve ser semelhante ao abaixo:

Espero que tenham compreendido bem como funciona a atribuição de IAM para os pods utilizando o OIDC atacado ao IAM Identity provider, em nosso próximo lab vamos criar o ALB ingress controller!<file_sep>---
image: /assets/img/HashiCorp-Terraform-logo.png
title: "Estimativa de custo para o Terraform com Infracost "
description: Infracost é uma ferramenta de código aberto que ajuda DevOps, SRE e
desenvolvedores a reduzir continuamente seus custos de nuvem.
date: 2021-10-18
category: devops
background: "#05A6F0"
tags:
- Terraform
- infracost
---
Recentemente comentaram sobre essa ferramenta na empresa em que trabalho e logo decidimos acata-la, o Infracost realiza a estimativa de custo para os nossos projetos com Terraform.
Durante todo o artigo iremos presupor que o Terraform já encontra-se instalado em sua máquina dessa forma precisamos instalar o Infracost, para isso siga a orientação para o seu sistema operacional:
```
# Brew
brew install infracost
# Linux
curl -fsSL https://raw.githubusercontent.com/infracost/infracost/master/scripts/install.sh | sh
# Docker
docker pull infracost/infracost
docker run --rm \
-e INFRACOST_API_KEY=see_following_step_on_how_to_get_this \
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
-v $PWD/:/code/ infracost/infracost breakdown --path /code/
```
Para utilizarmos precisamos registrar para solicitar uma API Key gratuita, dessa forma só precisamos executar o seguinte comando:
```
infracost register
```
Feito isso, já estamos prontos para utilizar os comandos no CLI, através dele temos duas opções de estimativas, a primeira é o detalhamento completo dos custos utilizando o comando:
```
infracost breakdown --path .
```
Observe a saida do comando:

A segunda forma é a geração de um relatório que mostra as diferenças de custos mensais entre o estado atual e planejado
```
infracost diff --path .
```
Observe a saida do comando:

A sua utilização principal basea-se nesses dois comandos, fora isso temos algumas variantes que basta executar o comando seguido de `--help`.
E é assim que o Infracost funciona, ela pode ser facilmente inclusa na sua ferramenta de CI, basta seguir a documentação oficial na página da [ferramenta](https://www.infracost.io/docs/integrations/cicd).
Espero que essa tecnologia sejá tão útil para vocês assim como tem sido pra mim, boa semana!<file_sep>---
image: /assets/img/bash.png
title: Conhecendo o Tmux
description: Tmux é uma aplicação que é baseada em sessões. Isto é, quando você
o executa ele abre uma nova sessão. Em cada sessão pode haver vários
terminais, porque o Tmux trabalha como um multiplicador de terminais.
date: 2021-04-15
category: linux
background: "#EE0000"
tags:
- Bash
- Linux
categories:
- Linux
---
Para começar a usar o Tmux, vamos inicialmente instala-lo, para realizar esse processo de instalação é bem simples basta que siga com o processo referente ao seu gerenciador de pacote:
```
sudo apt-get install tmux
sudo yum install tmux
brew install tmux
```
Com o programa instalado, execute o comando ˜tmux -V˜ para verificar se ele foi devidamente instalado e qual a sua versão.
## **Primeiros Passos com Tmux**
Para abrir uma nova sessão basta utilizarmos o comando:
```
tmux new
```
Uma vez que iniciamos a sessão, notaremos uma barra verde no fundo, observe:

Esta barra indica a sessão ativa e que estamos usando o Tmux. Assim como com uma screen, podemos nomear as sessões para facilitar a sua identificação. Para fazer isto, utilizamos o seguinte comando:
```
tmux new -s [nome]
```
Para finalizar uma sessão, precisamos digitar o seguinte comando:
```
exit
```
A utilidade mais importante do Tmux é que permite diferentes instâncias de terminais em uma única janela, permitindo acessá-las de forma rápida e fácil pelo teclado.

### **Controlando o Tmux**
Para trabalhar com Tmux precisamos ter em mente que para execução de seus comandos precisamos antes entender os seus prefixos, por padrão o prefixo é o `CTRL+B`. Então o caminho certo para estruturar um comando Tmux é:
```
<prefixo> + Comando.
```
Ou seja, temos que pressionar as teclas `CTRL + B` e depois o comando. Por exemplo, para criar uma nova sessão, o comando seria `C`. Portanto, para criar uma nova sessão, precisamos pressionar `CTRL + B` e depois `C`.
### Alguns Comandos Para Ajudar
Existe algumas dicas úteis para quando estamos trabalhando com o Tmux, a principal é para quando precisamos fazer o `detach` da sessão. Então, primeiro apertamos `CTRL+B` e em seguida o `D`. Vamos ver que teremos a próxima mensagem no terminal:
```
[detached (from session nome_da_sessao)]
```
Agora precisamos voltar para nossa sessão `attach`. Para fazer isto, utilizamos o seguinte comando:
```
tmux attach -t [nome_da_sessao]
```
Se você já tiver várias sessões podemos listar as ativas no tmux com o seguinte comando:
```
tmux ls
```
Teremos um retorno semelhante ao da imagem abaixo:

É possível fazer várias sessões com o comando `C`. Para navegar entre elas então vamos usar o número identificador. Por exemplo, a primeira sessão que criamos do terminal regular seria `0`. Se nós criarmos outra sessão ela corresponderá ao número `1`.
```
CTRL+B, 1
```
Nós podemos ver a sessão atual na barra verde na parte inferior da janela.
### Gerenciando Painéis e telas
Com o Tmux temos a liberdades de dividir a tela do shell, chamado de paineis, tanto horizontalmente como verticalmente. Aumentando os paineis permitindo trabalhar em várias situações ao mesmo tempo, vamos ver então alguns dos principais comandos para trabalhar de forma otimizada com paineis:
* Nova Janela: `<prefix>+c`
* Próxima Janela: `<prefix>+n`
* Listar todas as janelas: `<prefix>+w`
* Renomear uma janela: `<prefix>+,`
* Dividir painel na vertical: `<prefix>+%`
* Dividir painel na horizontal: `<prefix>+“`
* Eliminar o painel: `<prefix>+x`
* Mostrar número do painel: `<prefix>+q`
* Alternar entre painéis: `<prefix>+Setas do teclado
Bom, espero que tenham curtido e que utilizem o tmux cada vez mais para otimizar a produtividade !<file_sep>---
image: /assets/img/mod_deflate-cpanel-secnet-868x488.jpg
title: Instalação do cPanel no CentsOs7
description: >-
cPanel é o painel de controle mais popular e mais usado para gerenciar e
automatizar tarefas de hospedagem na web.
date: '2020-09-27'
category: linux
background: '#EE0000'
tags:
- Linux
- cpanel
---
É o painel de controle mais intuitivo e fácil do mundo, com uma interface gráfica muito simples e direta. O cPanel é um painel de controle de hospedagem na web baseado em Linux, que utiliza uma estrutura de nível 3 para administradores de sistemas, revendedores e proprietários de sites de usuários finais, tudo por meio de um navegador da web.
Além da bela interface de usuário, o cPanel tem acesso à linha de comando e acesso baseado em API para integração de software de terceiros, para provedores de hospedagem web ou desenvolvedores e administradores automatizarem seus processos de administração do sistema. Neste tutorial, mostraremos a você como instalar o WHM e o cPanel no CentOS 7.
Requisitos de instalação do cPanel
* CentOS 7 VPS
* Mínimo de 1GB RAM (2GB RAM é recomendado)
* Espaço mínimo em disco 20GB (40GB recomendado)
* Licença do cPanel (também há o período experimental 15 que é ativado assim que a instalação é concluída)
### Instalação
O Cpanel é escrito em Perl, portanto, antes de iniciarmos a instalação, você deve certificar-se de ter o Perl e o curl instalado em seu servidor.
```
yum install perl
curl
```
O WHM / cPanel também exige que o nome do host do seu servidor seja um nome de domínio totalmente qualificado (FQDN) que não corresponda a nenhum dos domínios do servidor. Em nosso exemplo, definiremos o nome do host do nosso servidor como host.mydomain.com (você pode substituir mydomain.com pelo seu nome de domínio real). Para alterar o nome do host do seu servidor, você pode usar o seguinte comando:
```
hostnamectl set-hostname server.thiagoalexandria.com.br
```
Agora você pode baixar a última versão do cPanel & WHM com:
```
Curl -o latest -L https://securedownloads.cpanel.net/latest
chmod +x latest
./latest
```
Finalizado a instalação você conseguirá abrir seu navegador e navegar para https://your-server-ip:2087 e terá acesso a página de login ao WHM, para entrar basta colocar o user root e a sua respectiva senha.
### Configuração
Assim que feito o primeiro login, você terá de realizar algumas configurações iniciais, na tela inicial será cobrado informações como :
* Confirmação do hostname do servidor
* Endereços para recebimento dos alertas
* Servidores DNS
* Qual o serviço DNS o servidor utilizará ( Se não irá como servidor DNS basta desativar)
Pronto, após feito todo o passo a passo o WHM/cPanel estará disponível para utilização, basta seguir com a criação das suas contas de hospedagens e seguir com a criação do seu site.
### Bônus
Para forçar a atualização do cPanel basta executar o seguinte comando, ele irá verificar quaisquer atualização disponível e irá aplica-la no servidor:
```
/usr/local/cpanel/scripts/upcp
```
Para os que desejam focar na administração do servidor cPanel outra opção bastante interessante é a utilização do cPanel/WHM através da API, segue o link da documentação oficial do cPanel referente a [WHM API ](https://documentation.cpanel.net/display/DD/Guide+to+WHM+API+1)e [cPanel API](https://documentation.cpanel.net/display/DD/Guide+to+cPanel+API+2).
Espero que tenham gostado do conteúdo, em breve pretendo trazer mais posts relacionado ao cPanel e a automação de atividades utilizando a linha de comando.
<file_sep>---
image: /assets/img/wsl.png
title: Instalar o WSL (Subsistema Windows para Linux) no Windows 10
description: Instruções de instalação para o Subsistema Windows para Linux no Windows 10.
date: '2020-02-16'
category: win
background: '#00A82D'
tags:
- wsl
- windows
- windows subsystem for linux
- windowssubsystem
- ubuntu
- debian
- suse
- windows 10
- install
---
A Microsoft desenvolveu uma camada de compatibilidade usando bibliotecas do Kernel Windows, sem nenhum código Linux, para reproduzir binários executáveis do Linux nativamente no Windows 10. Vale frisar que não se trata de um emulador ou virtualizador, a interface de kernel do WSL converte as chamadas dos binários Linux em chamadas de sistema do Windows e as executa em velocidade nativa, papel parecido ao que o Wine executa nos sistemas Linux.
A atualização ***[Fall Creators Update](https://en.wikipedia.org/wiki/Windows_10#Version_1709_(Fall_Creators_Update))*** moveu o processo do WSL para a Windows Store disponibilizando diversas outras distribuições além do Ubuntu.

Antes de instalar distribuições do Linux para WSL, você deve garantir que o recurso opcional "Subsistema Windows para Linux" esteja habilitado, para isso abra o PowerShell como administrador e execute o comando abaixo, observe que talvez seja necessário reiniciar o computador:
```powershell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```
Após habilitar a feature em questão, basta seguir com a instalação através da Windows Store, selecione a distribuição que deseja instalar e após instalado selecionar a opção "Iniciar"

Assim que iniciado, será solicitado que crie o seu usuário Unix e que aplique uma senha para o mesmo. A Microsoft recentemente liberou uma atualização para quem faz parte do Windows Insider, contendo a atualização para o WSL, a sua versão WSL2. Para fazer o upgrade de versão da sua instancia, verifique se o seu sistema encontra-se com a versão do SO acima do build 18917. Estando de acordo, basta seguir os passos abaixo:
```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
Após executar os comandos, será necessário uma reinicialização. Reiniciado o computador basta seguir com o procedimento de upgrade seguindo a instrução abaixo:
```powershell
wsl --set-version <Distro> 2
wsl --set-default-version 2
```
Pronto, a sua instalação já encontra-se configurada e pronta para uso.
<file_sep>---
image: /assets/img/AWS.png
title: "Cloudformation as principais funções intrínsecas "
description: "O Cloudformation possui uma variedade de funções intrínsecas para
lhe auxiliar durante o seu desenvolvimento, são funções para conversão,
referenciação e entre outras, facilitando a atribuição de valores às
propriedades que não estão disponíveis até o runtime., "
date: 2022-05-20
category: aws
background: "#FF9900"
tags:
- cloudformation
- infraascode
- iac
- aws
categories:
- cloudformation
- infraascode
- iac
- aws
---
Você só pode usar funções intrínsecas em partes específicas do seu template Cloudformation. Atualmente, você pode usar em propriedades de recurso, saídas, atributos de metadados e atributos de política de atualização. Você também pode usar funções intrínsecas para criar condicionalmente recursos.
### Ref
A função intrínseca Ref acredito ser uma das mais importantes, pois ela retorna o valor do parâmetro ou recurso referenciado, que pode ser utilizado por exemplo quando você especifica o nome lógico de um parâmetro e ele retorna o valor do parâmetro.
E com isso temos varias aplicações, por exemplo, a declaração de recurso para um Elastic Ip precisa do ID de instância EC2 e usa a !Ref para especificar o ID de instância do recurso MyEC2Instance:
```
MyEIP:
Type: "AWS::EC2::EIP"
Properties:
InstanceId: !Ref MyEC2Instance
```
### Mapping e FindInMap
O Mapping não é bem uma função, ele é uma forma de declararmos valores em formato de map, e é muito bom quando conhecemos antecipadamente todos os valores que podem ser obtidos, deduzido por variáveis, por exemplo Regiao, Availability Zones, Account, Environment:
```
Mapping:
RegionMap:
us-east-1:
"32" : "ami-pka6aseljeafe68z4"
"64" : "ami-ntndsv4evle1aqt6o"
us-east-2:
"32" : "ami-bxq31fmrtjyterbm8"
"64" : "ami-066ee2fq4a9ef77f1"
...
```
Tendo essa visão do Mapping, conseguimos utilizando a Fn::FindInMap acessar esse map values:
```
...
MyInstance:
Type: AWS::EC2::Instance
Properties:
AvailabilityZone: us-east-1a
ImageId: !FindInMap[RegionMap, !Ref"AWS::Region", 32]
InstanceType: t2.micro
KeyName: Thiago
SecurityGroups:
- !Ref SSHSecurityGroup
...
```
Dessa forma, vamos usar uma informação que o Cloudformation já sabe, que é a região em que ele ta sendo chamado e utilizara a chave 32 para pegar a informação da AMI com arquitetura 32 bits.
### Conditions
As funções de condições o nome já diz por si só, controlando a criação de recursos baseado em condições, as condições pode ser qualquer coisa, porém geralmente são baseadas em Environment, Region, Parâmetros e cada condição pode referenciar outra condição.
```
Conditions:
CreateProdResources:!Equals[!Ref EnvType, prod]
```
As funções condicionais mais comuns são:
```
Fn::And
Fn::Equals
Fn::If
Fn::Not
Fn::Or
```
Bom, trouxe aqui apenas algumas das várias funções disponíveis para o Cloudformation, espero que tenha servido de introdução para futuros projetos!
<file_sep>---
image: /assets/img/bash.png
title: 'Fluxos, Pipes e Redirecionamentos'
description: >-
Entender melhor os comandos antes de utiliza-los é muito importante, então
segue alguns dos mais comuns quando falamos em redirecionamentos e fluxos..
date: '2020-05-02'
category: linux
background: '#EE0000'
tags:
- Fluxos
- Pipes
- Redirecionamentos
categories:
- Linux
---
É muito comum precisarmos utilizar de artifícios para redirecionamento e mudança de fluxos no linux, principalmente quando queremos armazenar informações referente a erros e saídas de outros comandos, além de combinar outros comandos para obter um resultado.
Temos redirecionamentos para entrada, saída e erro, para alterar a saída padrão utilizamos o "`>`" se a saída existir, ele é sobrescrito, caso não exista será criado.
```
thiago@THIAGO-PC:~/Exemplos$ ls
exemplo.tar.gz teste
thiago@THIAGO-PC:~/Exemplos$ ls > saida_ls
thiago@THIAGO-PC:~/Exemplos$ cat saida_ls
exemplo.tar.gz teste
```
Outra forma para alterarmos a saída padrão é utilizando o "`>>`" para esse caso se a saída existir ele insere o resultado no final do arquivo, caso não exista será criado.
```
thiago@THIAGO-PC:~/Exemplos$ ls >> saida_ls
thiago@THIAGO-PC:~/Exemplos$ cat saida_ls2
exemplo.tar.gz teste teste.txt
```
Para o redirecionamento de erro ou Std_Error irá redirecionar a saída de erro para o local desejado, para o redirecionamento de erro é utilizando o "`2>`":
```
thiago@THIAGO-PC:~$ ls /tmp/arquivo
ls: não é possível acessar '/tmp/arquivo': Arquivo ou diretório não encontrado
thiago@THIAGO-PC:~$ ls /tmp/arquivo 2> erro.log
thiago@THIAGO-PC:~$ cat erro.log
ls: não é possível acessar '/tmp/arquivo': Arquivo ou diretório não encontrado
```
Assim como para a saída padrão, existe também uma forma incremental para a o Std_Error, utilizando o "`2>>`":
```
thiago@THIAGO-PC:~$ ls /tmp/arquivo2 2>>erro.log
thiago@THIAGO-PC:~$ cat erro.log
ls: não é possível acessar '/tmp/arquivo': Arquivo ou diretório não encontrado
ls: não é possível acessar '/tmp/arquivo2': Arquivo ou diretório não encontrado
```
Podemos combinar esse tipo de fluxo em scripts e direcionar o log de execução para um arquivo enquanto o log de erro irá para outro, por exemplo:
```
thiago@THIAGO-PC:~/Exemplos$ ls -l {Teste,Teste2}3 > saida.log 2> erro.log
thiago@THIAGO-PC:~/Exemplos$ cat saida.log
-rw-rw-r-- 1 thiago thiago 0 Jun 18 16:19 Teste
thiago@THIAGO-PC:~/Exemplos$ cat erro.log
ls: não é possível acessar 'Teste2': Arquivo ou diretório não encontrado
```
Assim como para saída e erro, podemos aplicar o redirecionamento também para entrada, a entrada padrão é o lugar de onde o programa recebe informações, nesse caso podemos repassar um arquivo para execução de um comando utilizando o "`<`":
```
thiago@THIAGO-PC:~/Exercicios$ tr 'a-z' 'A-z' < teste.txt
THIAGO ALEXANDRIA
```
Outros comandos também realizam redirecionamentos e mudam o fluxo com que o resultado será retornado, para isso utilizamos bastante o pipe "`|`", com ele é possível utilizar a saída de um comando como entrada para outro, um ótimo exemplo para isso é o comando `xargs` e `awk` que iremos ver a seguir.
O `xargs` é usado para construir e executar comandos a partir da entrada padrão. Converte entrada da entrada padrão em argumentos para um comando:
```
thiago@THIAGO-PC:~/Exemplos$ find /home/thiago/ -name "Teste"
/home/thiago/Exemplos/Teste.txt
/home/thiago/Exemplos/Teste2.txt
thiago@THIAGO-PC:~/Exemplos$ find /home/thiago/ iname teste | xargs rm -rvf
removed '/home/thiago/Exemplos/Teste/Teste.txt'
removed '/home/thiago/Exemplos/Teste/Teste2.txt'
```
o `awk` por sua vez modifica a saída padrão, por exemplo, queremos que seja retornado apenas o PID do processo que esta executando a screen da sessão:
```
thiago@THIAGO-PC:~/Exemplo$ ps faux | grep SCREEN | grep -v grep | awk '{print $2}'
358
```
Outros redirecionadores "`<<`" e "`<<<`", o "`<<`" é usado quando você deseja inserir um conteúdo interativamente, até que informe seu fim. Por exemplo:
```
thiago@THIAGO-PC:~/Exemplo$ tr a-z A-Z << final
Teste
conteudo
interativo
final
TESTE
CONTEUDO
INTERATIVO
```
Veja que a string "final" (pode ser qualquer string) vai informar ao shell que a entrada termina naquele ponto, e então ele irá enviar essa entrada ao comando tr.
O outro redirecionador, `<<<`, que é chamado de "here string". Ele simplesmente redireciona o que o segue como se fosse o conteúdo de um arquivo texto. Por exemplo:
```
thiago@THIAGO-PC:~/Exemplo$ tr a-z A-Z < teste.txt
bash: teste.txt: Arquivo ou diretório não encontrado
thiago@THIAGO-PC:~/Exemplo$ tr a-z A-Z <<< teste.txt
TESTE.TXT
```
Espero que tenham gostado do conteúdo abordado, nas próximas postagens, vamos abordar **"Criar, Monitorar e Encerrar Processos".**
<file_sep>---
image: /assets/img/Exim.png
title: Gerenciamento de servidor de e-mail com Exim
description: >-
O Exim é um MTA open source responsável por receber, rotear e entregar
mensagens de e-mail presente nas principais plataformas de hospedagens, como o
cPanel.
date: '2020-11-10'
category: linux
background: '#EE0000'
tags:
- Exim
- cPanel
---
O serviço de e-mail Exim esta presente nos painéis de hospedagens mais famosos do mercado, como é o exemplo do cPanel. Dessa forma é de extrema importância que saibamos gerenciar e administrar as suas funcionalidades.
O gerenciamento do Exim por sí só é bem tranquilo, é fácil identificar os usuários que enviam e-mails em massa e também as filas de e-mails. Dessa forma reuni alguns comandos que podem facilitar o seu gerenciamento de e-mail e detecção de spam.
Vamos começar com a parte mais simples, visualização e remoção de e e-mails que estão presos na fila de e-mail:
```
# Visualizar toda a fila de e-mail, quantidade por remetente
exim -bp | grep "<*>" | awk {'print $4'} | sort | uniq -c | sort -n
```
Para remoção de e-mail da fila existe alguns comandos que podem ser utilizados, remoção de e-mails congelados, que estão na fila a muito tempo, e até por remetente:
```
# Remove as mensagens na fila com mais de 24 horas.
exiqgrep -o 86400 -i | xargs exim -Mrm
# Apagar todos os e-mails congelados
exiqgrep -z -i | xargs exim -Mrm
# Apaga email congelado e sem remetente
exim -bpu | grep "<>" | awk '{print $3}' | xargs exim -Mrm
# Apagar emails de uma conta de email
exiqgrep -i -f <EMAIL> | xargs exim -Mrm
```
Se algum usuário estiver com bastante e-mails na fila, é interessante analisarmos mais informações sobre os e-mails enviados, podemos estar lidando com uma newsletter ou com um comprometimento da conta, para analisar isso, nós precisamos filtrar todas as mensagens da conta:
```
exim -bp | grep "<EMAIL>"
```
Dessa forma teremos um output semelhante ao da imagem abaixo:

Observe que cada mensagem possui um identificador como por exemplo "1WfnSO-004UX-9d" esse é o id da mensagem para que possamos rastreá-la caso necessário, existem três formas de fazermos isso, podemos verificar o seu cabeçalho, corpo e fluxo de envio/recebimento no log de e-mail:
```
# Verifica os cabeçalhos de uma mensagem
exim -Mvh <id-da-mensagem>
# Verifica o corpo de uma mensagem
exim -Mvb <id-da-mensagem>
# Verifica o log de e-mail
exiqgrep <id-da-mensagem> /var/log/exim_mainlog
```
Também é possível realizar testes de envio de e-mail através da linha de comando, por exemplo:
```
echo "Titulo teste" |exim -r <EMAIL> -v -odf <EMAIL>
```
Existem diversas possibilidades de configuração para o exim, para finalizarmos vou deixar um bônus, após uma certa quantidade de tentativas de erro para um domínio o exim salva um cache para evitar novos envios e já negar antes da sua saída, para limpar esse cache basta executar o seguinte comando para remoção dos arquivos:
```
cd /var/spool/exim/db && rm -rf retry* wait-remote_smtp*
```
Bom, é isso pessoal, espero que tenham gostado!
<file_sep>---
image: /assets/img/ansible-logo.png
title: " Criptografando conteúdo com Ansible Vault"
description: O Ansible Vault criptografa variáveis e arquivos para que você
possa proteger conteúdo confidencial, como senhas ou chaves, em vez de
deixá-los disponíveis nas suas tasks..
date: 2021-03-25
category: devops
background: "#05A6F0"
tags:
- Linux
- Ansible
- Devops
categories:
- Linux
- Ansible
- Devops
---
Para usar o Ansible Vault, você precisa de uma ou mais senhas para criptografar e descriptografar o conteúdo. Se você armazenar suas senhas do vault em uma ferramenta de terceiros, como um secret manager, precisará de um script para acessá-las.
Use as senhas com a ferramenta de linha de comando `ansible-vault` para criar e visualizar variáveis criptografadas, criar arquivos criptografados, criptografar arquivos existentes ou editar, redigitar ou descriptografar arquivos.
Para o Ansible Vault conseguir criptografar e manter a mínima segurança, ele utiliza a chave simétrica AES(Symmetrical Key Advanced). A chave AES provê um caminho simples de utilização já que utiliza a mesma informação de chave de criptografia para chave de decriptografia.
### Processo
O processo de criptografia e descriptografia é bem simples e pode ser feito com uma única linha de comando. Para criarmos o arquivo criptografado, utilizaremos a seguinte sintaxe:
````
ansible-vault create <arquivo>
````
Será solicitado uma senha para que só os que a possui conseguirem abrir o conteúdo. Feito isso, o arquivo estará criptografado, caso tente abrir sem o `ansible-vault` será retornado algo semelhante a isso:
````
$ cat senhas
$ANSIBLE_VAULT;1.1;AES256
32623665326138333534333731386338366466633535623561346535613663343565643461323533
3838616365653039383731613464396537393964323731380a396431323030366533353831396665
64616536323334323538313462376666616531313062623564333631396632666463336634383838
6136363131393137620a623230613131363236386631386333336163623938363131643632393036
6432
````
Para podermos acessar o seu conteúdo, utilizaremos a opção `view` e para editar a opção `edit` do `ansible-vault`:
````
ansible-vault view <arquivo>
ansible-vault edit <arquivo>
````
Agora um processo bastante comum é a criptografia do arquivo de variável do Ansible, dessa forma, para criptografarmos um arquivo já existente basta seguirmos com a opção `encrypt`:
````
ansible-vault encrypt <arquivo>
````
Para executar uma playbook que esteja utiliza um arquivo ou variável criptografada é necessário passar o comando da seguinte formar:
````
ansible-playbook --ask-vault-pass <playbook>
OU
ansible-playbook --vault-password-file <arquivo_de_senha> <playbook>
````
Finalizando, percebemos que o Ansible Vault é perfeito para proteger informações e implementar o básico de segurança de forma simples.
<file_sep>---
image: /assets/img/bash.png
title: "Passos para um troubleshooting eficaz "
description: Troubleshooting nada mais é do que seguir uma logica de análise
para resolução de um problema especifico.
date: 2021-03-18
category: linux
background: "#EE0000"
tags:
- Linux
- Troubleshooting
categories:
- Linux
---
Não precisamos de desespero na hora que nos depararmos com um problema, a última coisa que queremos é sair correndo atrás de ajuda sem nem entender o que se passa, antes de começar uma análise de troubleshooting é interessante partirmos de alguns princípios básicos:
* Entenda o problema e o serviço/aplicação
* Interprete e reproduza
* Leia os logs
Seguindo esse fluxo, a compreensão e resolução dos problemas serão sempre muito simples.
### Conheça o serviço
Entenda como o serviço ou aplicação funciona, saiba onde ela armazena os seus logs, utilizaremos o serviço SSH durante os exemplos.
O serviço SSH loga a maior parte das informações de acesso ou erro dentro do arquivo `/var/log/secure` dessa forma podemos filtrar os erros dependendo do horário da ocorrência. Ainda sobre análise do problema, é possível realizar um teste de conexão com a opção verbose do ssh-client ativa, para isso basta adicionar a diretiva `-v` com o comando ssh:
```
ssh -v -i chave.pub [email protected]
```
Dessa forma podemos analisar todo o processo que ocorre durante uma conexão SSH, com isso conseguimos obter informações sobre todo o fluxo da sessão SSH. No momento que você entende realmente o problema, tudo fica mais fácil.
### Ferramentas para análise troubleshooting
### Systemctl
Com o systemctl podemos observar o status dos serviços, com isso podemos ligar, parar e reinicia-los
```
systemctl status sshd
systemctl restart sshd
```
### Journalctl
Ele coleta e armazena dados de registro mantendo diários indexados estruturados com base nas informações de registro recebidas do kernel. Por padrão o serviço do jornal é ativo, mas você pode validar essa informação checando o seu status utilizando o systemctl:
```
systemctl status systemd-journald
```
Por padrão, o diário armazena os dados de registro em `/run/log/journal/`. Como o diretório `/run/` é volátil, os dados de registro são perdidos na reinicialização. Para torná-los persistentes, deve haver um diretório `/var/log/journal/` com propriedade e permissões para o serviço journald armazenar os logs. O systemd criará o diretório para você (e mudará o registro para persistente), se você fizer o seguinte:
1. Como root, abra o `/etc/systemd/journald.conf`
2. Remova o comentário da linha com `Storage=` e mude-a para `Storage=persistent`
3. Grave o arquivo e reinicie o systemd-journald
Com o journalctl conseguimos obter informações sobre erros na grande maioria dos serviços, costumo utilizar bastante o comando da seguinte forma :
```
journalctl -xe | grep SERVICO
```
as opções `-xe` vão nos retornar algumas informações relevantes para tratarmos os problemas, o `-e` irá retornar as ultimas linhas do arquivo de journal, a opção `-x` adiciona textos de ajuda que podem explicar o contexto de um erro ou evento de log. Algumas vezes contem mais informações que o log do próprio serviço.
## Comandos úteis
Temos alguns comandos que podem ser úteis durante a análise e identificação de problemas, abordaremos alguns contextos e os comandos que podem ser utilizados para análise.
### Problema com espaço em disco
Nesse cenário temos os comandos `df -h`, `du -h --max-depth=1.` e o `ncdu`. Ambos os comandos vão nos retornar informações referente a utilização de disco do servidor.
### df
Com o comando `df` podemos ter uma visualização sobre o consumo geral de disco e partições, nada muito detalhado, apenas % de utilização. Um df -i mostra o numero de inodes livres tbm:
````
df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
overlay 3907584 415188 3492396 11% /
tmpfs 254908 17 254891 1% /dev
tmpfs 254908 15 254893 1% /sys/fs/cgroup
shm 254908 1 254907 1% /dev/shm
/dev/vda1 3907584 415188 3492396 11% /etc/hosts
tmpfs 254908 1 254907 1% /proc/acpi
tmpfs 254908 1 254907 1% /sys/firmware
````
### du
Com o comando `du` começamos a ter mais informações, passamos a ter informações como tamanho de diretórios e arquivos.
### ncdu
Assim como o `du` o `ncdu` informa a utilização de disco por diretório e arquivos, o seu diferencial é a disponibilização de uma interface que permite a navegação dentro dos diretórios e interação com os mesmos, podendo deletar arquivos por exemplo.
### iotop
O `iotop` é utilizado em cenários que precisamos saber qual processo esta com maior utilização dos discos do sistema.
## Overload e Memória
Para análise de utilização de cpu podemos utilizar o comando pidstat, top, htop e free.
### pidstat
O pidstat é uma ferramenta de monitoramento, que torna possível acompanhar cada processo individualmente no Linux. já abordamos a sua utilização em uma [publicação](https://thiagoalexandria.com.br/analise-de-performance-com-pidstat/) dedicada inteiramente a ele.
### top e htop
Esses comandos servem para analisar através de métricas a utilização de recursos por processo, por exemplo consumo de CPU, Ḿemória, IO direcionado por processo.
### free
O comando free permite verificarmos quanto de memória encontra-se alocada pelo sistema e seus processos.
### dmesg
O comando mostra alguns logs uteis do sistema. Legal para procurar por erros de processos ou estouros de memória. Coisas importantes:
````
dmesg | grep -i segfault
dmesg | grep -i oom
dmesg | grep -i Killed
dmesg | grep -i error
````
Um exemplo de log de erro do dmesg:
````
[1880957.563150] perl invoked oom-killer: gfp_mask=0x280da, order=0, oom_score_adj=0
[...]
[1880957.563400] Out of memory: Kill process 18694 (perl) score 246 or sacrifice child
[1880957.563408] Killed process 18694 (perl) total-vm:1972392kB, anon-rss:1953348kB, file-rss:0kB
[2320864.954447] TCP: Possible SYN flooding on port 7001. Dropping request. Check SNMP counters.
````
### strace
Provavelmente a partir desse ponto você já deve saber o processo que mais esta causando problemas e agora precisamos investiga-lo melhor.
O strace mostra as chamadas para sistema que aquele processo esta fazendo e pode dar uma luz sobre o que mais pode estar dando problemas.
````
strace -p <PID>
ou
strace <comando>
````
O `strace -c` gera um sumario da utilização de um processo:
````
strace -c ls
test.cfg nohup.out original.cfg
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
16,57 0,000084 4 18 mprotect
15,78 0,000080 2 28 mmap
8,88 0,000045 4 11 open
7,89 0,000040 4 10 read
7,89 0,000040 2 14 close
7,69 0,000039 13 3 munmap
5,92 0,000030 15 2 getdents
5,72 0,000029 2 12 fstat
4,73 0,000024 12 2 2 statfs
2,37 0,000012 6 2 ioctl
2,17 0,000011 11 1 write
2,17 0,000011 5 2 1 access
1,97 0,000010 10 1 1 stat
1,97 0,000010 3 3 brk
1,78 0,000009 4 2 rt_sigaction
1,78 0,000009 9 1 openat
0,99 0,000005 5 1 getrlimit
0,99 0,000005 5 1 arch_prctl
0,99 0,000005 5 1 set_tid_address
0,99 0,000005 5 1 set_robust_list
0,79 0,000004 4 1 rt_sigprocmask
0,00 0,000000 0 1 execve
------ ----------- ----------- --------- --------- ----------------
100.00 0,000507 118 4 total
````
## Comunicação
É comum que em determinados momentos precisemos analisar a comunicação do nosso servidor com serviços ou aplicações externos, para isso podemos contar com os comandos telnet e curl
### telnet
Com o telnet conseguimos validar a comunicação com as portas no target, por exemplos, podemos verificar se existe resposta em alguma porta no ambiente de destino:
```
telnet 192.168.0.4 22
telnet 192.168.0.4 80
telnet 192.168.0.4 25
```
### curl
Com o curl podemos verificar algumas chamadas web, enviar tanto `GET` como `POST` para os ambientes externos, para analisar se o nosso ambiente tem comunicação com os urls de destino, podemos apenas executar um `curl` e verificar o seu retorno:
```
curl -I https://thiagoalexandria.com.br
```
Bom pessoal, é isso. Existem diversos outros comandos que podem ser utilizados dependendo do cenário em que se encontra. Espero que tenham curtido, pois entender um problema e saber como analisa-lo é algo que precisa estar enraizado na nossa rotina, precisamos conhecer bem o nosso ambiente e como ele se comporta.
Até a próxima!<file_sep>---
image: /assets/img/HashiCorp-Terraform-logo.png
title: Terraform Workspace na prática
description: Os dados persistentes armazenados no backend pertencem a um
workspace. Inicialmente, o backend tem apenas um workspace, o "default" e,
portanto, há apenas um state associado a essa configuração.
date: 2021-03-04
category: devops
background: "#05A6F0"
tags:
- Terraform
- Linux
categories:
- Terraform
- Linux
---
O Terraform inicia com apenas um workspace, o "default". Esse workspace é especial pois é o principal e porque não pode ser deletado. Se você nunca definir de forma explicita a configuração do workspace, então você estará trabalhando apenas com o "default"
Os Workspace são gerenciados pelo comando `terraform workspace`. Para criar um novo workspace e trocar por ele, você pode utilizar o comando `terraform workspace new`, para acessá-lo basta utilizar o comando `terraform workspace select".
Quando criamos novos workspaces isolamos o nosso arquivo de estado para que cada ambiente de trabalho tenha o seu tfstate de forma única sem tenhamos interferências. Criaremos um workspace para testes, observe:
```
$ terraform workspace new Teste
Created and switched to workspace "Teste"!
You're now on a new, empty workspace. Workspaces isolate their state,
so if you run "terraform plan" Terraform will not see any existing state
for this configuration.
```
A utilização de múltiplos ambientes de trabalho pode ser amplamente utilizada, como por exemplo testar a criação do ambiente em outras zonas ou ambientes de testes. Nesse cenário, podemos utilizar algumas formas de declaração de variável mais maleável, aplicando condicionais simples em nosso código Terraform.
Seguindo a ideia de termos um workspace de Teste, aplicaremos algumas regras para alterar a chave privada, AMI e tipo da instancia. Utilizaremos como base o nosso main.tf Criado anteriormente no nosso artigo sobre [Módulos](https://thiagoalexandria.com.br/terraform-criando-módulos/).
```
provider "aws" {
region = "us-east-1"
shared_credentials_file = "/home/thiago/.aws/credentials"
profile = "default"
}
module "server" {
source = "./modules/Ec2"
inst_ami = "ami-01d025118d8e760db"
inst_type = "t2.large"
inst_key = "Thiago"
tags = {"Name" = "lab-terraform", "Ambiente" = "Desenvolvimento"}
}
```
Definiremos que quando estivermos no nosso workspace `Teste` a nossa instancia será `t2.micro`, utilizaremos outra AMI e a chave privada será outra, teremos algo próximo a isso:
```
module "server" {
source = "./modules/Ec2"
inst_ami = terraform.workspace == "Teste" ? "ami-01d025118d8e760db" : "ami-70ctopa4mfwdxqd3j"
inst_type = terraform.workspace == "Teste" ? "t2.micro" : "t2.large"
inst_key = terraform.workspace == "Teste" ? "Thiago" : "Thiago2"
tags = {"Name" = "${terraform.workspace == "Teste" ? "lab-terraform-tst" : "lab-terraform""}, "Ambiente = "${terraform.workspace == "Teste" ? "Teste" : "Desenvolvimento""}}
}
```
Com o nosso ambiente já configurado para tratar a utilização dos workspace, vamos entender a lógica por trás disso:
```
terraform.workspace == "WOKSPACE_NAME" ? "ARG_1" : "ARG_2"
```
* WORKSPACE_NAME = Nome do workspace que queremos tomar como base.
* ARG_1 = Valor que será utilizado caso o workspace seja o definido em WOKSPACE_NAME.
* ARG_2 = Valor que será utilizado caso o workspace seja diferente do definido em WOKSPACE_NAME.
Bom, a ideia é bem simples, temos vários cenários cujo essa estratégia pode ser adotada. Com esse artigo, chegamos ao fim dessa trilha de artigos introdutórios sobre Terraform, pretendo trazer futuramente alguns pontos mais complexos, assim como outras tecnologias.
Até a próxima!<file_sep>---
image: /assets/img/AWS.png
title: Tags Scheduler
description: O aws-tag-sched-ops é uma ferramenta para agendamento programáticos
ou periodicos para recursos AWS, como Ec2, EBS e RDS. O agendador permite a
inicialização, reboot, backup e desligamento das máquinas de forma automática
baseada em tags.
date: 2020-12-28
category: aws
background: "#FF9900"
tags:
- aws
- tags
- devops
---
> **TODA A CONFIGURAÇÃO DE HORÁRIO É FEITA EM UTC**
## Processo de instalação
1. Antes de mais nada faça um fork ou clone o [projeto](https://github.com/sqlxpert/aws-tag-sched-ops) para a sua máquina
2. Faça login com uma conta que possua direitos administrativos
3. Crie um bucket para armazenamento do código em python para que possamos configurar para o lambda ( O código a ser importado deve ser o zip)
3.1. Remova o acesso publico de leitura e escrita.
4. Va no painel do cloudformation e inicia a criação da stack, escolha o arquivo e faça o upload do arquivo `aws_tag_sched_ops.yaml`
4.1. Stack name: `TagSchedOps`
4.2. LambdaCodeS3Bucket: `NOME DO BUCKET CRIADO COM O ZIP`
4.3. MainRegion: `Região`
4.4. Todas as demais configurações devem ser padrões
5. Configuração finalizada.
## Habilitar Operação
> Para habilitar a operação, basta adicionar a tag conforme a tabela abaixo descrita para cada serviço

> possível habilitar as tags para operações periódicas ou pontuais com o sufixo `-periodic`e `-once`
## Agendando operações

### Agendamentos periódicos
* Sufixo: `-periodic`
* Um ou mais valores podem ser configurados
* Valores aceitos:

> 1. Para uma combinação válida necessário especificar o dia, hora e minuto
> 2. Repita um componente inteiro para especificar vários valores. Por exemplo, `d=01, d=11, d=21` significa o 1º, 11º e 21º dias do mês.
> 3. A configuração do Wildcard `*` habilitada para quando for necessário, aplicasse para dias, horas e minutos
> 4. Para uma programação consistente de um dia por mês, evite `d=29` a `d=31`.
* Exemplos

> Lembre-se de utilizar espaços () invés de virgulas (`,`) no RDS! (para EC2, qualquer separador funciona
### Agendamentos One-time
* Sufixo: `-once`
* Valores: Um ou mais valores [ISO 8601 combined date and time strings](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations), por exemplo: `2020-03-21T22:40` (21 de Março de 2020)
* Lembre-se, o código é executado a cada 10 minutos o ultimo digito sempre ignored
* Omita segundos
## Combinações
Múltiplas operações não simultâneas são permitidas, apenas as configurações abaixo pode ser aplicado de forma simultânea:

Combinações não suportadas:
<file_sep>---
image: /assets/img/ansible-logo.png
title: Ansible Primeiros passos
description: O Ansible é uma ferramenta de automação de código aberto usada para
configurar servidores, instalar software e executar uma grande variedade de
tarefas de TI a partir de uma localização central.
date: 2021-03-11
category: devops
background: "#05A6F0"
tags:
- Ansible
- Devops
categories:
- Ansible
- Devops
---
Embora voltado para administradores de sistema com acesso privilegiado que rotineiramente executam tarefas como instalar e configurar aplicativos, o Ansible também pode ser usado por usuários não privilegiados. Por exemplo, um administrador de banco de dados que usa o ID de login do mysql pode usar o Ansible para criar bancos de dados, adicionar usuários e definir controles de nível de acesso.
Antes de começarmos, é necessário que tenha o Ansible instalado na sua máquina ou na máquina que utilizará para executar os seus playbooks, dessa forma você poderá seguir o processo de instalação através do [site oficial](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) de acordo com o seu sistema operacional.
Além disso, é necessário que tenha acesso SSH as máquinas de destino para que o Ansible realize as suas configurações, se não definido uma chave SSH ele utilizará a chave padrão do seu usuário. Nesse lab nós utilizaremos máquinas CentOs7.
### Estrutura
Dentro de um projeto Ansible podemos falar que teremos um formato de estrutura padrão a ser seguido, observe:
```
├── hosts
├── main.yml
├── roles
└── vars
```
O arquivo `hosts` será um arquivo que servirá como inventário, podemos separar as máquinas por grupos, separando quais ações serão aplicadas a cada um, por exemplo:
```yaml
[app1]
192.168.0.3
[app2]
192.168.1.3
```
Dessa forma, populamos o nosso arquivo de inventário com os grupos `app1` e `app2` especificando qual o endereço das máquinas targets. Os diretórios `vars` e \`roles\` servirão para armazenar as variáveis do projeto e os passos que serão aplicados, respectivamente.
O arquivo `main.yml` faremos a estruturação do projeto e chamada das ações definidas através das roles.
### Comandos
Com a instalação do Ansible, nos deparamos com alguns comandos que podem ser utilizados. Abordaremos apenas alguns que julgo mais importante, tendo em vista que iniciaremos no conteúdo hoje.
#### ansible
Com o comando `ansible` é possível executarmos chamadas através de alguns módulos. O mais simples, é o módulo ping, para testar a comunicação com as maquinas de destino configuradas no nosso inventário:
```shell
ansible -i hosts all -m ping
```
Podemos também utilizar qualquer outro módulo, por exemplo o módulo shell para executarmos algum comando na máquina remota ou coletar alguma informação:
```shell
ansible -i hosts all -m shell -a "uptime"
```
#### ansible-galaxy
O ansible-galaxy é utilizado para realizar a criação da estrutura das nossas roles, geralmente utilizamos esse comando dentro do diretório que armazenará a role:
```shell
ansible-galexy init role_name
```
#### ansible-playbook
Responsável pela execução dos playbooks mais complexos, executando todas roles configuradas, temos o comando ansible-playbook que após estruturado todo o projeto basta executa-lo passando como parâmetro o arquivo de inventário e o main.yml, observe:
```shell
ansibe-playbook -i hosts main.yaml
```
### Primeiro Playbook
Criaremos o nosso primeiro playbook, definiremos da seguinte forma, uma role para instalação de alguns pacotes em ambas as máquinas e uma segunda para o envio de um script apenas para as máquinas do grupo `app2`.
Definido isso, utilizamos o comando ansible-galay para criação da estrutura das nossas roles, certifique-se de que a sua estrutura de arquivos já encontra-se semelhante ao que temos abaixo:
```yaml
├── hosts
├── main.yml
├── roles
└── vars
└── vars.yml
```
Feito a confirmação, acesse o diretório de roles e crie duas roles, da seguinte forma:
```shell
ansible-galexy init install-basics
ansible-galexy init import-files
```
Após concluído o Ansible irá criar toda a estrutura de roles padrão, nesse exemplo utilizaremos apenas os diretórios de `tasks` e `files` os demais podem ser removidos, ficando apenas esses:
```
├── import-files
│ ├── files
│ ├── README.md
│ ├── tasks
│ │ └── main.yml
└── install-basics
├── files
├── README.md
├── tasks
└── └── main.yml
```
#### install-basics
Nesse playbook precisaremos instalar os seguintes pacotes nas máquinas, `vim`, `screen`, `epel-release` e o `htop`. Para isso utilizaremos o módulo do [yum](https://docs.ansible.com/ansible/2.3/yum_module.html) do Ansible, basicamente a estrutura do módulo é essa:
```yaml
- name: instalação de pacote
yum:
name: PROGRAMA
state: latest
```
Em `PROGRAMA` é necessário inserir o nome do pacote que deseja instalar, no nosso caso colocaremos um bloco para cada um. Na instalação do htop, é necessário que o epel seja instalado antes e que realizemos o upgrade dos pacotes então ficaremos com a seguinte estrutura
```yaml
---
# tasks file for install-basics
- name: install vim
yum:
name: vim
state: latest
- name: install screen
yum:
name: screen
state: latest
- name: install epel
yum:
name: epel-release
state: latest
- name: upgrade all packages
yum:
name: '*'
state: latest
- name: install htop
yum:
name: htop
state: latest
```
Pronto, feito isso a primeira parte do playbook esta feita, partimos para a segunda role.
#### import-files
Nessa role enviaremos um arquivo de script apenas para a máquina que estão no grupo `app2`, dessa forma utilizamos da seguinte logica, criaremos um arquivo `.sh` no diretório de files:
```
├── import-files
│ ├── files
│ │ └── import.sh
│ ├── README.md
└── ├── tasks
└── └── main.yml
```
Feito isso, basa configurar o nosso main.yml em nossas \`taks\` para realizar o envio do arquivo, utilizaremos o módulo de [sincronia](https://docs.ansible.com/ansible/2.3/synchronize_module.html):
```yaml
- name: Enviando script
synchronize:
src: files/import.sh
dest: /tmp/
```
Pronto, nessa role só precisamos dessa configuração para realizarmos o envio. Partimos agora para a configuração do nosso main.yml da raiz do projeto, que terá todas as chamadas das roles e seus grupos.
#### Organizando a execução
Para que o nosso playbook saiba o que e onde executar as roles, precisamos especificar no nosso arquivo main.yml da raiz do projeto o passo a passo a ser executado, nele especificaremos onde será executado, com qual usuário ssh e será com permissão sudo.
Dessa forma, configuraremos que todas as máquinas recebam a instalação dos pacotes e que somente o grupo `app2` receba o script, definiremos da seguinte forma:
```yaml
- hosts: all
become: yes
user: "{{ user }}"
vars_files:
- vars/vars.yml
gather_facts: no
roles:
- { role: Install, tags: ["install-basics"] }
- hosts: app2
become: yes
user: "{{ user }}"
vars_files:
- vars/vars.yml
gather_facts: no
roles:
- { role: Import, tags: ["import-files"] }
```
Observe que no campo `user` definimos uma variável `"{{ user }}", vamos configura-la no arquivo de variável então:
```yaml
user: thiago.alexandria
```
Feito isso, o seu playbook encontra-se pronto para execução.
### Execução
A execução de um playbook é feita através do comando `ansible-playbook`, passamos o aruqivo de hosts e o arquivo main como parâmetro de execução, observe:
```
ansible-playbook -i hosts main.yaml
```
Executado, você receberá na tela uma plano de execução, com as mudanças que o Ansible realiza, esse plano servirá como report, dessa forma você saberá se em algum momento o playbook retorne erro.
Todo o projeto desenvolvido nesse artigo encontra-se disponível no [github](https://github.com/thiagoalexandria/ansible-post) para consulta e para que possam comparar com os arquivos de vocês.
Caso tenham alguma dúvida, só deixar no campo de comentários! Até a próxima!<file_sep>---
image: /assets/img/nginx-1.jpg
title: Desmistificando o Nginx parte 2
description: Daremos continuidade com o nosso estudo sobre o Nginx, abordando
performance, segurança e proxy.
date: 2021-02-18
category: linux
background: "#EE0000"
tags:
- Linux
- Nginx
categories:
- Linux
- Nginx
---
# Performance
Existem diversos pontos que podem gerar performance no servidor web, abordaremos alguns dos mais importantes e comuns.
### Headers
Os servidores Web não controlam o client-side caching, obviamente, mas eles podem emitir recomendações sobre o que e como armazenar o cache, na forma de cabeçalhos de resposta HTTP.
Podemos adicionar um header e expires, que foi projetado como uma solução rápida, e também o novo cabeçalho Cache-Control que oferece suporte a todas as maneiras diferentes de funcionamento de um cache HTTP.
Digamos que temos uma imagem ou uma foto em nosso site e queremos dizer que os dados das fotos não mudam com frequência, dessa forma podemos dizer ao navegador que podem armazenar em cache uma copia por um tempo relativamente longo.
Vamos então configurar que todas as imagens `jpg` e `png` recebam algumas configurações de header, primeiro definimos que o cabeçalho de `Cache-Control` como público, informando ao cliente de recebimento que esse recurso ou resposta pode ser armazenados em cache de qualquer forma.
Em seguida configuramos o pragma também para publico, esse header é apenas uma versão mais antiga do `Cache-Control`, é interessante que configuremos.
O cabeçalho `Very` significa que o conteúdo dessa resposta pode variar com o valor que esta sendo codificado, vamos abordar melhor essa configuração ainda nesse artigo, mas basicamente informa que a resposta pode variar com base no valor do cabeçalho da solicitação, exceto na codificação.
Finalmente vamos configurar a tag `expires` que pode ser configurado definindo uma data ou uma duração padrão, por exemplo 60M que seria 60 minutos.
```
`
location ~* \.(jpg|png)$ {
access_log off;
add_header Cache-Control public;
add_header Pragma public;
add_header Vary Accept-Encoding;
expires 60M;
}
```
`
Dessa forma configuramos as tags de header e o de expiração para 60 minutos, forçando o cache local dessas informações das imagens.
### Gzip
Você precisa usar o módulo ngx_http_gzip_module. Ele compacta todas as respostas HTTP válidas (arquivos) usando o método “gzip”. Isso é útil para reduzir o tamanho da transferência de dados e acelerar as páginas da web para ativos estáticos como JavaScript, arquivos CSS e muito mais.
Faremos uma configuração simples, habilitando e definindo alguns tipos de arquivos que podem ser compactados:
````
http{
...
gzip on;
gzip_comp_level 3;
gzip_types text/css;
gzip_types text/javascript;
...
}
````
Para habilitar basta configurar a diretiva `gzip on`, podemos definir o nível da compactação, de 1 a 9, quanto maior mais ele vai tentar compactar, um valor aceitável é o `3` em `gzip_comp_level`.
Para definir os tipos que serão compactados defina com a diretiva `gzip_types`.
### HTTP2
A partir da versão 1.9.5 do Nginx tornou-se possível a configuração do http2, para isso é necessário que tenhamos um certificado ssl em nosso servidor, não cobriremos a geração ou compra do certificado, partiremos da pressuposição de que você já tenha um.
Para habilitar a versão basta configurarmos o listener na porta 443 para uma conexão segura e nele informamos a nova versão:
```
http {
include mime.types;
server {
listen 443 ssl http2;
...
```
Como informado, para configuração do acesso com ssl, é necessário definir o caminho dos certificados:
````
ssl_certificate /etc/nginx/ssl/self.crt;
ssl_certificate_key /etc/nginx/ssl/self.key;
````
# Segurança
### HTTPS
A configuração de uma conexão https vai além da configuração do certificado SSL, temos alguns pontos de ajuste de segurança, como por exemplo desabilitar alguns protocolos antigos, quais cifras serão aceitas, configuração de sessão entre outras.
Abordaremos apenas a configuração indicada pelo nginx para ambientes atuais, desabilitando versões TLS 1, 1.1 e 1.2. Aceitando apenas algumas cifras especificas também, dessa forma teremos a configuração do nosso bloco `server` da seguinte forma:
````
server {
listen 443 ssl http2;
ssl_certificate /etc/nginx/ssl/self.crt;
ssl_certificate_key /etc/nginx/ssl/self.key;
# Desabilitar SSL
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# Otimização de crifras
ssl_prefer_server_ciphers on;
ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5;
# Habilitar dhparam
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
# Habilitar HSTS
add_header Strict-Transport-Security "max-age=31536000" always;
# Configuração de sessão
ssl_session_cache shared:SSL:40m;
ssl_session_timeout 4h;
ssl_session_tickets on;
````
### Rate Limit
Um dos recursos mais úteis, mas nem sempre compreendido da melhor forma, do NGINX é o rate limit. Ele permite limitar o número de solicitações HTTP que um usuário pode fazer em um determinado período. A solicitação pode ser uma solicitação GET na página inicial ou uma solicitação POST em um formulário de login.
De modo mais geral, ele é usado para proteger os servidores de aplicativos upstream de serem sobrecarregados por muitas solicitações do usuário ao mesmo tempo.
O rate limit é configurado por duas diretivas principais, `limit_req_zone` e `limit_req` como no exemplo abaixo:
````
limit_req_zone $binary_remote_addr zone=meulimite:10m rate=10r/s;
server {
location /login/ {
limit_req zone=meulimite;
proxy_pass http://my_upstream;
}
}
````
A diretiva `limit_req_zone` define os parâmetros para o rate limit, enquanto `limit_req` habilita o rate limit dentro do contexto no qual definimos (no exemplo, para todas as solicitações para /login/).
`Key` - No exemplo, é a variável NGINX `$binary_remote_addr`, que contém uma representação binária do endereço IP de um cliente. Isso significa que estamos limitando cada request feito por IPs únicos.
`Zone` - Define a zona de memória compartilhada usada para armazenar o estado de cada endereço IP e com que frequência ele acessou um URL. Manter as informações na memória compartilhada significa que elas podem ser compartilhadas entre os processos do NGINX. Ela é definida da seguinte forma, `zone=` e o tamanho após os dois pontos. Para armazenar a informação de cerca de 16.000 endereços IP ocupam 1 megabyte, dessa forma, nossa zona pode armazenar cerca de 160.000 endereços.
`Rate` - Define a taxa máxima de requests. No exemplo, a taxa não pode exceder 10 requests por segundo. Na verdade, o NGINX rastreia solicitações com granularidade de milissegundos, portanto, esse limite corresponde a 1 solicitação a cada 100 milissegundos.
### Hardening
Além de habilitar o SSL em domínios existem algumas formas de aplicarmos uma camada de segurança a nível de servidor, por padrão o nosso servidor web retorna a versão do serviço dentro do request que pode ser facilmente obtida utilizando o curl. Para evitarmos que o atacante saiba a versão e identifique vulnerabilidades já publicada para a versão, existe uma opção dentro do bloco http para escondermos essa informação, observe:
````
http {
server_tokens off;
...
}
````
Além disso, podemos aplicar algumas configurações para bloquear algumas ações maliciosas como o bloqueio de ataques XSS, através da tag `X-XSS-Protection` em seu header. Outra configuração bastante importante e a de bloqueio de clickjacking.
O clickjacking é uma técnica informática fraudulenta. O roubo de click é uma armadilha preparada para que o usuário pense que está fazendo uma ação num determinado site, mas na verdade os cliques executados nessa ação estejam sendo usados pelo atacante, para executar operações maliciosas.
Para bloquear esse tipo de ação, basta adicionarmos ao header a opção `X-Frame-Options "SAMEORIGIN"`
````
server {
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
...
````
# Proxy reverso e Load Balancing
Servidores proxy reversos e balanceadores de carga são componentes em uma arquitetura de computação cliente-servidor. Ambos atuam como intermediários na comunicação entre os clientes e servidores, desempenhando funções que aumentam a eficiência. Eles podem ser implementados como dispositivos dedicados e com um propósito específico.
### Proxy Reverso
Um proxy reverso aceita uma solicitação de um cliente, encaminha-a para um servidor que pode atendê-la e retorna a resposta do servidor ao cliente.
A configuração de um Proxy reverso pode englobar várias variáveis e tornar o processo complexo, porém a ideia principal é simples e objetiva:
````
location / {
proxy_pass http://192.x.x.2;
}
````
Dessa forma ele fará o encaminhamento para o servidor em questão, a configuração pode ser feita também para urls complexos, como por exemplo:
````
location / {
proxy_pass http://192.x.x.2:8080/app;
}
````
### Load Balancer
Um load balancer distribui as solicitações recebidas do cliente entre um grupo de servidores, em cada caso retornando a resposta do servidor selecionado para o cliente.
Na configuração de um load balancer precisamos primeiro configurar um grupo de destino, no nginx esse grupo é chamado de `upstream`, observe:
````
http {
upstream target {
server target1.aplicacao.com.br;
server target2.aplicacao.com.br;
}
}
````
Configurado o grupo de `upstream` cujo nomeamos de target, aplicaremos o `proxy_pass` apontando para o nosso grupo, o arquivo completo ficaria configurado dessa forma:
````
http {
upstream target{
server target1.aplicacao.com.br;
server target2.aplicacao.com.br;
}
server {
location / {
proxy_pass http://target;
}
}
}
````
Nginx é um mundo enorme e cheios de configurações e personalizações, espero ter alcançado o meu objetivo de desmistificar os principais pontos sobre esse serviço web que é amplamente utilizado no mercado.
Não se apeguem apenas ao que foi abordado nesses últimos dois posts, sempre que necessário abram a documentação para analisar as variáveis e formas possíveis de sanar a necessidade particular do negócio de vocês.
Se tiver alguma dúvida ou sugestão, pode deixar na aba de comentários que vamos revisar.
Abraços!<file_sep>---
image: /assets/img/bash.png
title: Ferramentas para o dia dia
description: Além das tecnologias temos algumas ferramentas que podemos utilizar
para otimizar o nosso trabalho.
date: 2021-05-06
category: devops
background: "#05A6F0"
tags:
- Devops
categories:
- Devops
---
Desde que comecei a trabalhar com linux e precisei trazer ao meu dia a dia todas as tecnologias enfrentei algumas dificuldades como, saber trabalhar com Json, Yaml, Shell além de precisar interpretar vários dos comandos unix.
Pensando nisso, vamos abordar alguns sites e ferramentas que com certeza fara parte do seu dia a dia a partir de hoje.
## Explain Shell
Bom, quando eu iniciei a trabalhar com linux, acabava optando por tutoriais mastigados, cheios de comandos para copiar e colar pois não conhecia o sistema bem e acabava sem entender nada do que estava acontecendo.
Hoje em dia quando preciso de algo, corro para o [Explain Shell](https://explainshell.com), ele contém diversas man pages obtidas no repositório do Ubuntu. Dessa forma temos cobertura para os mais diversos comandos e variações, observe abaixo como é simples utiliza-lo:

Ele ira destrinchar todo o comando que foi inserido explicando cada variável, dessa forma temos como saber de fato o que cada comando ira fazer.
## Shell Check
Ainda focado em Shell, temos o [Shell Check](https://www.shellcheck.net) nele teremos a oportunidade de trabalhar a melhor pratica para o desenvolvimento de scripts em shell, alem de fornecer a interface web, temos como realizar uma integração em alguns editores de codigo.
Nele temos como principal funcionalidadde realizar aquele code review a nível de sintaxe e boas práticas assim como:
* Apontar e esclarecer problemas típicos de sintaxe para iniciantes, que fazem com que um shell emita mensagens de erro enigmáticas.
* Apontar e esclarecer problemas semânticos de nível intermediário típicos que fazem com que um shell se comporte de forma estranha e contra-intuitiva.
* Apontar advertências que podem fazer com que o script falhe em circunstâncias futuras.
Observe como será retornado as indicações e correções:

Além de indicar, clicando no codigo de erro seremos direcionado para uma página do github que explica o motivo do alerta e como corrigi-lo.
## tldr-pages
Conheci o [tldr-pages](https://github.com/tldr-pages/tldr) a pouco tempo, foi uma indicação de um [amigo](https://linkedin.com/in/kelvinsoares) e que gostei logo de cara. Ela reune várias man pages, pretendendo ser um complemento mais simples e acessível para os man pages tradicionais.
Ou seja, podemos ter acesso a algumas informações sobre as opçoes de um comando e nem sempre o man page dele sera bem estruturado. Dessa forma o ltdr simplifica essa busca retornando de forma objetiva oq precisamos seguido de alguns exemplos.
Diferente dos demais, o tdlr é destinado a utilização em linha de comando, podendo ser instalado facilmente com o npm:
```
npm install -g tldr
```
A sua utilização é bastante simples, observe:

## Yaml e Json Check
É muito comum que esqueçamos alguma notação ou de formatar o arquivo da forma que deve ser e sabemos que se isso acontecer teremos problemas na nossa execução, para isso temos dois sites que fazem essa análise para nós, são o [Yaml Checker](https://yamlchecker.com) e [JsonChecker](https://jsonchecker.com)
Ambos trabalham da mesma forma, buscam por problemas e repotam os erros para facilitar a sua identifação e correção.
Por hoje é só, espero que tenham curtido, de fato venho utilizando todas essas ferramentas para otimizar o meu trabalho, seja para desenvolver um script melhor estruturado ou para ajudar na hora do aperto.
Até a próxima!<file_sep>---
image: /assets/img/bash.png
title: Crie e hospede o seu próprio Linktree
description: "O Linktree é uma ferramenta bastante utilizada para centralizar
links para as suas plataformas. "
date: 2021-04-08
category: dev
background: "#EB7728"
tags:
- dev
categories:
- dev
---
Essa publicação será um pouco diferente, apesar do foco não ser a área de desenvolvimento, achei bacana trazer esse conteúdo.
O Linktree é uma ferramenta que permite ao usuário centralizar e divulgar os links de todas as suas redes sociais. Ela costuma ser muito utilizada por influenciadores digitais para divulgar outras redes e por empresas, que inserem os sites para venda de seus produtos.
Talvez um ponto negativo é que para algumas funções precisamos seguir com a contratação dos planos. Estava pensando em criar um então decido eu mesmo fazer.
Nesse post aprenderemos a criar o nosso próprio linktree e também como hospeda-lo inteiramente de graça através do Github Pages dessa forma você poderá personalizar a url para o seu próprio domínio.
### Ingredientes
* Precisaremos que você possua uma conta ativa no github
* Conhecimentos mínimos de html para ajustar o projeto
* Um domínio
### Iniciando o projeto.
Vocês podem fazer um fork, clonar ou criar a partir do meu projeto no github, nesse [link](https://github.com/thiagoalexandria/own-link).
Feito isso, vamos entender os arquivos:
```
.
├── CNAME
├── images
│ ├── favicon.png
│ └── thiago.jpeg
├── index.html
└── style.css
```
* `CNAME` = Vocês podem limpar ou remover esse arquivo, ele é gerado automaticamente quando definimos o url personalizado;
* `images` = Será o diretório cujo armazenaremos o favicon e a foto do nosso avatar;
* `index.hml` = arquivo principal contendo a estrutura do nosso linktree;
* `style.css` = arquivo de estilo para caso precise alterar as cores.
Vamos então ao que interessa, faça o upload das suas imagens e partiremos então a estrutura do nosso index.
### Index
No index, inicialmente, você precisa ajustar os apontamentos das suas imagens e o titulo do seu site:
```html
7 <link rel="shortcut icon" type="image/jpg" href="images/favicon.png"/>
...
13 <title><NAME></title>
...
36 <img src="images/thiago.jpeg" alt="Pic" class="profile-pic" />
```
Ajustado os apontamentos, vamos entender como funciona o nosso linktree. Ele basicamente é composto por uma list cujo inserimos os links que desejamos.
A lista começa logo em seguida da tag `<div class="link-list">` na linha `39`. Observe um bloco padrão dessa lista:
```html
<a
href="https://thiagoalexandria.com.br/"
target="_blank"
rel="noopener noreferrer"
>
<div class="link-list-item dark">
<NAME>
</div>
</a>
```
Dessa forma, basta informar o campo `href` o url que será o target, e na `div` que possui a classe `link-list-item` informe o nome que será exibido na link, pode ser o seu nome, o nome da rede social ou qualquer outra coisa.
Crie toda a sua estrutura de links, vou colocar abaixo um exemplo de um linkbio de 2 elementos para fixar melhor a forma com que deve ser feito:
```html
<a
href="https://thiagoalexandria.com.br/"
target="_blank"
rel="noopener noreferrer"
>
<div class="link-list-item dark">
<NAME>
</div>
</a>
<a
href="https://github.com/thiagoalexandria"
target="_blank"
rel="noopener noreferrer"
>
<div class="link-list-item dark">
Github
</div>
</a>
```
Entendido como funciona a distribuição dos itens, vamos a personalização.
### Estilo
Temos três tonalidades para aplicarmos aos itens, se observar configuramos a nossa `div` de itens com a classe `dark`. No nosso arquivo de estilo temos as opções `dark`,`medium` e `light` que pelo nome temos a noção que trata-se da intensidade da cor do nosso item.
Para mudar a intensidade que a ser utilizada, basta trocar na linha da div onde temos `dark` para o da sua preferencia. Caso queira ir além e criar a sua própria paleta de cores, você pode editar o seu arquivo `style.css` e ajustar as seguintes variáveis
```css
:root {
--darkest-color: #3b3b3b;
--lightest-color: #eaf6de;
--highlight-color: #ffffff;
--bright-color-1: #1dd845;
--bright-color-2: #76c47a;
--bright-color-3: #7fff7f;
}
```
* `darkest-color` = Cor do body da sua página
* `lightest-color` = Cor das bordas
* `highlight-color` = Cor que aparecerá quando passamos por cima dos links
* `bright-color-1` = Cor `dark`
* `bright-color-2` = Cor `medium`
* `bright-color-3` = Cor `light`
Pronto, praticamente você já sabe personalizar e mudar todo o projeto com intuito de criar o seu próprio linktree, vamos então hospeda-lo.
### Hospedagem
Para a hospedagem, vamos partir do pressuposto de que você possui um domínio e uma conta no Github.
1. Primeiro crie um novo repositório e faça o upload do projeto nele.
2. Feito a criação, acesse as opções do repositório e busque por "Github Pages"

3. Em source` defina a branch do projeto, geralmente será a master e clique em save, você terá algo semelhante a isso:

Observe que ele informará o url do seu site, como nós vamos utilizar um domínio personalizado, vamos primeiro pegar os IPs que respondem pelo nosso domínio. Para isso o Github indica que peguemos da seguinte forma.
```
dig <GITHUB-USER>.github.io
```
Será retornado em torno de 4 endereços, pegue-os e crie a entrada de subdomínio na sua zona DNS, no nosso caso criei o subdomínio linkbio.thiagoalexandria.com.br e realizei os devidos apontamentos.
Por ultimo voltamos as configurações do nosso repositório e vamos até a opção `custom domain` e inserimos o nosso domínio personalizado.
Pronto, basta esperar a propagação DNS do seu provedor e realizar os acessos, indico fortemente a utilização do Cloudflare para uma rápida propagação e suporte a CDN.
Espero que tenham curtido esse modelo de artigo, e que consigam criar os seus próprios linktree inteiramente personalizável.<file_sep>---
image: /assets/img/bash.png
title: Aprenda Cron Job de uma vez por todas
description: O Crontab ou Cron Job é um agendador de tarefas baseado em tempo em sistemas
date: 2021-04-06
category: linux
background: "#EE0000"
tags:
- Linux
categories:
- Linux
---
Sempre existirá coisas que você pode fazer com muito mais praticidade. Gerenciar tarefas repetitivas usando um processo automatizado é algo que nós da área de tecnologia buscamos diariamente.
### O que é um cron job?
Então, um cron job é uma atividade que será executada pelo cron seguindo a forma com que foi agendado.
### Conheça os comandos
Para começar a editar o arquivo crontab do usuário atual, digite o seguinte comando no seu terminal:
```
crontab -e
```
Para listar as tarefas cron você pode utilizar o comando `-l`
```
crontab -l
```
Para interagir com o crontab de um outro usuário, basta informar a opção `-u` informar o usuário e em seguida a variação que deseja, por exemplo para editar:
```
crontab -u username -e
```
Sabendo como interagir com o cron vamos então aprender a sintaxe para realizarmos os seus agendamentos.
### Agendamento
A sintaxe de um agendamento no crontab é bem simples, para entendermos melhor a sua disposição observe abaixo a imagem:

Observe que cada `*` significa uma variação para a sua configuração, vamos praticar alguns cenários.
* Um agendamento para executar um script de backup todo dia as 23h:
```
00 23 * * * /scripts/backup.sh
```
* Um agendamento para executar um script de sincronia a cada 10 minutos:
```
*/10 * * * * /scripts/sync.sh
```
* Uma rotina para limpar os arquivos de um diretório todo dia primeiro ás 10h
```
00 10 */1 * * find /home/thiago/logs/* -type f -delete
```
### Permissões Cron
Os dois arquivos possuem um papel importante quando se trata de cron jobs.
* /etc/cron.allow –se o `cron.allow` existe, ele deve contar o nome do usuário para o usuário utilizar cron jobs.
* /etc/cron.deny – se o arquivo `cron.allow` não existe, mas o arquivos cron.deny existe, então para usar cron jobs o usuário não deve estar listado no arquivo cron.deny.
Sabendo disso, podemos começar a automatizar nossas rotinas que hoje necessitam de uma intervenção manual e deixa-las configuradas no crontab.
Valeu! <file_sep>---
image: /assets/img/Oracle.png
title: Certificação Oracle Cloud Infraestructure gratuita
description: >-
Recentemente a Oracle disponibilizou gratuitamente uma serie de certificações
para Oracle Cloud Infraestructure que estão disponíveis até 15 de Maio.
date: '2020-04-23'
category: news
background: '#D6BA32'
tags:
- Oracle
- Certificacao
categories:
- Oracle
---
No dia 30 de Março a Oracle disponibilizou varias certificações e preparatórios de forma gratuita. Para ter acesso é bem simples, basta se cadastrar no [Oracle Education](https://profile.oracle.com/myprofile/account/create-account.jspx?pid=ou&nexturl=https://education.oracle.com/pt_BR/?source=:so:tw:or:awr:ocorp:) e depois disso escolher um dos cursos referente as certificações através do link abaixo :
* [Oracle Autonomous Database Specialist](https://learn.oracle.com/ols/learning-path/become-an-autonomous-database-specialist/35573/55666)
* [Oracle Cloud Infrastructure Foundations Associate](https://learn.oracle.com/ols/learning-path/understand-oci-foundations/35644/75258)
* [Oracle Cloud Infrastructure Cloud Operations Associate](https://learn.oracle.com/ols/learning-path/manage-oci-operations-associate/35644/60972)
* [Oracle Cloud Infrastructure Developer Associate](https://learn.oracle.com/ols/learning-path/become-oci-developer-associate/35644/75248)
* [Oracle Cloud Infrastructure Architect Associate](https://learn.oracle.com/ols/learning-path/become-oci-architect-associate/35644/75658)
* [Oracle Cloud Infrastructure Architect Professional](https://learn.oracle.com/ols/learning-path/become-oci-architect-professional/35644/35802)
Os cursos são bem completos e tranquilos de se fazer, apesar de ser inteiramente em inglês. Aproveitei o tempo de quarentena para estudar e aproveitar a chance de ter a certificação, em torno de 1 semana conciliando o curso e anotações agendei minha prova e consegui minha aprovação com incríveis 92%.

Estudei apenas pelo material disponibilizado durante o curso e fiz algumas pesquisas referente ao conteúdo que mais tive dificuldade de compreender. A prova é composta por 60 questões e 115 minutos para finaliza-la, creio que ser muito tempo devido a complexidade da prova, finalizei a minha aproximadamente em 40 minutos.
Bom é isso, algo bem rápido apenas para informa-los, aproveitem esse período para tirar uma dessas certificações e com certeza para aprender cosias novas.
<file_sep>---
image: /assets/img/HashiCorp-Terraform-logo.png
title: Criando uma instância EC2 usando Terraform
description: O Terraform é uma das ferramentas de infraestrutura muito popular e
um dos produtos da HashiCorp
date: 2020-06-24
category: devops
background: "#05A6F0"
tags:
- Devops
- Terraform
categories:
- Devops
---
O Terraform é uma ferramenta para construir, alterar e criar versões de infraestrutura com segurança e eficiência. O Terraform pode gerenciar provedores de serviços existentes e populares, bem como soluções personalizadas internas.
Os arquivos de configuração descrevem para Terraform os componentes necessários para executar um único aplicativo ou todo o seu datacenter. O Terraform gera um plano de execução descrevendo o que fará para atingir o estado desejado e, em seguida, executa-o para construir a infraestrutura descrita. À medida que a configuração muda, o Terraform pode determinar o que mudou e criar planos de execução incrementais que podem ser aplicados.
A infraestrutura que o Terraform pode gerenciar inclui componentes de baixo nível, como instâncias de computação, armazenamento e rede, além de componentes de alto nível, como entradas DNS, recursos SaaS, etc.
Indo direto ao ponto, realizaremos a criação de uma instância free tier na AWS. Mas antes disso é necessário saber os principais comandos do Terraform:
* `terraform init` : baixa os plugins necessários para executar o código.
* `terraform plan` : mostra o plano de ação que o Terraform irá realizar na infra.
* `terraform apply`: executa todo o plano de ação configurado.
* `terraform destroy`: irá destruir tudo que foi aplicado no provider.
### Instalando Terraform:
Para fazer a devida instalação basta clicar [aqui ](https://www.terraform.io/downloads.html)e selecionar a sua distro, neste caso vou usar o Linux.
Com o download feito, vamos a configuração:
1. Instale o pacote unzip:
```shell
sudo apt-get install unzip
```
1. Descompate e mova o binário para o diretório \`/usr/local/bin\`:
```shell
unzip terraform_0.12.26_linux_amd64.zip
sudo mv terraform /usr/local/bin/
```
1. Feito isso, para testar executamos o comando abaixo:
```shell
terraform --version
```
### Criação de usuário na AWS
Para que possamos criar os nossos recursos será necessário criamos o nosso usuário na AWS, para isso basta seguir os passos da [documentação](https://docs.aws.amazon.com/pt_br/IAM/latest/UserGuide/id_users_create.htmlhttps://docs.aws.amazon.com/pt_br/IAM/latest/UserGuide/id_users_create.html) .
Todos o processo abordado aqui poderá ser feito utilizando a conta [free tier](https://aws.amazon.com/pt/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc) da AWS, sem envolver nenhum tipo de custo.
Com o usuário criado e aplicado a um grupo de acesso, salve o seu ID e Chave pois será utilizado pelo Terraform para se autenticar com o seu provider.
### Configurando credenciais
Para configurar as suas credenciais é bastante simples, você pode fazer isso instalando o [AWS cli](https://docs.aws.amazon.com/pt_br/cli/latest/userguide/install-cliv2-linux.html) ou criando um arquivo qualquer na sua máquina e adicionar as seguintes informações:
```shell
[default]
aws_access_key_id = SUA_KEY
aws_secret_access_key = SUA_SECRET_KEY
```
### Configuração da instância
Criaremos um arquivo chamado `main.tf` no qual será feito as configurações da instância que desejamos subir, observe o arquivo logo abaixo:
```shell
provider "aws" {
region = "us-east-1"
shared_credentials_file = "/home/thiago/.aws/credentials"
profile = "default"
}
resource "aws_instance" "Teste" {
ami = "ami-01d025118d8e760db"
instance_type = "t2.micro"
key_name = "Thiago"
tags = {
Name = "lab-terraform-tst"
}
}
```
No arquivo acima descrevemos o nosso provider sendo `aws` repassando as nossas credenciais, profile e região. Em seguida descrevemos como será configurada a nossa instância, foi escolhida uma ami do Amazon Linux, na família "t2.micro" elegível para free tier, assimilando a minha chave de acesso ( Já existente na AWS ) e por fim declarando o seu Nome para `lab-terraform-tst`.
### Iniciando o terraform
Feito toda a configuração, prepararemos o nosso diretório usando o comando `terraform init` para realizar o download dos plugins da AWS. Você verá que tudo deu certo caso tenha essa mensagem durante o retorno:
```
Terraform has been successfully initialized!
```
Agora executaremos o comando `terraform plan` . Isso nos permitirá ver o plano de ação que o Terraform fará antes de decidirmos definir a infra, esse comando pode demorar um pouco, verifique se as informações seguem de acordo com o planejado nos arquivos, no fim o seu plan deve ter algo semelhante a esse.
```shell
Plan: 1 to add, 0 to change, 0 to destroy.
```
Sabendo tudo que o Terraform vai fazer podemos partir para a criação, executamos o comando `terraform apply`:
```shell
# terraform apply
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
aws_instance.Teste: Creating...
aws_instance.Teste: Still creating... [10s elapsed]
aws_instance.Teste: Still creating... [20s elapsed]
aws_instance.Teste: Still creating... [30s elapsed]
aws_instance.Teste: Still creating... [40s elapsed]
aws_instance.Teste: Creation complete after 40s [id=i-0f7e4c2a21bf6949c]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
```
Se formos para o console da AWS, podemos ver que uma instância t2.micro foi criada usando o Terraform:

Para evitar cobranças, por se tratar de um ambiente de lab execute o comando `terraform destroy` para remover tudo o que foi criado durante esse artigo.
Esse artigo cobre apenas o básico sobre a criação de uma instância, indico que veja a documentação para algo mais elaborado, como criação/atribuição de security groups, vpc's, etc.
Fontes: [terraform](https://www.terraform.io/docs/cli-index.html), [aws_provider](https://www.terraform.io/docs/providers/aws/index.html), [aws_instance](https://www.terraform.io/docs/providers/aws/d/instance.html).<file_sep>---
image: /assets/img/Apache.png
title: Configuração de um servidor Apache
description: Nesse tutorial será explicado como configurar o Apache em um
servidor com CentOS 7, desde a sua instalação até a configuração de vhosts e
instalação de módulos. Nesse artigo será utilizado a versão 2.4 do apache em
uma instalação Minimal do CentOs 7.
date: 2021-03-15
category: linux
background: "#EE0000"
tags:
- linux
---
Esse artigo será terá a sua leitura mais demorada, ele será mais detalhado voltado ao entendimento da configuração de um servidor Apache e suas principais funcionalidades, com as dicas repassadas poderá ser feito facilmente a configuração de um servidor web para hospedagem de sites e sistemas.
## 1. Configuração do hostname
Antes de seguir com a configuração do Apache, iremos configurar o hostname do servidor da seguinte forma "meu-site.com.br" no qual você deve substituir pelo teu domínio do teu servidor, para isso será utilizado o seguinte comando:
```bash
hostnamectl set-hostname meu-site.com.br
```
Após ajustar o hostname, verifique é o nome configurado é retornado após utilizar o comando abaixo:
```bash
hostnamectl status
```
Feito isso, edite o arquivo hosts em seu /etc/hosts com o editor de sua preferência
```bash
vi /etc/hosts
```
## 2. Instalação e configuração do Apache
Configurado o hostname seguiremos com a instalação e configuração do serviço web no servidor, para isso basta seguir com a instalação do serviço httpd e alguns utilitários através do gerenciador de pacotes:
```bash
yum install -y httpd wget htop
```
Feito a instalação utilizando o gerenciador de pacotes inicie o serviço para verificar o seu funcionamento
```bash
systemctl start httpd
systemctl status httpd
```
### 2.1 Ajustes de configuração do sistema operacional
Para que o servidor funcione sem maiores problemas é necessário seguir alguns passos para liberação de porta no firewall e desativar o selinux para não realizar bloqueios nas aplicações, dessa forma escolha a forma com que se sente mais familiarizado :
A: Desabilite o firewalld e utilize o iptables como firewall
```bash
systemctl stop firewalld
systemctl disable firewalld
```
Nesse teste iremos utilizar apenas ipv4 então desativaremos as configurações de ipv6 do iptables e das configurações de rede:
```bash
service ip6tables stop
chkconfig ip6tables off
sed -i 's/IPV6INIT\=\"yes\"/IPV6INIT\=\"no\"/g' /etc/sysconfig/network-scripts/ifcfg-eth0
echo -e 'net.ipv6.conf.all.disable_ipv6 = 1\n' >> /etc/sysctl.conf
echo -e 'NETWORKING_IPV6=no\n' >> /etc/sysconfig/network
```
Após feito, liberar a porta 80 e 443 no iptables:
```bash
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tcp --dport 443 -j ACCEPT
/sbin/service iptables save
```
B: Liberar a porta 80 e 443 no firewalld
```bash
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=443/tcp
firewall-cmd --reload
```
Configurado o firewall será feito o ajuste dos limites de segurança e desativação do selinux no servidor, para isso siga com o passo determinado abaixo:
```bash
echo -e '* soft nofile 1024\n' >> /etc/security/limits.conf
echo -e '* hard nofile 65535\n' >> /etc/security/limits.conf
echo -e 'sesssion required /lib64/security/pam_limits.so\n' >> /etc/pam.d/login
echo -e 'fs.file-max = 65535\n' >> /etc/sysctl.conf
sed -i "s/SELINUX=.*/SELINUX=disabled/" /etc/sysconfig/selinux
```
### 2.2 Estrutura do Apache
O Apache, assim como todo outro serviço possui caminho para os seus arquivos de configuração, para acessar esses arquivos basta seguir com o acesso ao seguinte diretório:
```bash
/etc/httpd
```
Nesse diretório é possível verificar alguns outros diretórios responsáveis pela estrutura do apache, são esses os conf, conf.d, logs, modules e run, abaixo é possível verificar as configurações armazenadas:
```bash
# Arquivo de configuração principal, responsável por iniciar e determinar as configurações iniciais do serviço Web
/etc/httpd/conf
# Diretório para realização de includes de configuração
/etc/httpd/conf.d
# Diretório padrão para armazenamento de logs
logs -> ../../var/log/httpd
# Link simbólico para as bibliotecas de módulos instalados
modules -> ../../usr/lib64/apache2/modules
# Informações sobre o processo ativo
run -> ../../var/run/apache2
```
## 3. Configuração de aplicação Web
### 3.1 Instalar e configurar o modulo php
Nesse passo não se tem restrições, caso deseje instalar a versão disponibilizada pelo yum basta seguir com a instalação, para verificar qual a versão disponível basta verificar utilizando a opção info do gerenciador de pacotes:
```bash
yum info php
```
Se estiver de acordo, basta seguir com a instalação:
```bash
yum install php
```
Como a versão disponibilizada já encontra-se em end-of-life será instalado a versão 7.0 do php, para isso basta seguir os seguintes passos, ativando os repositórios Epel e Remi:
```bash
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
```
Em seguida é necessário instalar o yum-utils, para poder manusear os repositórios e pacotes que serão instalados:
```bash
yum install yum-utils
```
Instalado o yum-utils, basta escolher a versão do PHP que deseja, para isso selecione o pacote:
````bash
yum-config-manager --enable remo-php70 [Install PHP 7.0]
yum-config-manager --enable remi-php71 [Install PHP 7.1]
yum-config-manager --enable remi-php72 [Install PHP 7.2]
yum-config-manager --enable remi-php73 [Install PHP 7.3]
```
Configurado a versão siga com a instalação dos módulos:
```bash
yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo
````
Certifique-se de que a versão foi instalada corretamente:
```bash
php -v
```
Criaremos o arquivo Virtual Host o nosso domínio diretamente no /etc/httpd/conf.d/www.apachevm.conf
```bash
<VirtualHost *:80>
ServerAdmin <EMAIL>
DocumentRoot /var/www/apachevm/html/videopage
ServerName www.apachevm.com
ErrorLog logs/www.apachevm.com-error_log
CustomLog logs/www.apachevm-access_log common
</VirtualHost>
```
## 4. Configuração de Logs
### 4.1 Funcionamento dos logs
É possível personalizar como as informações são armazenadas, os seus níveis de criticidade e o formato dos logs.
* Log level
* Define o nível de criticidade do log do Apache
* Configurado no httpd.conf
* Default: LogLevel warn
* LogFormat
* Cria aliases para formatação de logs
* Evita poluir as configurações de VirtualHosts
* Possibilidade de criar diversos logs com formatos diferentes
* Custom log
* *Configurável no Virtual Host*
* É possível criar diversos arquivos de acordo com o LogFormat
* Rotate logs
* *Permite gravar um arquivo através de outro comando*
* rotatelogs: comando para gerenciar rotação de logs
* Rotacionar por tamanho ou por tempo
### 4.2 Criticidade de logs
Existem diversas opções para configuração do LogLevel do apache, segue abaixo uma tabela com as opções e as suas descrições:

Para configuração do LogLevel basa seguir com a edição direta do arquivo de configuração do apache na variável LogLevel:
```bash
vim /etc/httpd/conf/httpd.conf
```
Feito o ajuste, basta reiniciar o serviço web
```bash
service httpd restart
```
### 4.3 LogFormat
O log format pode ser ajustado de diversas formas, adaptando-se a sua necessidade sobre os itens que deve ser logados, abaixo segue alguns exemplos:
```bash
LogFormat "%h %I %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-Agent}i" agent
```
Para ajustar ou adicionar informações de LogFormat, basta seguir com a edição do arquivo de configuração do apache e buscar por LogFormat
```bash
vim /etc/httpd/conf/httpd.conf
```
Nesse caso, foi feito a criação de um LogFormat customizado
```bash
LogFormat "%h %t \"%r\" %>s %b \"%{User-Agent}i\" **%T/%D** newformat
# %h host
# %t time
# %r request
# %S status
# %b bytes
# Useagent browser
# %t tempo em segundos
# %D tempo em décimos de segundos
```
Salve o arquivo de configuração e seguiremos com o ajuste no Virtual Host que desejamos que o utilize
```
vim /etc/httpd/conf.d/www.apachevm.conf
CustomLog logs/www.apachevm-access_log newformat
```
Salvo o arquivo, basta reiniciar o serviço web.
```bash
service httpd restart
```
## 5. Boas práticas de segurança
Existem algumas ações básicas que podem ser adotadas para manter o seu ambiente mais seguro, os pontos abaixo são as medidas primordiais e quase sempre ignoradas, indico que siga com a aplicação das soluções que vamos abordar para evitar ataques por misconfiguration.
### 5.1 Desligar modo TRACE
Trace é um método que em conjunto com o XSS, dessa forma ele pode ter acesso a informações sensíveis do seu cliente, uma delas é o acesso aos cookies e dados de autenticação então é muito importante que o Trace esteja desativado.
Para verificar se o trace esta habilitado, basta executar o comando abaixo:
```bash
$ curl -X TRACE 127.0.0.1
TRACE / HTTP/1.1
User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
Host: 127.0.0.1
Accept: */*
```
Observe que caso solicitado, os cookies são retornados através dessa solicitação:
```bash
$ curl -X TRACE -H "Cookie: name=value" 127.0.0.1
TRACE / HTTP/1.1
User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
Host: 127.0.0.1
Accept: */*
Cookie: name=value
```
Para desabilitar, basta ajustar a diretiva TraceEnable para "off" diretamente no arquivo de configuração, após feito basta reiniciar o Apache
```bash
TraceEnable off
```
Para verificar se os ajustes foram aplicados, basta executar o comando abaixo e terá o seguinte retorno
```bash
$ curl -X TRACE 127.0.0.1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>405 Method Not Allowed</title>
</head><body>
<h1>Method Not Allowed</h1>
<p>The requested method TRACE is not allowed for the URL /.</p>
</body></html>
```
### 5.2 Ocultar informações do Apache
Ocultar a versão do apache do seu faz com que o seu servidor não retorne a versão instalada, com isso evitaremos alguns ataques direcionados a vulnerabilidades documentadas para a versão, pois uma vez que é sabido a versão utilizada torna-se mais fácil o direcionamento dos ataques. Ocultar essa informação. Para desabilitar isso, basta seguir com edição do arquivo de configuração do httpd e editar as seguinte variáveis dessa forma:
```bash
vim /etc/httpd/conf/httpd.conf
ServerTokens Prod
ServerSignature Off
```
Após feito, basta reiniciar o serviço do apache, verá que a versão do apache não será mais retornado.
### 5.3 Negar acesso a diretórios
Uma prática muito comum é a restrição de acesso a determinado tipos de conteudos ou diretórios, geralmente conteúdo sensível ou administrativo. Nesse tipo de configuração não adotaremos .htaccess, para melhor gerenciamento os ajustes serão aplicados no Virtual Host, uma vez que possuimos acesso direto ao arquivo de configuração.
Para bloqueio de diretórios, é adotado a seguinte estrutura, com essa configuração todo o acesso solicitado para o ambiente /admin será bloqueado, porém o acesso pode ser liberado a determinados endereços adicionando a linha ***Allow from IP*** abaixo do Deny from all
```bash
<Directory "var/www/apachevm/admin">
Order allow, deny
Deny from all
</Directory>
```
Existem diversos tipos de possibilidades para bloqueio e restrição de acesso, vou deixar um link direto para a documentação do [apache](https://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#order) para mais detalhes.
### 5.6 Como proteger versão PHP
Seguindo a mesma linha de pensamento para ocultarmos a versão do apache, é interessante que realizemos o mesmo procedimento para o PHP, mesmo utilizando a versão mais recente e atualizada disponível.
Essas informações de versão PHP podem ser obtidas através do Header response através da diretiva ***x-powered-by***. Para realizar o ajuste, basta seguir com a seguinte configuração no arquivo ***/etc/php.ini*** e ajustaremos a seguinte diretiva:
```bash
expose_php = Off
```
Salvo as configurações, basta reiniciar o serviço web.
## 6. Configuração de SSL
Utilizar um certificado SSL para garantir a segurança de um domínio é impressionável uma vez que os navegadores já acusam como não seguro domínios sem esse recurso, a maioria dos seus visitantes ao visualizar o cadeado de segurança, terão a certeza de estar em um ambiente confiável e que poderão acessar seu sistema ou realizar suas compras e navegar tranquilamente.
### 6.1. Instalação openssl e mod_ssl
Para utilizar desse recurso, é necessário que possua o mod_ssl instalado, no nosso caso, como iremos utilizar um certificado auto assinado, apenas para exemplificação, instalaremos também o openssl.
```bash
yum install mod_ssl openssl
```
### 6.2. Geração de certificado SSL self signed
Para gerar os arquivos para o certificado SSL usaremos o openssl, na geração do arquivo .key o comando abaixo foi utilizado:
```bash
openssl genrsa -out ca.key 2048
```
O próximo passo é realizar a geração do CSR,para isso utilizaremos a nossa key para gerar a CSR:
```bash
openssl req -new -key ca.key -out ca.csr
```
Será solicitado algumas informações, basta preencher os dados conforme forem solicitados ao seu certificado. Com o csr e a key, geraremos o certificado auto assinado:
```bash
openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt
```
Assim já temos o certificado gerado para realização dos testes.
### 6.3. Configuração de vHost e Teste
Com o certificado gerado, basta seguirmos com os ajustes no virtual host para adicionarmos as configurações para a porta 443 segura, viabilizando o acesso https. Acesse o vHost do seu domínio e siga com a adição da seguinte configuração.
```bash
<VirtualHost *:443>
ErrorLog logs/www.apachevm.com_ssl-error_log
CustomLog logs/www.apachevm-ssl_access_log common
LogLevel warn
SSLEngine on
SSLCertificateFile /path/para/certificado.crt
SSLCertificateKeyFile /path/para/privatekey.key
SSLProtocol all -SSLv2
SSLCipherSuite DEFAULT:!EXP:!SSLv2:!DES:!IDEA:!SEED:+3DES
DocumentRoot /var/www/apachevm/
ServerName www.apachevm.com
</VirtualHost>
```
## 7. Testes de carga
Testes de carga é sempre uma ótima escolha para saber se o servidor irá suportara a aplicação antes de hospeda-la em produção, o AB ( Apache Bench) é uma funcionalidade para realização de teste de carga que já vem durante a instalação do Apache que é bastante intuitiva no qual pode ser feito um teste de quantidade e usuários e máximo de requests a serem realizados. O ideal é que a carga seja executada em um servidor diferente do que será testado, nesse exemplo, o teste AB será executado no mesmo servidor apenas para titulo de conhecimento. Segue um exemplo de teste no qual será executado 1000 requests e 50 usuários simultâneos:
```
ab -n 1000 -c 50 https://www.apachevm.com.br
```
É indicado que realize algumas verificações no servidor que esta sendo testado durante as requisições como verificar load, utilização de CPU e Memória.
## 8. Módulos
Os módulos permitem que o Apache execute funções adicionais, dessa forma existem alguns módulos que podem ser instalados no seu servidor para auxiliar em alguns processo de administração e personalização.
### 8.1. mod_rewrite
O módulo mod_rewrite usa um mecanismo de reescrita baseado em regras, baseado em um analisador de expressão regular PCRE, para reescrever URLs solicitados na hora, sendo muito utilizado para a criação de url amigáveis e também redirecionamentos.
Antes de tudo, basta verificar se o modulo mod_rewrite encontra-se instalado e carregado no arquivo de configuração do Apache.
```bash
grep mod_rewrite /etc/httpd/conf/httpd.conf
LoadModule rewrite_module modules/mod_rewrite.so
```
Com o módulo devidamente configurado basta seguir com a implementação das regras de rewrite, nesse caso, iremos ajustar apenas o redirecionamento para https para o nosso vHost
```bash
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
```
Após salvo, basta reiniciar o serviço httpd.
### 8.2. mod_sustitute
A diretiva mod_sustitute especifica um padrão de pesquisa e em seguida de substituição, sendo retornado o valor ajustado para o HTTP Response. Podemos utilizar esse modulo para evitarmos os erros de Mixed Content, no qual consiste em retornos http em uma sessão https, iremos ajustar todos as requests feitas em http forçando a substituição para https.
Antes de tudo, basta verificar se o modulo mod_sustitute encontra-se instalado e carregado no arquivo de configuração do Apache.
```bash
grep mod_sustitute /etc/httpd/conf/httpd.conf
LoadModule substitute_module modules/mod_sustitute.so
```
Seguiremos com a aplicação do seguinte trecho no vHost do nosso domínio:
```bash
AddOutputFilterByType SUBSTITUTE text/html
Substitute "s|http:|https:|"
```
Após salvo, basta reiniciar o serviço httpd.
<file_sep>---
image: /assets/img/AWS.png
title: Migração de disco MBR para GPT
description: GPT é um tipo de tabela de partição para grandes unidades que
excedem o limite de tamanho de 2 TB de MBR.
date: 2021-01-18
category: aws
background: "#FF9900"
tags:
- AWS
- LINUX
---
# Cenário
Máquinas que atingiram o limite de disco de 2TB e precisam ter o sistema operacional migrado para um disco GPT com maior capacidade.
## Processo
GPT é um tipo de tabela de partição para grandes unidades que excedem o limite de tamanho de 2 TB de MBR. O particionamento de disco e a criação de sistema de arquivos para unidades GPT usando ferramentas de disco não são diferentes do MBR. No entanto, para instalar o GRUB nele, precisamos criar uma partição de inicialização do BIOS especificamente para o GRUB.
Para clonar o disco precisamos seguir os seguintes passos, antes de iniciar crie o disco novo e conect com a máquina que o receberá.
#### Criar tabela de partição GPT
Antes de criar a tabela de partição, você deve usar `wipefs` para limpar as assinaturas e evitar avisos. Todos os comandos aqui são executados como usuário `root`
```
wipefs -a /dev/sdb
parted /dev/sdb mklabel gpt
```

A tabela da partição já encontra-se como `gpt`. A unidade /dev/sdb tem 976773164 setores, ou seja, 976773164/2048 = 476940 MiB.
### Crie a partição de inicialização do BIOS
O tamanho razoável para esta partição é 1 MB, ou seja, 2.048 setores por padrão (pode ser mais)
```
parted /dev/sdb mkpart primary 1 2
```

#### Crie uma partição raiz
Usamos todo o espaço em disco restante para criar uma partição como a partição raiz para tentar instalar o GRUB mais tarde. Ou seja, do setor 4096 ao final da unidade, ou seja, do MiB 2 ao MiB 476940
```
parted /dev/sdb unit MiB mkpart primary 2 476940
```
#### Defina o tipo de partição para a partição de inicialização do BIOS
Esta partição precisa ter o tipo adequado para que o GRUB possa encontrá-la automaticamente e, em seguida, gravar a imagem nela
```
parted /dev/sdb set 1 bios_grub on
```

#### Crie um sistema de arquivos para a partição raiz
Crie o sistema de arquivos:
> Crie com o file system que preferir.
```
mkfs.ext4 /dev/sdb2
```
#### Faça a migração do conteúdo entre os discos
Para clona-los, precisaremos montar o disco na máquina e realizar a sincronização do conteúdo:
```
mkdir -p /mnt/new
mount /dev/sdb2 /mnt/new
screen
rsync -axv --progress / /mnt/new
```
#### Instale o GRUB
Finalizado a cópia do conteúdo, instalamos o GRUB em /dev/sdb para garantir que as etapas acima estejam corretas, o GRUB encontra a partição de inicialização do BIOS e a instalação é bem-sucedida
```
grub2-install /dev/sdb --boot-directory=/mnt/new/boot
```
#### Ajustar UUID
Copiado todo o conteúdo e ajustado e disco, basta desmontar o disco e coliar o UUID para o mesmo do original, dessa forma não é necessário ajustes no fstab.
* Verifique as UUID dos discos para que possamos cloná-las `blkid`.
* Com as UUID copiadas, vamos substitui-las com o comando `tune2fs -U "UUID" /dev/sdb2`.
* Feito isso podemos sair e desligar a máquina e trocar os discos.
> Antes de iniciar a máquina, lembre-se que o disco precisa ser montado no mesmo caminho que o antigo, isso ocorrer na aws. Geralmente o ponto de montagem é /dev/sda1<file_sep>---
image: /assets/img/HashiCorp-Terraform-logo.png
title: "Terraform: Gerenciamento de versões e backends"
description: É muito importante que as versões e backends compatíveis com o
projeto desenvolvido seja definida, evitando conflitos ou falta de
compatibilidade.
date: 2021-02-11
category: devops
background: "#05A6F0"
tags:
- Devops
- Terraform
categories:
- Devops
- Terraform
---
No Terraform temos a possibilidade de definirmos algumas regras para o nosso projeto, como onde o seu backend deve ser armazenado e quais as versões de providers e terraform são compatíveis com os nossos módulos.
# Backends
Cada projeto Terraform pode especificar um backend, que define onde e como e onde os arquivos de estado são armazenados etc.
Existem alguns tipos de backends, remoto e local. Se você estiver aprendendo a utilizar o Terraform agora, é indicado que utilize o backend local, que não necessita de nenhuma configuração. Caso tenha pretensão de utiliza-lo de forma profissional, será abordado a configuração de um backend remoto.
## Inicialização
Sempre que o backend de uma configuração muda, você deve executar o `terraform init` novamente para validar e configurar o backend antes de executar qualquer outra operação de plan ou apply.
Ao alterar o backend, o Terraform alertará sobre a possibilidade de migrar seu tfstate para o novo backend. Isso permite que você adote backends sem perder nenhum tfstate existente.
## Backend Remoto
A configuração de um backend remoto se dá através de um bloco de backend dentro do nosso projeto terraform. Abaixo temos como exemplo a configuração de um backend remoto utilizando o s3 na AWS.
```
terraform {
backend "s3" {
bucket = "tfstate-backend"
key = "terraform-teste.tfstate"
region = "us-east-1"
encrypt = true
}
}
```
Acima, estamos referenciando algumas informações referente ao nosso beckend:
* `bucket` = Nome do nosso bucket já criado no s3
* `key` = Nome dado ao nosso arquivo de estado
* `region` = Região do bucket
* `encrypt` = Habilitar criptografia no bucket
# Versões
É muito importante que seja determinado as versões que são compatíveis com o nosso projeto. Amarrar esse tipo de configuração no Terraform faz com que nós tenhamos certeza de que o projeto não quebre quando outras pessoas precisarem utiliza-lo.
O comum nesse caso, para configuração de versões, é criado um arquivo chamado `versions.tf` e nele podemos definir as versões que devem ser utilizadas:
```
terraform {
required_version = "~> 0.14"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}
```
Acima definimos a versão necessária do nosso Terraform e do nosso provider. A expressão `~>` define que apenas as minor releases são aceitas. Por exemplo, caso já esteja disponível a versão 3.0.6 a mesma encontra-se apta para utilização no nosso projeto.
É isso pessoal, espero que tenham entendido a ideia referente a utilização de beckends e configurações de versões. Em nosso próximo artigo abordaremos a configuração de workspaces.<file_sep>---
image: /assets/img/az900.png
title: Microsoft disponibiliza certificação Azure-900 de forma gratuita
description: >-
Em busca de trazer mais profissionais a se capacitarem em seu painel de Cloud,
a Miscosoft lança calendário de cursos preparatórios com Voucher para prova
AZ-900
date: '2020-04-25'
category: news
background: '#D6BA32'
tags:
- Azure
- Microsoft
categories:
- Azure
- Microsoft
---
O Azure da Microsoft é um dos principais serviços de computação em nuvem, é o segundo maior Serviço de Nuvem Pública. Considerando o crescimento do serviço de nuvem pública, o aprendizado do Azure definitivamente oferece mais oportunidades de carreira e crescimento.
Uma das certificações é o Microsoft Certified Azure Fundamentals, você pode ser certificado depois de aprovado no exame AZ-900, que tem como objetivo examinar seu conhecimento sobre o serviço de computação em nuvem e os fundamentos do Azure. Este certificado é opcional se você deseja buscar um nível avançado de certificado, por exemplo, nível associado e nível especialista.
O conteúdo cobrado pela prova é bastante semelhante com o da Oracle Cloud Infraestructure Fundamentals, porém voltada ao Core services oferecidos pela Microsoft.
* Conceitos de Cloud (15–20%)
* Serviços Core Azure(30–35%)
* Segurança, Privacidade, e Confiança(25–30%)
* Valores e suporte (20–25%).
Tendo isso em mente, a microsoft liberou um calendário contendo diversas datas com Webinars que abordam o conteúdo cobrado pela prova e no final das aulas será disponibilizado um Voucher para realização da prova, para conferir as datas e se inscrever basta verificar através desse [link.](https://azure.microsoft.com/en-us/community/events/?query=Microsoft+Azure+Virtual+Training+Day%3A+Fundamentals) Além disso é possível fazer o curso preparatório através da plataforma da [Microsoft Learn](https://docs.microsoft.com/en-us/learn/paths/azure-fundamentals/).
Em breve quando assistir as aulas irei agendar a prova e compartilho minha experiencia com a prova, até a próxima!
<file_sep>---
image: /assets/img/bash.png
title: Canivete suíço para administração de servidores cPanel
description: O cPanel & WHM possui um API para gerenciamento por linha de comando.
date: 2021-07-07
category: linux
background: "#EE0000"
tags:
- linux
---
Quando iniciei a minha jornada profissional, uma das principais plataformas no qual eu trabalhava e prestava suporte era o cPanel e WHM, uma plataforma voltado para hosting e revenda de hospedagem de sites e e-mails.
Apesar da plataforma disponibilziar uma forma de gerenciamento por meio da interface, alguns momentos a administração por linha de comando acabava por ser a forma mais rápida durante uma auditoria ou resolução de um problema.
Uma forma de automatizarmos muitas das atividades por linha de comando é utilizando as API's do cPanel e WHM, possibilitando a execução de processos por linha de comando que antes só poderiam ser realizados por meio da interface web.
Pensando nisso, durante todo esse tempo trabalhando diretamente com o cPanel, acabei por criar um ambiente em shell script que reune alguns desses atalhos por API e algumas outras ferramentas que agilizaram bastante a minha jornada de trabalho.
## Menu
Quando carregado o ambiente terá as seguintes opções:

## Carregar o ambiente
Todo o script ficará disponíivel em meu [github](https://github.com/thiagoalexandria/cpanel) para que possam analisar, para carregar o ambiente no seu servidor basta que sempre que acesse o mesmo carregue da seguinte forma:
```
eval "$(curl -s https://raw.githubusercontent.com/thiagoalexandria/cpanel/master/supas.sh)"
```
Com o ambiente carregado, podemos seguir com a utilização dos comandos para gerenciar o nosso servidor. Na próxima sessão vamos aprender como chamar algumas das principais funções, as demais opções pode ser encontrada no read.me do repositório.
## Principais funções
#### apache_status
Esse comando não precisa de nenhum input, retornará o fullstatus do seu servidor apache, asism como os sockets ocupados e quantidade conexões atuais.
#### restrict_http
Em alguns momentos possivelmente será necessário realizar a restrição de acesso web de um site/usuário cpanel, por exemplo uma conta que teve sua aplicação web comprometida. Para executarmos basta informar o comando acompanhada do nome do usuário cpanel que deseja restringir:
```
restrict_http usuario_cpanel
```
#### enable_spamass
Para uma rápida ativação da condifuguração de SpamAssassin em uma conta cpanel basta que executemos o comando da seguinte forma:
```
enable_spamass usuario_cpanel
```
#### global_spambox
Algumas configurações são essenciais, entre elas a configuração global da caixa de spam das contas de e-mail, basta que executemos o comando sem nenhum input inserido:
```
global_spambox
```
#### mq
Um dos problemas mais comuns em servidores de revenda e hospedagem é o problema frequente com compromentimento de spam ou usuário realizando envio de e-mails em massa para que possamos ter uma visão geral da fila de e-mails podemos executar o comando `mq`:
```
mq
```
#### delfrozen
Seguindo a ideia com problemas de e-mail, temos uma outra função bastante importante que é a `delfrozen` podendo ser utilizada para deletar os e-mails congelados que por ventura permaneceram na fila de e-mails.
#### cpanel_session
As vezes, quando trabalhamos em servidores gerenciados e só possuimos o acesso shell ao servidor, ficamos limitados em algumas açòes que sao realizadas por meio da interface, pois não temos a senha do user root para login.
Uma forma muito simples para resolvermos esse problema é gerar uma sessão do WHM de acesso único, dessa forma a API ira gerar um URL temporário, basta executar o comando `cpanel_session`.
#### autossl
Uma parte importante que podemos utilizar é geração de certificados SSL com o autossl repassando apenas a conta cPanel:
```
autossl usuario_cpanel
```
#### servicestatus
Esse comando sera util pois retorna informações referente aos principais serviços do cPanel como tailwatchd, httpd, mysql, exim, sshd, ftpd, crond, imap, pop. Basta executar o comando `servicestatus`.
Bom espero que tenham curtido esse modelo de postagem, e que utilizem do ambiente para trazer mais praticidade no dia a dia de vocês.<file_sep>import React from 'react'
import Layout from '../components/Layout/'
import Seo from '../components/seo'
import { MainContent } from '../styles/donate'
const DonatePage = () => (
<Layout>
<Seo
title="Doações"
description="Saiba como colaborar com o nosso blog."
/>
<MainContent>
<h1>Donate</h1>
<p>
O Nosso blog surgiu com a necessidade de compartilhar conhecimentos sobre Linux, Devops, Infraestrutura e Automações. Meu objetivo aqui é compartilhar
conhecimento sobre tecnologia para pessoas que não sabem ler em outro idioma a não ser o português.
</p>
<p>
Se você gosta do material desenvolvido por nós e acha que o nosso blog contribui de alguma forma com o seu desenvolvimento e agrega conhecimento
a nossa profissão, contribua com qualquer valor e ajude a manter o blog no ar.
</p>
<h2>Picpay</h2>
<img src="https://thiagoalexandria.com.br/assets/img/Picpay.jpeg" alt="Picpay qrcode" />
<h2>Pix</h2>
<img src="https://thiagoalexandria.com.br/assets/img/Pix.jpeg" alt="Pix qrcode"/>
</MainContent>
</Layout>
)
export default DonatePage
<file_sep>---
image: /assets/img/AWS.png
title: Forçar a configuração de MFA para login no console da AWS
description: Todos nós sabemos que a configuração de uma camada extra de
segurança é sempre bem-vinda, sabendo disso vamos aprender uma forma de forçar
com que os usuários com acesso ao console só possam realizar essas ações se
possuirem o MFA habilitado.
date: 2021-09-10
category: aws
background: "#FF9900"
tags:
- AWS
- MFA
- segurança
- console
- IAM
categories:
- AWS
- MFA
- segurança
- console
- IAM
---
Você pode permitir que seus usuários gerenciem os próprios dispositivos e credenciais de autenticação multifator (MFA) porem como garantiremos que eles realizem a configuração para poder começar a utilizar o console de gerenciamento ?
Em alguns ambientes nao podemos perder tempo para ficar indo pessoa por pessoa e solicitando que encarecidamente o individuo realize a configuração do MFA na sua conta, dessa forma vamos aprender como forçar com que qualquer ação dentro do console só seja possível se o usuário possuir o MFA configurado em sua conta.
### 1: Criar uma política para impor a utilização do MFA
1. Faça login no Console de Gerenciamento da AWS como um usuário com credenciais de administrador.
2. Abra o console do IAM.
3. No painel de navegação, escolha Políticas e, em seguida, Criar política.
4. Selecione a opção JSON e insira o conteúdo abaixo.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowViewAccountInfo",
"Effect": "Allow",
"Action": [
"iam:GetAccountPasswordPolicy",
"iam:ListVirtualMFADevices"
],
"Resource": "*"
},
{
"Sid": "AllowManageOwnPasswords",
"Effect": "Allow",
"Action": [
"iam:ChangePassword",
"iam:GetUser"
],
"Resource": "arn:aws:iam::*:user/${aws:username}"
},
{
"Sid": "AllowManageOwnAccessKeys",
"Effect": "Allow",
"Action": [
"iam:CreateAccessKey",
"iam:DeleteAccessKey",
"iam:ListAccessKeys",
"iam:UpdateAccessKey"
],
"Resource": "arn:aws:iam::*:user/${aws:username}"
},
{
"Sid": "AllowManageOwnVirtualMFADevice",
"Effect": "Allow",
"Action": [
"iam:CreateVirtualMFADevice"
],
"Resource": "arn:aws:iam::*:mfa/${aws:username}"
},
{
"Sid": "AllowManageOwnUserMFA",
"Effect": "Allow",
"Action": [
"iam:EnableMFADevice",
"iam:ListMFADevices",
"iam:ResyncMFADevice"
],
"Resource": "arn:aws:iam::*:user/${aws:username}"
},
{
"Sid": "DenyAllExceptListedIfNoMFA",
"Effect": "Deny",
"NotAction": [
"iam:CreateVirtualMFADevice",
"iam:EnableMFADevice",
"iam:GetUser",
"iam:ChangePassword",
"iam:ListMFADevices",
"iam:ListVirtualMFADevices",
"iam:ResyncMFADevice",
"sts:GetSessionToken"
],
"Resource": "*",
"Condition": {
"Bool": {
"aws:MultiFactorAuthPresent": "false"
}
}
}
]
}
```
O que essa política faz?
A instrução `AllowViewAccountInfo` permite que o usuário visualize informações no nível da conta como visualizar os requisitos de senha e visualizar os dispositivos MFA.
A instrução `AllowManageOwnAccessKeys` permite que o usuário crie, atualize e exclua as próprias chaves de acesso.
A instrução `AllowManageOwnVirtualMFADevice` permite que o usuário crie e atualize o próprio dispositivo MFA virtual.
A instrução `DenyAllExceptListedIfNoMFA` nega acesso a todas as ações em todos os serviços da AWS, exceto algumas ações listadas, mas somente se o usuário não estiver conectado com MFA.
### 2: anexar políticas ao grupo
Anexe a política nos grupos da sua conta no qual os usuarios que acessam o console estao inserido.
### 3: Testar o acesso do usuário
Crie um usuário novo sem nenhuma configuração de MFA, apenas para teste, inserindo no grupo utilizado na Etapa 2. Feito isso basta realizar login e observar que o mesmo não tera permissão para nada além da alteração de MFA, observe:

Pronto, basta inserir os seus usuários no grupo de acesso, ou criar um grupo padrão cujo os usuários devem ser adicionados sempre que for utilizar o console da Amazon. Dessa forma não precisamos nos preocupar pois através do console não será possível realizar nenhuma intervenção sem que exista uma configuração de MFA.
Espero que tenham gostado!<file_sep>---
image: /assets/img/HashiCorp-Terraform-logo.png
title: "Terraform: Variáveis e Outputs"
description: Antes de continuar a ler, quero dizer que este artigo é uma
continuação do nosso último artigo sobre o Terraform, onde há um exemplo
prático em que criamos uma instância ec2.
date: 2021-01-19
category: devops
background: "#05A6F0"
tags:
- terraform
- devops
categories:
- terraform
- devops
---
Antes de continuar a ler, quero dizer que este artigo é uma continuação do nosso último artigo sobre o Terraform, onde há um exemplo prático em que criamos uma instância ec2. Utilizaremos o mesmo código do anterior, portanto, se você ainda não o leu, recomendo fortemente que leia [clicando aqui](https://thiagoalexandria.com.br/criando-uma-instancia-ec2-usando-terraform/).
## Variáveis
Embora nosso código funcione, ele não está limpo. Devemos sempre seguir algumas boas práticas, não apenas para manter o código limpo, mas também para torná-lo fácil de manter.
Imagine o seguinte código em bash:
```
echo "Eu moro em João Pessoa."
echo "João Pessoa é uma cidade litorânea."
echo "João Pessoa é cidade bastante antiga."
echo "Os hoteis de João Pessoa estão lotados."
```
Um código muito simples que imprime apenas algumas strings na tela. Imagine que você precise manter esse código porque sua empresa agora determina que a cidade seja Natal em vez de João Pessoa. Claro, você pode ler e alterar cada linha, linha por linha, mas leva muito mais tempo do que antes. Agora imagine que este sistema tenha centenas de linhas de código. Ou vários arquivos. Mudar tudo se torna cada vez mais complicado e demorado, sem falar que é fácil esquecer um erro. Por outro lado, se nosso código usa uma variável, alteraremos o valor em apenas um lugar, para que possamos ter certeza absoluta de que está correto em todo o código. Por exemplo:
```
cidade="João Pessoa"
echo "Eu moro em $cidade."
echo "$cidade é uma cidade litorânea."
echo "$cidade é uma cidade bastante antiga."
echo "Os hoteis de $cidade estão lotados."
```
Neste código, quando precisamos alterar o nome da cidade e usar Natal em vez de João Pessoa, precisamos apenas alterar o valor da variável na linha 1.
Assim como usamos variáveis na programação, quando pensamos IaC, devemos pensar da mesma forma, afinal estamos programando a infraestrutura.
Este é o arquivo main.tf completo do artigo anterior:
```
provider "aws" {
region = "us-east-1"
shared_credentials_file = "/home/thiago/.aws/credentials"
profile = "default"
}
resource "aws_instance" "Teste" {
ami = "ami-01d025118d8e760db"
instance_type = "t2.micro"
key_name = "Thiago"
tags = {
Name = "lab-terraform-tst"
}
}
```
Vamos então começar a criar algumas variáveis, mas, seguindo as boas práticas do Terraform, criaremos um arquivo separado para nossas variáveis.
Crie um arquivo chamado variables.tf, em inglês, dessa forma quando chamamos uma variável no código, o Terraform saberá onde procurar o valor da variável.
Para cada variável daremos um nome, uma descrição e um valor *default*. Dessa forma o nosso arquivo ficará assim:
```
variable "inst_ami" {
type = "string"
description = "ami que será utilizado"
default = "ami-01d025118d8e760db"
}
variable "inst_type" {
type = "string"
description = "Familia da instância"
default = "t2.micro"
}
variable "inst_key" {
type = "string"
description = "Chave que deve ser utilizada"
default = "Thiago"
}
variable "tags" {
type = "map"
description = "Tags a serem aplicadas à nossa instância."
default = {
"Name" = "lab-terraform-tst"
"Ambiente" = "Desenvolvimento"
}
}
```
O que foi feito:
1. Criamos 4 variáveis aqui: inst_ami, inst_type, inst_key, tags;
2. Para cada variável nós declaramos o seu tipo, descrição e valor padrão.
3. Nem sempre é necessário declarar variáveis. Às vezes podemos criar uma variável que não tem nenhum valor atribuído, então o valor será passado durante a execução do código
4. A *description*, ou descrição, é um atributo também opcional, mas ajuda a identificar melhor o que se pretende com aquela variável e costuma ser uma boa prática
Voltando ao nosso arquivo *main.tf,* é necessário alterar um pouco nosso código para que possamos fazer uso destas variáveis, dessa forma observe abaixo o bloco principal:
```
resource "aws_instance" "Teste" {
ami = var.inst_ami
instance_type = var.inst_type
key_name = var.inst_key
tags = var.tags
}
```
Ajustado os valores das variáveis, basta seguir com os testes e iniciar o plan do Terraform.
## Outputs
O output serve para que seja retornado informações para o administrador após o apply, como por exemplo o ip da máquina. Dessa forma comecemos criando um arquivo chamado *outputs.tf* com o seguinte conteúdo:
```
output "ip_address" {
value = aws_instance.Teste.public_ip
}
```
Feito isso, quando executarmos o plan novamente o Terraform externalizará as informações obtidas no output como no exemplo abaixo:
```
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
Outputs:
ip_address = 172.16.31.10
```
Em meu próximo post pretendo elevar um pouco o nível e utilizar o Terraform exemplificando a sua utilização com módulos externos e como os chamados em nosso código..<file_sep>---
image: /assets/img/HashiCorp-Terraform-logo.png
title: Terraform CLI Cheat Sheet
description: 'Alguns comandos e definições '
date: '2020-07-14'
category: devops
background: '#05A6F0'
tags:
- Terraform
categories:
- Terraform
- Devops
---
O Terraform possui uma interface por linha de comando bastante poderosa e bem intuitiva, abordaremos dessa forma alguns comandos interessantes e que trará produtividade.
## 1. Formatação
O Terraform possui o comando ` terraform fmt` para garantir que os seus arquivos `.tf` vão estar sempre bem formatados, é possível a partir dai aplicar os ajustes indicados ou liberar apenas de forma visual:
```shell
terraform fmt -recursive -diff
terraform fmt -check -recursive -diff
```
## 2. Validação
O comando `terraform validade` valida os arquivos de configuração em um diretório, referindo-se apenas à configuração e não acessando nenhum serviço remoto, como estado remoto, APIs do provedor etc. Para isso é necessário desativar o nosso backend:
```shell
terraform init -backend=false
terraform validate -json
```
Se tudo estiver correto, será retornado algo semelhante a o trecho abaixo:
```shell
{
"valid": true,
"error_count": 0,
"warning_count": 0,
"diagnostics": []
}
```
## 3. Workspace
O comando `terraform workspace` permite o trabalho em diferentes áreas de trabalho, abrindo a possibilidade de trabalho em ambientes de testes ou produção.
- Criar workspace
```shell
terraform workspace new dev
```
- Selecionar workspace
```shell
terraform workspace select dev
```
- Listar workspace
```shell
terraform workspace list
```
Um exemplo seria a criação de instâncias em regiões diferentes caso o workspace não seja o desejado:
```shell
provider "aws" {
region = terraform.workspace == "production" ? "us-east-1" : "us-east-2"
shared_credentials_file = "/home/thiago/.aws/credentials"
profile = "default"
}
```
## 4. Graph
Quando se tem um projeto finalizado é possível criar um grafo de todo o fluxo do projeto:
```shell
terraform graph | dot –Tpng > graph.png
```
## 5. Autocomplete
É possível também habilitar a opção de autocomplete, pra quem vem do linux é uma mão na roda para evitar repetição de escrita, apenas apertando `Tab`, para habilitar basta rodar o comando de instalação:
```shell
terraform -install-autocomplete
```
Espero que gostem, esses são apenas alguns dos comandos e possibilidades para utilizar juntamente ao Terraform, até a próxima!
<file_sep>---
image: /assets/img/AWS.png
title: Desvendando os Segredos dos S3 Access Points Acesso Eficiente e Seguro ao
Armazenamento na Nuvem
description: "Nessa postagem exploraremos um dos recursos mais poderosos do
Amazon S3: os S3 Access Points, ele pode revolucionar a maneira como você
gerencia o acesso e a segurança aos seus dados armazenados na nuvem"
date: 2023-06-02
category: aws
background: "#FF9900"
tags:
- s3-access-points
- armazenamento
- cloud
- aws
- seguranca
- acesso
- controle
- politicas
- simplificacao
- governanga
- urls
- granularidade
- monitoramento
- metricas
- dados
- endpoint
- recurso
- gerenciamento
- s3
categories:
- s3-access-points
- armazenamento
- cloud
- aws
- seguranca
- acesso
- controle
- politicas
- simplificacao
- governanga
- urls
- granularidade
- monitoramento
- metricas
- dados
- endpoint
- recurso
- gerenciamento
- s3
---
## O que são S3 Access Points?
Os pontos de acesso S3 são endpoints personalizados que fornecem acesso simplificado e seguro ao armazenamento no Amazon S3. Eles permitem que você controle o acesso granular aos seus dados, definindo políticas de acesso específicas para diferentes usuários, grupos ou aplicativos. Essa abordagem simplifica a organização e a segmentação do acesso aos buckets do S3, fornecendo uma camada adicional de segurança.

## Benefícios dos S3 Access Points
* `A simplificação da gestão do acesso do S3`: Os pontos de acesso do S3 permitem que você controle de forma centralizada as políticas de acesso aos seus buckets do S3. Isso torna o controle de acesso mais fácil de gerenciar e também mais simples, especialmente em ambientes onde há várias equipes e aplicativos.
* `Acesso granular`: Os Pontos de Acesso S3 permitem que você crie regras de acesso exclusivas para cada endpoint. Isso reduz o risco de exposição indesejada, pois permite que apenas entidades autorizadas interajam con os dados.
* `Personalização da estrutura de URLs`: Você pode simplificar os URLs de acesso aos seus objetos usando pontos de acesso S3. Você pode usar um formato mais fácil de entender e lembrar, como `accesspoint.example.com/objectkey`, em vez de URLs com a estrutura de nome de bucket padrão.
* `Monitoramento`: Os S3 Access Points fornecem logs detalhados e métricas de acesso, permitindo que você acompanhe e audite facilmente as atividades realizadas em cada ponto de acesso. Isso contribui para uma postura de segurança mais robusta e ajuda na detecção de possíveis anomalias ou ameaças.
## Como começar a usar S3 Access Points
Aqui estão alguns passos para começar a utilizar os S3 Access Points:
### Crie um S3 Access Point
No Console de Gerenciamento da AWS ou por meio da API, você pode criar um novo Access Point para o seu bucket do S3. Iremos realizar a criação através do console de gerenciamento, para isso acesse ou crie o seu bucket s3 e no menu superior clique em `pontos de acesso` ou `access points`:

Aqui você notará que tem a opção de escolher o tipo de acesso que será Virtual Private Network se quiser restringir seu ponto de acesso a uma VPC ou Internet se quiser que usuários fora da sua VPC também tenham acesso, no nosso laboratório será utilizado internet pois eu mesmo irei acessar:

Defina políticas de acesso, configure as políticas de acesso no Access Point para controlar quem pode acessar os dados e quais ações estão permitidas, o principal pode ser definido igual uma bucket policy, sendo um usuário do IAM, uma role, um serviço, segue um modelo abaixo:
```
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowAccessToAccessPoint",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<conta>:user/user"
},
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Resource": "arn:aws:s3:<região>:<conta>:accesspoint/<nome-do-access-point>/object/<prefixo>/*"
}
]
}
```

Garanta que as mesmas permissões constem na bucket policy, feito isso, agora, você pode acessar os dados no seu bucket do S3 por meio do Access Point, usando o URL personalizado ou através do aws cli no seguinte formato:
```
aws s3 cp <caminho_do_arquivo> s3://<nome_do_access_point>/<caminho_no_bucket>
```
## Conclusão
Os S3 Access Points são uma ferramenta poderosa para simplificar o gerenciamento de acesso e aumentar a segurança ao utilizar o Amazon S3. Ao permitir um controle granular e centralizado do acesso aos dados, os S3 Access Points oferecem uma solução robusta e eficaz para o gerenciamento de acesso, sendo mais eficiente e simples de usar que as antigas Buckets ACLs.
Espero que tenham gostado!<file_sep>---
image: /assets/img/bash.png
title: Sincronização com Rsync
description: O Comando Rsync Linux transfere e sincroniza arquivos ou diretórios
de forma eficiente em uma máquina local ou entre hosts.
date: 2021-04-29
category: linux
background: "#EE0000"
tags:
- Linux
categories:
- Linux
---
Sincronizar pastas ou copiar arquivos manualmente pode consumir muito tempo. A utilidade do Rsync pode fazer a maior parte do trabalho adicionando recursos ótimos para economizar tempo.
Qualquer um que trabalhe com sistema Linux deve conhecer e utilizar esse comando poderoso para melhorar sua produtividade. E com a ajuda deste artigo, você vai aprender tudo o que precisa saber para começar a usar.
O rsync pode ser utilizado de forma local, no mesmo servidor, por exemplo executar uma rotina de backup salvando em um disco de backup, como também pode ser utilizado entre servidores remotos através do SSH.
### Sintaxe básica
A utilização do rsync e bem simples, consiste na seguinte estrutura:
```
rsync [opcionais] [SRC] [DEST]
```
Neste exemplo, [opcionais] indicam as ações a serem tomadas, [SRC] é o diretório de origem e [DEST] é o diretório ou a máquina de destino.
Quando se fizer necessário a utilizaçao entre hosts, por SSH ou RSH, a sintaxe do rsync seguira da seguinte forma:
```
# Baixar de algum host para o ambiente local
rsync [opcionais] [USUÁRIO]@[HOST]:[SRC] [DEST]
# Enviar do ambiente local para host remoto
rsync [opcionais] [SRC] [USUÁRIO]@[HOST]:[DEST]
```
### Opcionais
Aqui está uma lista dos opcionais mais comuns e usados com o rsync:
Este habilita o modo de arquivo.
```
-a, --archive
```
Este dá a você uma saída visual que mostra o progresso do processo.
```
-v, --verbose
```
Já o próximo exibe o output num formato legível para humanos.
```
-h, --human-readable format
```
Esse aqui comprime os dados dos arquivos durante a transferência.
```
-z, --compress
```
Este copia os dados recursivamente
```
-r
```
Isto diz ao rsync para evitar cruzar os limites do sistema de arquivos quando for recorrente
```
-x, --one-file-system
```
Para finalizar, temos o que mostra o progresso de sincronização
```
--progress
```
### Exemplos
Temos alguns exemplos sobre a utilização do comando, observe algumas indicações de uso:
```
# Sincronizar um diretório de backup para um usuário
rsync -avx --progress /backup/user/Documentos/ /home/user/Documentos/
# Enviar um backup para um servidor externo
rynx -avx --progress /backup/app1/backup.tar.gz [email protected]:/usr/local/app1/
```
Bom, espero que tenham compreendido sobre como o rsync funciona e alguns cenários para sua aplicação, até a próxima!
<file_sep>---
image: /assets/img/bash.png
title: 'Criar, Monitorar e Encerrar Processos'
description: >-
Entender melhor os comandos antes de utiliza-los é muito importante, então
segue alguns dos mais comuns quando falamos em gerenciamento de processos no
linux..
date: '2020-08-05'
category: linux
background: '#EE0000'
tags:
- Bash
- Linux
---
Um processo é um serviço, comando, programa, script ou qualquer tipo de atividade que precise diretamente do sistema para ser executada. No linux podemos identificar processos através do seu PID (Process ID) ou PPID (Parent Process ID).
Existem algum comandos que podemos utilizar para identificar e gerenciar esses processos, um deles é o comando `PS`, um comando do unix utilizado para mostrar os processos em execução.
Exibição de processos ativos por usuário:
```bash
thiago@THIAGO-PC:~$ ps -u
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
thiago 4464 0.0 0.1 23184 6048 pts/18 Ss 14:21 0:00 bash
thiago 6885 0.0 0.0 23076 5640 pts/22 Ss+ 14:49 0:00 bash
thiago 7075 0.0 0.0 37404 3412 pts/18 R+ 14:52 0:00 ps -u
```
Exibição de todos os processos do usuário inclusive os não pertencente a pts do cliente:
```
thiago@THIAGO-PC:~$ ps -ux | less
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
thiago 1269 1.4 2.9 3168076 172888 ? Sl 13:56 0:56 /snap/spotify/16/usr/share/spotify/spotify
thiago 4022 1.1 1.4 708912 82836 ? Sl 14:17 0:31 /opt/google/chrome/chrome
thiago 31943 0.8 1.3 1284500 76856 ? Ssl 13:34 0:45 /opt/sublime_text/sublime_text
```
Exibição de todos os serviços, de todos os usuários.
```
thiago@THIAGO-PC:~$ ps -ux | less
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 185264 5032 ? Ss 07:59 0:02 /sbin/init splash
root 2 0.0 0.0 0 0 ? S 07:59 0:00 [kthreadd]
root 4 0.0 0.0 0 0 ? I< 07:59 0:00 [kworker/0:0H]
thiago 31943 0.8 1.3 1284500 76856 ? Ssl 13:34 0:45 /opt/sublime_text/sublime_text
```
É possível filtrar a saída do comando ps utilizando grep, para obter processos referente a serviços específicos, como por exemplo `ps faux | grep sublime`, ou então podemos utilizar um outro comando, o `pgrep`.
O `pgrep` procura por todos os processos com determinado nome e retorna o seu ID, observe:
```
thiago@THIAGO-PC:~$ pgrep spotify
1269
1493
1515
1539
```
## Monitoramento de processos
Para o monitoramento de processos ativos temos disponíveis o comando `top` ou `htop` dessa forma teremos como obter informações como load, processos ativos, parados, uso de memoria, uso de cpu, usuário logados, uptime.
```
thiago@THIAGO-PC:~$ top
top - 17:09:44 up 9:10, 2 users, load average: 0,66, 1,37, 1,53
Tarefas: 327 total, 2 executando, 271 dormindo, 0 parado, 2 zumbi
%Cpu(s): 5,1 us, 1,7 sy, 0,0 ni, 91,6 id, 1,7 wa, 0,0 hi, 0,0 si, 0,0 st
KiB Mem : 5898388 total, 380928 free, 3942560 used, 1574900 buff/cache
KiB Swap: 6083580 total, 5505788 free, 577792 used. 952804 avail Mem
PID USUÁRIO PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
27244 thiago 20 0 1275348 74016 29316 S 5,0 1,3 19:48.22 compiz
27485 thiago 20 0 1394896 296652 89808 S 3,3 5,0 29:06.35 chrome
```
Dentro da interface top, temos alguns atalhos para filtrar melhor as informações que precisamos obter, observe:
```
Shift+m : Ordena exibição por uso de memória
Shift+c : Ordena exibição por uso de CPU
u : Ordena exibição por usuário desejado
r : Alterar prioridade de exução do processo
n : Escolher quantas task são exibidas
k : Kill um processo de acordo com o PID
q : Quit
```
## Finalizar processos
Agora que sabemos identificar os processos ativos em nosso ambiente, é comum que em alguns casos tenhamos que parar um processo devido a consumo de recursos ou mal funcionamento do serviço/processo, para isso temos o comando `kill`, `killall`, `pkill`.
O comando kill é o mais utilizado, esse comando envia um sinal para o processo, seja para finalização, reinicialização, parar ou até interromper. O comando `kill -l` retorna os sinais que o comando kill pode enviar:
```
thiago@THIAGO-PC:~$ kill -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP
6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1
11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM
```
Abaixo podemos observar o que cada sinal significa:
```
SIGHUP 1 Termina ou reinicia um processo. Utilizado também para
que arquivos de configuração de um programa sejam
relidos.
SIGINT 2 Interrompe a execução de um processo. Relacionado ao
Ctrl+C
SIGQUIT 3 Termina um processo e normalmente gera um arquivo de
dump
SIGKILL 9 Finaliza um processo de maneira imediata e incondicional.
SIGTERM 15 O sinal solicita que o processo se finalize. Sinal padrão do
comando kill.
SIGSTP 20 Interrompe um processo permitindo que ele possa ser
retomado. Relacionado ao Ctrl+Z
SIGCONT 18 Continua a execução de um processo pausado (pelo sinal
20 por exemplo)
```
Por padrão o sinal enviado é o SIGERM, para finalizar um processo repassamos o `PID` como parâmetro para o kill, dessa forma podemos utilizar os comandos vistos anteriormente para obter o ID do processo:
```
thiago@THIAGO-PC:~$ pgrep firefox
12259
thiago@THIAGO-PC:~$ kill 12259
thiago@THIAGO-PC:~$ pgrep firefox
thiago@THIAGO-PC:~$
```
Para finalizar com o SIGKILL podemos passar da seguinte forma:
```
thiago@THIAGO-PC:~$ kill -s SIGKILL 12596
ou
thiago@THIAGO-PC:~$ kill -s 9 12596
ou
thiago@THIAGO-PC:~$ kill -9 12596
```
O comando `killall` finaliza todos os processos, que o usuário seja dono, com o nome passado por parâmetro:
```
killall firefox
```
O comando `pkill` finaliza os processos de determinados usuários, geralmente utilizado pelo root para gerenciamento de processos de outros usuários.
```
root@THIAGO-PC:~# pkill -9 firefox -u thiago
```
Espero que tenham curtido o conteúdo de hoje, gerenciamento de processos é algo bem comum e bastante utilizado por nós administradores de sistemas, até a próxima pessoal!
<file_sep>---
image: /assets/img/nginx-1.jpg
title: "Desmistificando o Nginx: parte 1"
description: NGINX é um software de código aberto para serviço da Web, proxy
reverso, cache, balanceamento de carga, streaming de mídia e muito mais.
date: 2021-02-03
category: linux
background: "#EE0000"
tags:
- Linux
- Nginx
categories:
- Linux
- Nginx
---
Ele começou como um servidor web projetado para máximo desempenho e estabilidade. Além de seus recursos de servidor HTTP, o NGINX também pode funcionar como proxy para e-mail (IMAP, POP3 e SMTP) e um proxy reverso e load balancer para servidores HTTP, TCP e UDP.
Nesse cenário será utilizado o CentOs7 como sistema operacional, o processo de instalação pode variar dependendo da distribuição utilizada.
# Instalação
As etapas neste tutorial requer que o usuário tenha privilégios de root.
1- Adicionar o repositório EPEL
```
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
```
2- Instalar o Nginx
```
yum install nginx
```
3- Habilitar e iniciar
```
systemctl enable nginx
systemctl start nginx
```
4- Ajustar o firewall e SELinux
Caso utilize firewalld basta adicionar as seguintes regras:
```
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
```
Para que o nginx possa utilizar operar sem maiores problemas, é indicado que o libere também no SELinux, basta executar o comando:
```
semanage permissive -a httpd_t
```
Com o Nginx instalado e habilitado, seguiremos com a configuração do mesmo.
# Configuração
Abordaremos algumas configurações e opções que são úteis no dia a dia, para você que a administra um servidor Nginx e para os que estão migrando.
### Criando um Vhost
Será utilizado o arquivo `.conf` padrão do nginx:
```
vim /etc/nginx/nginx.conf
```
Podemos limpar o arquivo `nginx.conf` e deixar apenas o esqueleto do nosso Vhost, utilizaremos o path default do Nginx para o exemplo:
```
events {}
http {
include mime.types;
server {
listen 80;
server_name 192.168.18.3;
root /usr/share/nginx/html/;
}
}
```
Configurado isso, acesse o diretório `/usr/share/nginx/html`, pode remover todos os arquivos, crie o nosso `index.html` apenas com um Hello World:
```
<!DOCTYPE html>
<html>
<head>
<title> Hello World Nginx! </title>
</head>
<body>
<h1> Hello World Nginx! </h1>
</body>
</html>
```
Feito isso, basta recarregar o nginx com o comando:
```
nginx -s reload
```
Pronto, colocando o ip da nossa máquina pelo navegador já deve ter o acesso sem problemas.
### Locations
O location é usado para definir como o Nginx deve lidar com solicitações de diferentes recursos e URLs para o servidor, conhecido como subpastas, dessa forma podemos definir o que acontece quando acessamos: `http://IP/Teste` se desejamos criar uma subpasta para ele ou se desejamos configurar regras.
A partir disso criaremos um location chamado Teste. Informaremos ao servidor web que deverá retornar o status code 200 além de repassar na tela uma informação diferente do nosso Hello World inicial. Observe:
```
events {}
http {
include mime.types;
server {
listen 80;
server_name 192.168.18.3;
root /usr/share/nginx/html/;
location ^~ /Teste {
return 200 'Hello World NGINX "/Teste" location.';
}
}
}
```
Após ajustado, realize o reload do nginx `nginx -s reload` e tente acessar o url: `http://IP/Teste`
### Variáveis
O Nginx possui algumas variáveis que podem ser configuradas para facilitar o gerenciamento de algumas informações, nos aprofundaremos mais na parte de proxy reverso, no qual aplicaremos algumas configurações no redirecionamento.
O próprio Nginx possui uma página que reúne várias variáveis e as suas aplicabilidades basta [clicar aqui](http://nginx.org/en/docs/varindex.html).
Dessa forma, crie uma location para retornar na tela algumas informações para inspecionarmos:
```
events {}
http {
include mime.types;
server {
listen 80;
server_name 192.168.18.3;
root /usr/share/nginx/html/;
location ^~ /Inspect{
return 200 '$host\n$uri\n';
}
}
}
```
Feito isso, basta fazer o reload do nginx e acessar o url `http://IP/Inspect` verá que será retornado na tela algumas informações do host.
### Rewrites e Redirects
Os Rewries e Redirects são amplamente utilizados, um cenário para isso seria quando precisamos forçar que todas as requisições sejam feitas utilizando https, dessa forma realizamos um rewrite.
O redirecionamento simplesmente informa ao cliente para onde deverá ir o redireciona, por exemplo:
> O visitante acessa http://IP/redirect e o servidor redireciona o url movendo o visitante para o url http://IP/new-redirect
O Rewrite, faz o mesmo processo porém de forma interna e transparente, em poucas palavras, ele redirecionará e o url não será alterado.
Observe algumas configurações de locations para cada cenário:
```
location ^~ /Redirect{
return 307 /Destino-Redirect;
}
location ^~ /Rewrite{
rewrite ^/Rewrite/\w+ /Desino-Rewrite ;
}
```
Quando acessado o url `/Redirect` veremos que a sua url será alterado para `/Destino-Redirect`. diferente no Rewrite, que por fazer o direcionamento de forma transparente para o usuário, redirecionará o acesso para `/Destino-Rewrite` porém irá manter o url `/Rewrite`.
Esse é o funcionamento básico de como funciona os redirecionamentos, existem outras formas e caso tenham interesse basta acessar o [link](https://www.nginx.com/blog/creating-nginx-rewrite-rules/).
### Logs
O Nginx grava registros de seus eventos em dois tipos de logs, logs de acesso e logs de erro. Os logs de acesso gravam informações sobre solicitações do cliente e os logs de erros gravam informações sobre os problemas do servidor e do aplicativo.
Para configurarmos os logs basta adicionar a diretiva e o caminho absoluto cujo o arquivo será gerado:
```
...
http {
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
...
```
Os logs também podem ser formatados, com a configuração da diretiva `log_format`, isso permite adaptar as informações que serão armazenadas no log, ou remover informações não necessárias, o mais comum e o padrão adotado é o `log_format combined` que reúne várias informações suficientes para análise.
### Workers
O NGINX pode executar vários processos, cada um capaz de processar um grande número de conexões simultâneas. É possível controlar o número de workers e como eles lidam com as conexões com as seguintes diretivas:
`worker_processes`: O número de workers, o padrão é 1. Na maioria dos casos, a execução de um processo de trabalho por núcleo da CPU funciona bem, e recomendamos definir essa diretiva como automática para conseguir isso. Há momentos em que você pode querer aumentar esse número, como quando os processos de trabalho precisam fazer muita E/S de disco.
`worker_connections`: Essa diretiva define o número máximo de conexões que cada processo de trabalho pode manipular simultaneamente. O padrão é 512, mas a maioria dos ambientes possuim recursos suficientes para suportar um número maior.
Dessa forma basta configurar o `worker_processes` como auto e ajustaremos a quantidade de conexões em 1024:
```
...
worker_processes auto;
events {
worker_connections 1024;
}
...
```
Para não ficarmos com muito conteúdo e várias abordagens, daremos continuidade com a parte de Performance, Segurança e Proxy na parte dois desse artigo, espero que tenham gostado do material, tentei trazer o máximo de informações sobre as principais configurações que tenho tido vivencia.
Até a próxima.<file_sep>---
image: /assets/img/HashiCorp-Terraform-logo.png
title: HashiCorp Terraform Associate (002)
description: Passei na HashiCorp Terraform Associate (002) e gostaria de
compartilhar com vocês a minha experiência.
date: 2023-04-24
category: devops
background: "#05A6F0"
tags:
- Terraform
- certified
- pass
- devops
- iac
categories:
- Terraform
- certified
- pass
- devops
- iac
---
## Porque eu decidi fazer a prova?
Hoje dia 24/04 fiz a prova HashiCorp Terraform Associate (002), já venho trabalhando com Terraform a um bom tempo, ajudando a implantar e criar a cultura de IaC dentro das empresas em que trabalhei e apesar de ja ter vontade de tirar essa certificação antes deixei para depois.

Decidi realizar a prova no inicio do mês de Abril e achei bem simples me preparar para o exame, a HashiCopr possui um guia para que você entenda as competências cobradas pelo exame e disponibiliza também o material de estudos baseado nesse guia.
<https://www.hashicorp.com/certification/terraform-associate>
Bom, nessas tres semanas de preparação acabei realizando um curso na Udemy dos professores [<NAME>](https://www.udemy.com/user/bryan-krausen/) e [<NAME>](https://www.udemy.com/user/gabe-maentz-2/), o curso é dividido de acordo com o guia oficial e possui a todo momento várias aplicações praticas, aproveitei para revisar os conceitos básicos e aprofundar em assuntos que não utilizo no meu dia a dia como Terraform Cloud / Enterprise, assim como pontos mais complexos como manuseio de state files e debug. Os mesmos professores possuem também um curso disponível apenas com Simulados, achei muito importante foi o melhor material de simulado que encontrei disponível e acredito que o nível das questões são bem fieis aos cobrados na prova.
<https://www.udemy.com/course/terraform-hands-on-labs/>
<https://www.udemy.com/course/terraform-associate-practice-exam/>
Falando da prova, se você ja utiliza Terraform na sua empresa e já possui experiencia prtica com a tecnologia, a prova não será difícil. A prova contem entre 57 e 60 questões que podem variar entre múltipla escolha, verdadeiro e falso, mais de uma correta e complete os espaços em branco. Para essa prova é interessante que entenda os principais comandos e flags, assim como declarações de variáveis e tipo de funções intrínsecas.
Na minha opinião a prova foi bem fácil, você ter uma ideia de como as questões são através dos exemplos abaixo:
1)The terraform.tfstate file always matches your currently built infrastructure.
A. True
B. False
2)Which provisioner invokes a process on the resource created by Terraform?
A. remote-exec
B. null-exec
C. local-exec
D. file
3)What command does Terraform require the first time you run it within a configuration directory?
A. terraform import
B. terraform init
C. terraform plan
D. terraform workspace
4)Terraform init initializes a sample main.tf file in the current directory.
A. True
B. False
Respostas:
1.B, 2.A, 3.B, 4.B<file_sep>---
image: /assets/img/AWS.png
title: Acessando uma EC2 atraves do SSM
description: O Session Manager permite que você estabeleça conexões seguras para
as instâncias EC2
date: 2021-11-20
category: aws
background: "#FF9900"
tags:
- SSM
- AWS
- EC2
categories:
- SSM
- AWS
- EC2
---
## Oque é o Session Manager
## Configurar o Session Manager
O Session Manager oferece suporte a Linux, MacOS e Windows Server 2012 até o Windows Server 2019, sabendo disso vamos precisar seguir alguns passos para que possamos utilizar o AWS SSM em nossa EC2.
#### 1. Criar uma IAM Role com acesso ao SSM
Acesse o painel de gerencimaento do **`IAM`** e selecione a opção **`Roles`** em seguida seleciona a opção **`Create Role`**.

Precisamos criar uma role baseada em serviços entao selecione a opção **`AWS Services`** e busque por **`Ec2`** e **`Next`**.
Agora busque pela police gerenciada pela Amazon chamada `AmazonEC2RoleforSSM` e Next.

Adicione as tags conforme sua organizaçao determina e em seguida de um nome para sua role, nesse caso coloquei o nome de `Ec2RoleSSM`.

#### 2. Atachar a role em uma EC2
Pelo console da Amazon, acesse o painel de instâncias dentro de EC2, la você encontrara todas sa suas instâncias:

Selecione a instância com botão direito e selecione `Security > Modify IAM Role`

Selecione a IAM Role que criamos anteriormente e aplique.
#### 3. Instalar o Agent
Em instâncias que não Amazon Linux á necessário realizar a instalação do SSM Agent para que a partir dai possamos gerar uma sessão pelo console da Amazon utilizando o SSM.
Nesse ponto, existem duas possibilidades, você pode criar uma instância EC2 configura-la com o SSM e a partir dela gerar uma AMI para sempre que lançar uma nova EC2 a partir dessa AMI já ter as configurações de SSM instaladas, ou sempre que lançar uma AMI do marketplace acessar primeiro por SSH e instalar os pacotes necessários.
Vamos realizar o processo de configuração em uma instância Ubuntu recem criada a partir de uma imagem do marketplace.
#### 3.1. Acesse a instancia por SSH
Utilize um cliente SSH para acessar a instância utilizando a private key que definimos durante a criação, por exempo:
```
ssh [email protected] -i thiagoalexandria.pem
```
#### 3.2. Instale o ssm agent
Nesse exemplo estamos utilizando o ubuntu, porem não precisa se preocupar o processo é bem semelhante, basta seguir com a instalação baseada no seu sistema operacional atraves da documentação. Pelo Ubuntu basta instalar utilizando o `snap`, da seguinte forma:
```
sudo snap install amazon-ssm-agent --classic
```
#### 3.3. Habilite e inicie o serviço
No ubuntu, como observado, temos alguma mudanças na forma com que o serviço e chamado devido a instalação ocorrer pelo snap. Dessa forma segue abaixo os comandos para gerencia-lo pelo `systemctl`.
```
systemctl start snap.amazon-ssm-agent.amazon-ssm-agent.service
systemctl status snap.amazon-ssm-agent.amazon-ssm-agent.service
systemctl stop snap.amazon-ssm-agent.amazon-ssm-agent.service
```
Outra forma e gerencia-lo pelo `snap`:
```
snap services amazon-ssm-agent
snap list amazon-ssm-agent
snap start amazon-ssm-agent
snap restart amazon-ssm-agent
```
#### 3.4. Acesse a instancia pelo SSM
Pronto, agora basta seleciona a instância e clicar em `Connect`, feito isso sera redirecionado para o painel no qual você podera escolher a forma de conexão, selecione o **`Session Manager`** e `Connect`.


## Trabalhando com Session Manager
Caso prefira trabalhar atraves do console, e possível criar uma sessão ssm utilizando o `aws cli`, para isso basta que realizemos algumas configurações em nossa máquina local.
Sera necessário que instalemos o Session Manager plugin em nosso sistema operacional, para isso basta seguir com o tutorial especifico para o seu sistema através da documentação [oficial](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html).
Com o plugin instalado sera possível criarmos uma sessão para o ssm e utilizar como se fosse ssh, para isso basta que busque o id da instância e execute o comando da seguinte forma:
```
aws ssm start-session --target <instance-id>
```
Obseve:

Espero que tenham entendido o poder e facilidade de termos o SSM instalado na nossa infraestutura que roda dentro da AWS, qualquer dúvida podem deixar no campo de comentários que vamos respondendo.<file_sep>---
image: /assets/img/AWS.png
title: AWS Certified Solutions Architect – Associate
description: No dia 1 de Novembro me tornei um arquiteto de soluções
certificado, certificação essa que reune diversos tópicos sobre soluções
focado em produtos AWS.
date: 2021-11-02
category: aws
background: "#FF9900"
tags:
- AWS
- SAA-C02
- Certified
categories:
- AWS
- SAA-C02
- Certified
---
A SAA-CO2 foi de longe umas das provas mais desafiadoras que ja fiz, trabalho com a nuvem da AWS desde março de 2020 e sempre tive vontade de me aprofundar em seus produtos e foi quando entrei na Dock que pude a partir dai comecar a aprender, estudar e gerenciar os servicos.
A maior barreira referente aos estudos eram quando tinha que estudar alguns serviços que a empresa não utilizava no dia a dia, como o Kinesis, serviços voltados a AD e Windows e alguns outros serviços como AWS Glue, AWS X-ray, AWS OpsWorks, AWS Elastic Beanstalk.
Utilizei a Udemy como plataforma de estudo e foi com o curso do professor [<NAME>](https://www.udemy.com/share/102CPB3@xYG1_vYvd3URFpUna_CbcV7QjwWhLa0Lp1qF_ik0f56nHK3xsur_4wy588Aamqh6/) que me ajudou muito pois o curso possui varias aulas que são constantemente atualizadas e com um nível de detalhes surpreendente.
Comprei e agendei minha prova em Julho e acho que esses três meses foram mais que o sulficiente para realização do exame, aproveitei o voucher de 50% oferecido pela Amazon como incentivo atraves do Solutions Architect Challenge pagando penas $75.
Na época não existia a prova em português e devido a todo o material de estudo ser em inglês preferi manter dessa forma, próximo a reta final da prova, por volta de 2 semanas antes, comecei a realizar apenas simulados e a partir dai revisar os pontos de maior dificuldade.
Utilizei como base dois cursos de simulados, todos no padrao da prova, 65 questoes e 130 min foram eles o feito por [Stéphane](https://www.udemy.com/share/102Yz63@uEL2psUJtMhsk_W1cREoD9AtJMDatMnZwNCFx5MMtYYrtKbHJKmS9MCi8JCN6ZDB/) e os simulados disponiveis na plataforma Cloud Academy.
Minha dica para realização dessa prova é, estudem mas não se apeguem a todos os detalhes de todos os serviços, aprenda de fato como funciona o core services. Não precisa enfiar a cara em todos os white papers e decorar pois o que vai lhe ajudar na prova é ler e compreender as questões e para isso você precisa compreender muito bem como funciona o [AWS Well-Architected](https://aws.amazon.com/pt/architecture/well-architected/).
Estudem o material e realizem quantos simulados puderem, entenda a explicação do porque de cada resposta e com certeza teremos uma boa pontuação.

|
e8181890c4d1d005fcb040369c6006a1af4d6e2b
|
[
"JavaScript",
"Markdown",
"Shell"
] | 69 |
JavaScript
|
thiagoalexandria/Gatsby
|
985f97efd11e56dc04be52fb0217eb4b7660c701
|
3cc5563eee7e7bc9d0c4df440c2349c431e7c3ba
|
refs/heads/master
|
<repo_name>mattbrown7112/web-server<file_sep>/server.js
var express = require('express');
var app = express();
var PORT = process.env.PORT || 3000; //heroku
// middleware can be attached to specific routes or the whole application
var middleware = require('./middleware.js');
app.use(middleware.logger);
// '/' index.html is the default route
app.get('/about', middleware.requireAuthentiction, function (req, res) { // get request from http
res.send('About Us!');
});
//how to access static folder
app.use(express.static(__dirname + '/public'));
//console.log(__dirname)
app.listen(PORT, function () {
console.log('Server started on port ' + PORT + '!')
});
|
8404d542154550d3dba44763a6d18c80030c1948
|
[
"JavaScript"
] | 1 |
JavaScript
|
mattbrown7112/web-server
|
39a2f652b11a50b078ca8c59c9acfb61147dc6bc
|
cb30fa0173134eccd4fcf356f2d0214c1a9a4e04
|
refs/heads/master
|
<file_sep><style>
/* GLOBAL COLORS - THEME MODIFICATIONS - PER BROWSER MODIFICATIONS */
<?php
/* APP FONTS */
if ((theme!='terminal') || (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== false)) {
?>
@font-face {
font-family: "Comfortaa";
src: url("css/Comfortaa-Regular.ttf");
font-weight: 400;
}
@font-face {
font-family: "Comfortaa";
src: url("css/Comfortaa-Bold.ttf");
font-weight: 700;
}
@font-face {
font-family: "NotoSans";
src: url("css/NotoSans-Regular.ttf");
font-weight: 400;
}
@font-face {
font-family: "NotoSans";
src: url("css/NotoSans-Bold.ttf");
font-weight: 700;
}
<?php
}
else {
?>
@font-face {
font-family: "Cousine";
src: url("css/Cousine-Regular.ttf");
font-weight: 400;
}
@font-face {
font-family: "Cousine";
src: url("css/Cousine-Bold.ttf");
font-weight: 700;
}
<?php
}
if ($pure===false && theme!='terminal' && strpos(theme, 'material') !== 0) {
?>
@media screen and (max-width:1024px) {
body {
background-image : url('img/<?=theme?>/<?=background?>');
background-position : <?=position?>;
background-size : <?=size?>;
background-repeat : <?=repeat?>;
}
}
@media screen and (min-width:1024px) {
body {
background-image : url('img/<?=theme?>/<?=background_wide?>');
background-position : <?=position?>;
background-size : <?=wide_size?>;
background-repeat : <?=repeat?>;
}
}
<?php
}
if (theme!='terminal') {
?>
.wrapper_bar_nav button {
font-family: 'NotoSans'!important;
}
.playtime {
font-family: 'NotoSans'!important;
}
<?php
}
?>
*:not(.main){
<?php
if ((theme!='terminal') || (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== false)) {
if (($remote['options']['font']=="Comfortaa") && (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') === false)) {
?>
font-family: 'Comfortaa';
<?php
}
else {
?>
font-family: 'NotoSans';
<?php
}
}
else {
?>
font-family: 'Cousine'!important;
<?php
}
?>
}
.config_select select {
background:url('img/<?=theme?>/down.png?v=<?=VER?>') no-repeat;
background-size: 14px;
background-position: right 14px top 17px;
}
label.purelabel,
label.hlslabel {
background-image:url('img/<?=theme?>/check_box.png?v=<?=VER?>');
}
.main.play,
.main.bb,
.main.ff {
background:<?=group53?>;
}
mark {
background-color:<?=group12b?>;
color:<?=group2c?>;
}
.remote button,
.button button,
.button a,
.round-button,
.links.element,
.browse,
#don,
.config_input input,
.black p,
#hls_check input:checked + span,
.backarea,
.header_style,
#body_style,
#osd,
.osd-inner
{
color:<?=group1?>;
}
.wrapper_bar_nav button{
color:#505050;
}
::-webkit-input-placeholder {
color:<?=group1c?>;
font-weight:700;
}
::-moz-placeholder {
color:<?=group1c?>;
opacity:1;
font-weight:700;
}
:-ms-input-placeholder { /*IE*/
color:<?=group1c?>!important;
font-weight:700!important;
}
::-ms-input-placeholder { /*EDGE*/
color:<?=group1c?>;
font-weight:700;
}
::placeholder {
color:<?=group1c?>;
font-weight:700;
}
.url_address input {
color:<?=group1b?>;
}
.submit button{
color:<?=group1d?>;
}
.submit:hover button{
color:<?=group1e?>;
}
.config_input textarea,
.history,
.faq p,
#element_style,
#inner_back,
.element,
#time,
input.purebox + label.purelabel,
input.hlsbox + label.hlslabel
{
color:<?=group2?>;
}
.popup-inner::-webkit-scrollbar {
color:<?=group2?>;
}
.popup-inner::-webkit-scrollbar-track {
color:<?=group2?>;
}
.history:hover,
#hls_check label {
color:<?=group3?>;
}
.top:hover,
#hls_check {
color:<?=group4?>;
}
button.wrap_option {
color:<?=group2c?>;
}
z-html-cellhighlighttext {
color:<?=group4?>;
}
.email,
.playtime
{
color:<?=group5?>;
}
#console,
#time{
color:<?=group5c?>;
}
.timeline_current_time.playtime,
.timeline_media_name {
color:<?=group5d?>;
}
.timeline_extra_button button {
color:<?=group5e?>;
}
.timeline_extra_button button:hover {
color:<?=group5f?>;
}
#RR {
color:<?=group7c?>!important;
}
.wrapper_bar_nav button{
color:<?=group7?>;
}
#timeline::-moz-range-thumb {
color:<?=group6?>;
}
#timeline::-webkit-slider-thumb {
color:<?=group6?>;
}
body {
background-color:<?=group8?>;
}
.round-button-circle.halt {
background-color:<?=group8b?>;
}
#don,
.browse,
.remote button,
.round-button-circle,
.img.round-button-circle,
.button a:hover
{
background-color:<?=group9?>;
}
.button input:hover,
.button a:hover {
background-color:<?=group9b?>;
}
#timeline::-moz-range-thumb {
background-color:<?=group9c?>;
}
#timeline::-webkit-slider-thumb{
background-color:<?=group9c?>;
}
.ontouch_thumb ::-webkit-slider-thumb{
/*background-color:<?=group9e?>!important;*/
box-shadow: 2px 2px 6px #111!important;
}
.ontouch_thumb ::-moz-range-thumb{
/*background-color:<?=group9e?>!important;*/
box-shadow: 2px 2px 6px #111!important;
}
.submit button,
.config_input textarea,
#check_setbtn,
.config_input input,
.popup-inner {
background-color:<?=group10?>;
}
.skew, .noskew{
background-color:transparent;
}
.top:hover{
background-color:<?=group12f?>;
}
.wrapper_bar.option {
background-color:<?=group12g?>;
}
button.wrap_option {
background-color:transparent
}
.button button,
.button a {
background-color:<?=group12d?>;
}
.line-separator:hover {
background-color:<?=group12c?>!important;
}
.backarea,
#body_style {
background-color:<?=group14?>;
}
.line-separator {
background-color:<?=group15?>!important;
opacity:1;
}
.main {
background-color:<?=group16?>;
}
.marquee,
.timeline_expand .timeline_expand_bezel a {
background-color:<?=group18?>;
}
.black {
background-color:<?=group19d?>;
}
.osd {
background:<?=group19b?>;
}
#osd {
background:<?=group19e?>;
}
.wrapper_bar_nav button{
background-color:<?=group19?>;
}
#timeline::-moz-range-track {
background-color:<?=group20?>;
}
#timeline::-webkit-slider-runnable-track {
background-color:<?=group20?>;
}
#timeline:disabled::-moz-range-thumb {
background-color:<?=group21?>;
}
#timeline:disabled::-webkit-slider-thumb {
background-color:<?=group21?>;
}
.wrapper:hover::-webkit-scrollbar-thumb {
background-color:<?=group22?>;
}
.wrapper_bar:hover::-webkit-scrollbar-thumb {
background-color:<?=group22?>;
}
.wrapper_bar:hover::-webkit-scrollbar {
background:<?=group22B?>;
}
.popup-inner::-webkit-scrollbar {
background-color:<?=group23?>!important;
}
.popup-inner::-webkit-scrollbar-thumb {
background-color:<?=group23b?>!important;
}
.tv_style:hover::-webkit-scrollbar {
background-color:<?=group23c?>!important;
}
.tv_style:hover::-webkit-scrollbar-thumb {
background-color:<?=group23d?>!important;
}
.tv_style:hover::-webkit-scrollbar-corner {
background:<?=group23c?>!important;
}
.tv_style::-webkit-scrollbar {
background-color:<?=group23c?>!important;
}
.tv_style::-webkit-scrollbar-thumb {
background-color:<?=group23c?>!important;
}
.tv_style::-webkit-scrollbar-corner {
background:<?=group23c?>!important;
}
.kodi {
background-color:<?=group19b?>;
}
.vnc {
background-color:<?=group19c?>;
}
.custom {
}
.url_address input {
background: <?=group31?>;
background: -webkit-linear-gradient(-0deg, <?=group31?>, <?=group32?>);
background: -moz-linear-gradient(-0deg, <?=group31?>, <?=group32?>);
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=<?=group31?>, endColorstr=<?=group32?>)";
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#BEE38F',GradientType=0 );
background-image: linear-gradient(to right, <?=group31?>, <?=group32?>);
}
.wrapper_bar_nav:hover::-webkit-scrollbar-thumb {
background-color: <?=group33?>;
}
.config_input input{
border-color:<?=group38?>;
}
#don,
.remote button,
.header_style,
.browse{
border-color:<?=group39?>;
}
#element_style,
.gray_layer {
border-color:<?=group40?>!important;
}
.gray_layer{
background:<?=group11?>;
background-position: <?=group11b?>;
background-size: <?=group11c?>;
background-repeat: <?=group11d?>;
opacity:1;
}
.submit button{
border-color:<?=group40b?>!important;
}
.submit:hover button{
border-color:<?=group40c?>!important;
}
.main {
border-color:<?=group41?>;
}
#general_set,
.header_style.faq,
.round-button-circle,
.img.round-button-circle,
.header_style.faq_header {
border-color:<?=group42?>;
}
.round-button-circle.halt {
border-color:<?=group42c?>;
}
.config_input textarea {
border-color:<?=group43b?>;
}
.config_input input:focus,
.config_input input.focus,
.config_input input:hover,
.config_input input.hover {
border-color:<?=group44b?>;
}
.round-button-circle.halt,
.round-button-circle.vol,
.img.round-button-circle
{
color:<?=group49?>;
}
.top,
.history,
.history:hover {
background-color:transparent;
}
.remoteFocus {
background:url("img/<?=theme?>/focus.png?v=<?=VER?>");
background-color:<?=group55?>;
background-repeat: no-repeat;
background-size: 24px 24px;
background-position:center;
cursor:pointer;
width:40px;
height:40px;
position:fixed;
bottom:0;
right:20px;
border:5px solid <?=group55?>;
border-radius:50px;
opacity:0;
max-height:0;
transition:0.3s ease all;
box-shadow: 0px 5px 10px #111;
z-index:9;
}
/* SELECT */
.config_select select,
.file_select select {
outline-color:<?=group47?>;
}
.config_select select:hover:not(disabled) {
border-color:<?=group44b?>;
}
.config_select select {
border-color:<?=group38?>;
}
::selection {
color:<?=group1?>;
}
.file_select select,
.config_select select
{
color:<?=group1?>;
}
.file_select select option
{
color:<?=group2?>;
}
option:checked {
color:<?=group1f?>!important;
}
.file_select select:hover {
background-color:<?=group24?>;
}
.file_select select{
background-color:<?=group28?>;
}
.file_select select:focus > option:checked {
background-color:<?=group16?>!important;
}
.config_select select:focus > option:checked {
background-color:<?=group13?>!important;
}
.config_select option {
background-color:<?=group10?>;
}
.file_select option {
background-color:<?=group11f?>;
}
button.wrap_option:hover {
color:<?=group2c?>;
}
.skew:hover .nav_inner,
.noskew:hover:not(#expand) .nav_inner {
color:<?=group3b?>;
}
.skew .nav_inner,
.noskew .nav_inner {
color:<?=group55b?>;
}
.wrapper_bar.basic{
background-color:<?=group55d?>;
}
.endlogo .logoinner {
background-color:<?=group55e?>;
border-color:<?=group40d?>;
}
/* SELECTION */
::-webkit-selection {
color:#000;
}
::-moz-selection {
color:#000;
}
::selection {
color:#000;
}
::-webkit-selection{
background-color:#fff!important;
}
::-moz-selection {
background-color:#fff!important;
}
::selection{
background-color:#fff!important;
}
/* FIREFOX GLOBAL OPTIONS */
/* ********************** */
@-moz-document url-prefix() {
#timeline {
margin-top:23px;
margin-left:1.2%;
}
.timeline_console {
left:1.22%;
bottom:6px;
}
.timeline_remaintime {
right:0.9%;
bottom:6px;
}
.timeline_logo {
left:1.3%;
}
}
/* END */
<?php
/* ********* SAFARI && SAFARI IOS && CRIOS GLOBAL OPTIONS ************** */
/* ********************************************************************* */
if ((strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') == true && strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') == false) || (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') == false && strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') == false && strpos($_SERVER['HTTP_USER_AGENT'], 'CriOS') == false && (isIphone() || isIpad()))) {
?>
.timeline_console {
left:2.7%;
}
.timeline_remaintime {
right:1.7%;
}
<?php
}
/* ********* IE GLOBAL OPTIONS ************** */
/* ******************************************** */
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== false) {
?>
#timeline {
margin-top:9px;
margin-left:1.2%;
}
.timeline_console {
left:1.17%;
bottom:6px;
}
.timeline_remaintime {
right:0.8%;
bottom:6px;
}
.timeline_logo {
left:1.3%;
}
#expand {
margin-left:5px!important;
margin-top:-4px!important;
}
#timeline::-ms-thumb {
outline:0;
border:0;
height: 25px;
width: 16px;
border-radius: 30px;
cursor: pointer;
}
select:focus::-ms-value {background-color: transparent; color:<?=group1?>;}
select::-ms-value {
background: none!important;
}
#timeline::-ms-track {
background-color:<?=group20?>;
}
#timeline::-ms-fill-lower {
background-color:<?=group20?>;
}
#timeline::-ms-fill-upper {
background-color:<?=group4?>;
}
#timeline::-ms-tooltip {
background-color:<?=group4?>;
}
#timeline::-ms-thumb {
background-color:<?=group9c?>;
}
#timeline:disabled::-ms-thumb {
background-color:<?=group21?>;
}
#timeline::-ms-ticks {
background-color:<?=group7?>;
}
#timeline::-ms-ticks-after {
background-color:<?=group7?>;
}
#timeline::-ms-ticks-before {
background-color:<?=group7?>;
}
select::-ms-expand {
display: none;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity:0;
}
<?php
}
/* ********* EDGE GLOBAL OPTIONS ************** */
/* ******************************************** */
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Edge') !== false) {
?>
#timeline {
margin-top:20px;
margin-left:1.2%;
}
#timeline::-webkit-slider-thumb{
height: 25px;
width: 16px;
margin-top: -4px;
}
.timeline_console {
bottom:6px;
left:1.1%;
}
.timeline_remaintime {
bottom:6px;
right:0.9%;
}
.timeline_logo {
left:1.3%;
}
#timeline::-ms-track {
background-color:<?=group20?>;
width: 100% !important;
height:10px;
cursor: pointer;
border:0;
border-radius: 2px;
}
<?php
}
/* END */
/* *********BLACKBERRY THEME GLOBAL ************** */
/* *********************************************** */
if (theme=='blackberry') {
?>
.config_input input,
.config_select select {
border:1px solid!important;
}
.browse,
.remote button {
background-color:#99004c!important;
}
.endlogo .logoinner {
padding-top:7px;
}
}
/* END */
/* *********TERMINAL THEME ************** */
/* ************************************** */
<?php
}
if (theme=='terminal') {
/* IE (TERMINAL) */
/* ************* */
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== false) {
?>
#timeline::-ms-track {
width: 100% !important;
height:8px;
cursor: pointer;
border-radius: 0;
border-style:dashed!important;
background:transparent;
color:#4c9900;
}
#timeline::-ms-thumb {
background-color:#000!important;
}
#signal {
display:none;
}
<?php
}
?>
/* END IE*/
/* TERMINAL GLOBAL */
.file_select select{
border:0;
margin-left:-15px!important;
}
.wrapper_bar_nav button{
letter-spacing:1px!important;
font-weight:700;
text-align: center;
font-style: italic;
}
.wrapper_bar_nav:hover::-webkit-scrollbar {
height:2px;
}
.wrapper_bar_nav {
height:49px!important;
}
#timeline:disabled::-webkit-slider-runnable-track {
border-style:solid!important;
background:transparent;
color:#4c9900;
}
.remoteFocus {
box-shadow:initial!important;
}
#timeline::-webkit-slider-runnable-track {
border-style:dashed!important;
background:transparent;
color:#4c9900;
}
#timeline::-webkit-slider-thumb {
border-radius:0;
margin:0;
margin-top:-10px;
width:15px;
height:25px;
}
#timeline::-moz-range-track {
border-style:solid!important;
background:transparent;
color:#4c9900;
height:2px;
}
#timeline:disabled::-moz-range-track {
border-style:solid!important;
background:transparent;
color:#4c9900;
height:2px;
}
#timeline::-moz-range-thumb {
border-radius:0;
width:15px;
height:25px;
}
.tv_style:hover::-webkit-scrollbar {
background-color:<?=group23c?>!important;
}
.tv_style:hover::-webkit-scrollbar-thumb {
background-color:<?=group23b?>!important;
}
.tv_style:hover::-webkit-scrollbar-corner {
background:#000!important;
}
.tv_style::-webkit-scrollbar-thumb {
border:2px solid <?=group23b?>!important;
background-color:<?=group23b?>!important;
}
.tv_style2 {
border-right:2px solid <?=group23b?>!important;
}
.tv_style::-webkit-scrollbar-corner {
border:1px solid #000!important;
background:#000!important;
}
.tv_style:hover::-webkit-scrollbar-thumb {
border:2px solid <?=group23b?>!important;
}
.tv_style:hover::-webkit-scrollbar {
border-right:0!important;
}
.wrapper_bar {
border-right:transparent!important;
}
#console,
#time {
margin-top:8px;
}
.backarea:not(.apptitle) {
border:2px solid #4c9900;
}
.line-separator {
border:1px solid #4c9900;
background-color:#000!important;
}
.line-separator:hover {
background-color:#4c9900!important;
}
*:not(.main):not(.round-button-circle):not(.wrapper_bar_nav button):not(.remoteFocus) {
border-radius:0!important;
}
.config_input,
.config_select {
border:1px!important;
}
.popup-inner {
border-radius:0!important;
}
button.wrap_option {
transition:none;
}
.button button:hover,
.button a:hover {
color:<?=group3?>;
}
/* EDGE (TERMINAL) */
/* *************** */
<?php
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Edge') !== false) {
?>
#timeline::-webkit-slider-thumb{
height: 30px;
width: 18px;
margin-top: 0px;
}
<?php
}
/* END EDGE */
/* END TERMINAL */
}
/* *********MATERIAL THEME ************** */
/* ************************************** */
if (strpos(theme, 'material') === 0) {
?>
.material_menu {
width: 100%;
text-align: left;
float:left;
left:0;
height:80px;
white-space: nowrap;
overflow: auto;
-webkit-overflow-scrolling: touch;
position:fixed;
z-index:9;
top:0;
box-shadow:0px 1px 10px transparent;
}
.endlogo {
box-shadow: 0 -6px 10px -5px #111;
}
.endlogo .logoinner {
border:0;
padding-top:14px;
padding-bottom:14px;
}
.material_focus_event {
border:10px solid;
border-color:rgba(255,255,255,0);
border-radius:50px;
box-shadow: inset 25px 25px rgba(255,255,255,0);
transition:all linear 0.2s;
}
.material_focus {
box-shadow: inset 50px 50px 50px rgba(255,255,255,0.2)!important;
border-color:rgba(255,255,255,0.2)!important;
}
.material_menu_inner {
display:flex;
align-items:center;
padding-left:16px;
margin-top:30px;
}
#material_order {
width:22px;
height:22px;
image-rendering:pixelated!important;
cursor:pointer;
}
.material_app_title {
cursor:default;
padding-left:16px;
padding-bottom:2px;
font-weight:700;
font-size:18px;
color:#fff;
}
.sidepane {
height: 100%;
width: 0;
position: fixed;
z-index: 10;
top: 0;
left: 0;
overflow-x: hidden;
transition: 0.5s;
box-shadow: 1px 0 7px #111;
-webkit-overflow-scrolling: touch;
}
.sidepane::-webkit-scrollbar-thumb {
background:<?=group67?>;
}
.sidepane::-webkit-scrollbar {
width:7px;
background:transparent;
}
.sidepane .hidepane {
position: absolute;
top: 0;
right: 25px;
font-size: 36px;
margin-left: 50px;
}
.sidepane_search {
width: 0;
height: 100%;
position: fixed;
z-index: 10;
top: 0;
right: 0;
overflow-x: hidden;
transition: 0.5s;
padding-top: 0px;
box-shadow:0px 3px 7px #111;
-webkit-overflow-scrolling: touch;
}
.sidepane_search::-webkit-scrollbar-thumb {
background:darkgray;
}
.sidepane_search::-webkit-scrollbar {
width:7px;
background:transparent;
}
.sidepane_search a {
padding: 8px 8px 8px 32px;
text-decoration: none;
font-size: 12px;
display: block;
transition: 0.3s;
white-space: nowrap;
overflow:hidden;
text-overflow: ellipsis;
max-width:70%;
}
.sidepane_search .hidepane_search {
position: absolute;
top: 41px;
left: 10px;
margin-left: 0px;
width:20px;
height:20px;
cursor:pointer;
z-index:13;
}
.sidepane_search .hidepane_search {
background:url('img/<?=theme?>/back.png?v=<?=VER?>');
background-color:transparent;
background-repeat: no-repeat;
background-size: 20px 20px;
}
.search_icon {
background:url("img/material/search.png?v=<?=VER?>");
background-color:transparent;
background-repeat: no-repeat;
background-size: 15px 15px;
cursor:pointer;
width:15px;
height:15px;
position:absolute;
right:46px;
top:32px;
}
.more_icon {
background:url("img/<?=theme?>/more.png?v=<?=VER?>");
background-color:transparent;
background-repeat: no-repeat;
background-size: 15px 15px;
cursor:pointer;
width:15px;
height:15px;
position:absolute;
right:10px;
top:32px;
}
.menu_icon {
background:url("img/<?=theme?>/signal.png?v=<?=VER?>");
background-color:transparent;
background-repeat: no-repeat;
background-size: 22px 22px;
cursor:pointer;
width:22px;
height:22px;
}
.file_select select,
.config_select select
{
margin-top:0;
margin-bottom:20px;
color:#fff;
}
.file_select {
padding-bottom:0px;
padding-top:0px;
margin-top:-1px;
}
.option {
padding-bottom:0px;
padding-top:0px;
}
.round-button.text{
color:#fff;
}
.file_select select {
font-size:14px;
}
.round_style {
background-color:transparent;
padding-top:10px;
padding-bottom:10px;
border-radius:0px;
}
.body_inner .round_style {
width:100%;
}
.wrapper_bar_nav {
padding-right:0px;
width: 95%;
height:39px;
margin-bottom:30px;
}
.nav_inner {
font-size:26px!important;
}
.url_address input::-webkit-input-placeholder {
font-weight:700;
font-size:12px;
padding-top:6px;
}
.url_address input{
font-size: 12px;
padding:0;
padding-top:30px;
padding-right:8px;
height:72px;
border:0!important;
}
.url_address {
top:0;
}
.box {
box-shadow: initial;
background:none;
}
.round-button-circle.halt{
border-width:2px;
}
.round-button-circle.vol{
border-width:2px;
}
.img.round-button-circle{
border-width:2px;
}
.material_box {
padding-top:92px;
padding-bottom:10px;
padding-left:10px;
background-color:<?=group68?>;
top:0;
left:0;
text-align:left;
margin-bottom:10px;
white-space: nowrap;
}
.setup_icon {
background:url('img/<?=theme?>/remote.png?v=<?=VER?>');
background-color:<?=group69?>;
background-repeat: no-repeat;
background-size: 30px 25px;
background-position:center;
width:44px;
height:44px;
position:absolute;
top:25px;
left:10px;
border:6px solid rgba(255,255,255,0);
border-radius:50px;
}
.material_box .material_box_main_title{
color:#fff;
overflow:hidden;
white-space: nowrap;
}
.material_box .material_box_title{
font-size:10px;
color:#fff;
overflow:hidden;
white-space: nowrap;
}
.material_side_inner {
display:flex;
align-items:center;
padding-left:14px;
flex-wrap: nowrap;
overflow:hidden;
}
.material_side_inner span {
margin-left:22px;
font-size:14px;
font-weight:700;
}
.material_side_inner.script span {
color:gray;
font-size:12px;
}
.material_box_option {
background-color:#fff;
width:100%;
line-height:42px;
margin-top:5px;
margin-bottom:5px;
cursor:pointer;
transition:all 0.2s;
overflow:hidden;
white-space: nowrap;
}
.material_box_option:hover {
background-color:lightgray;
}
.material_box_option.script_margin {
margin-top:2px;
margin-bottom:2px;
}
.material_icon_general {
background:url("img/<?=theme?>/general.png?v=<?=VER?>");
background-color:transparent;
background-repeat: no-repeat;
background-size: 20px 20px;
background-position:center;
cursor:pointer;
width:20px;
height:20px;
}
.material_icon_localize {
background:url("img/<?=theme?>/localize.png?v=<?=VER?>");
background-color:transparent;
background-repeat: no-repeat;
background-size: 20px 20px;
background-position:center;
cursor:pointer;
width:20px;
height:20px;
}
.material_icon_paths {
background:url("img/<?=theme?>/paths.png?v=<?=VER?>");
background-color:transparent;
background-repeat: no-repeat;
background-size: 20px 20px;
background-position:center;
cursor:pointer;
width:20px;
height:20px;
}
.material_icon_links {
background:url("img/<?=theme?>/links.png?v=<?=VER?>");
background-color:transparent;
background-repeat: no-repeat;
background-size: 20px 20px;
background-position:center;
cursor:pointer;
width:20px;
height:20px;
}
.material_icon_script {
background:url("img/<?=theme?>/script.png?v=<?=VER?>");
background-color:transparent;
background-repeat: no-repeat;
background-size: 18px 18px;
background-position:center;
cursor:pointer;
width:18px;
height:18px;
}
.material_icon_newlink {
background:url("img/<?=theme?>/new.png?v=<?=VER?>");
background-color:transparent;
background-repeat: no-repeat;
background-size: 18px 18px;
background-position:center;
cursor:pointer;
width:18px;
height:18px;
}
.material_separator {
border-bottom:1px solid #F2F2F2;
margin-top:10px;
margin-bottom:5px;
}
.material_box_option a:hover {
}
.wrapper_bar_nav button{
font-size:0;
border:5px solid <?=group69?>;
border-radius:50px;
cursor:pointer;
line-height:initial;
transition:all linear 0.2s;
opacity:1;
width:35px;
height:35px;
margin-left : 10px;
margin-right : 10px;
}
.material_extra {
background:url("img/<?=theme?>/extra.png?v=<?=VER?>");
background-color:<?=group69?>;
background-repeat: no-repeat;
background-size: 18px 18px;
background-position:center;
}
.material_faq {
background:url("img/<?=theme?>/help.png?v=<?=VER?>");
background-color:<?=group69?>;
background-repeat: no-repeat;
background-size: 18px 18px;
background-position:center;
}
.material_fetch{
background:url("img/<?=theme?>/fetch.png?v=<?=VER?>");
background-color:<?=group69?>;
background-repeat: no-repeat;
background-size: 14px 14px;
background-position:center;
}
.material_kodi{
background:url("img/<?=theme?>/kodi.png?v=<?=VER?>");
background-color:<?=group69?>;
background-repeat: no-repeat;
background-size: 20px 20px;
background-position:center;
}
.material_vnc{
background:url("img/<?=theme?>/vnc.png?v=<?=VER?>");
background-color:<?=group69?>;
background-repeat: no-repeat;
background-size: 18px 18px;
background-position:center;
}
.material_x11{
background:url("img/<?=theme?>/x11.png?v=<?=VER?>");
background-color:<?=group69?>;
background-repeat: no-repeat;
background-size: 15px 18px;
background-position:center;
}
.material_web {
background:url("img/<?=theme?>/list.png?v=<?=VER?>");
background-color:<?=group69?>;
background-repeat: no-repeat;
background-size: 18px 18px;
background-position:center;
}
.material_run {
background:url("img/<?=theme?>/run.png?v=<?=VER?>");
background-color:<?=group69?>;
background-repeat: no-repeat;
background-size: 16px 16px;
background-position:center;
}
/* GLOBAL MATERIAL TIMELINE */
.timeline_extra_button {
background-color:transparent;
}
#timeline::-webkit-slider-thumb {
border-radius:50px;
margin:0;
margin-top:-4.5px;
width:12px;
height:12px;
box-shadow: initial;
}
#timeline::-webkit-slider-runnable-track {
height:3px;
margin-left:2%;
border-radius: 0px;
}
#timeline::-moz-range-track {
margin-left:1%!important;
height:3px;
}
#timeline::-moz-range-thumb {
border:0;
height: 12px;
width: 12px;
border-radius:50px;
box-shadow: initial;
}
.ontouch_thumb ::-webkit-slider-thumb{
margin-top:-5.5px!important;
width:13px!important;
height:13px!important;
}
.ontouch_thumb ::-moz-range-thumb{
/*margin-top:-5.5px!important;*/
width:13px!important;
height:13px!important;
}
/* GLOBAL MATERIAL TIMELINE (NOT IE) */
<?php
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') === false) {
?>
#console{
font-size:11px;
}
#time{
font-size:11px;
}
.timeline_console {
bottom:8px;
left:2.12%;
}
.timeline_remaintime {
bottom:8px;
right:1.8%;
}
#timeline {
margin-top:29px;
}
<?php
}
?>
/* END GLOBAL (MATERIAL) */
/* FIREFOX (MATERIAL) */
/* ****************** */
@-moz-document url-prefix() {
#timeline {
margin-top:23px;
margin-left:1.2%;
}
.timeline_console {
left:1.24%!important;
bottom:10px!important;
}
.timeline_remaintime {
right:0.9%!important;
bottom:10px!important;
}
.timeline_logo {
left:1.3%!important;
}
}
/* END FIREFOX (MATERIAL) */
/* SAFARI && SAFARI IOS && CRIOS (MATERIAL) */
<?php
if ((strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') == true && strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') == false) || (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') == false && strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') == false && strpos($_SERVER['HTTP_USER_AGENT'], 'CriOS') == false && (isIphone() || isIpad()))) {
?>
.timeline_console {
left:2.5%!important;
}
.timeline_remaintime {
right:1.5%!important;
}
<?php
}
/* END SAFARI (MATERIAL) */
/* EDGE (MATERIAL) */
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Edge') !== false) {
?>
#timeline::-webkit-slider-thumb {
margin-top:0px;
}
#timeline::-webkit-slider-runnable-track {
margin-left:2%;
}
#timeline::-ms-track {
height:3px;
border-radius: 0px;
}
.timeline_console {
bottom:10px;
left:1.15%;
}
.timeline_remaintime {
bottom:10px;
right:0.9%;
}
#timeline {
margin-top:25px;
}
.ontouch_thumb ::-webkit-slider-thumb{
margin-top:0px!important;
}
<?php
}
/* END EDGE (MATERIAL) */
?>
/* MATERIAL COLORS */
.sidepane a {
color:<?=group65?>;
}
.sidepane a:hover {
color:<?=group66?>;
}
.sidepane_search a {
color: <?=group64?>;
}
.sidepane_search a:hover {
color:<?=group63?>;
}
.sidepane_search {
background-color:<?=group62?>;
}
.sidepane {
background-color:<?=group61?>;
}
.material_menu {
background-color:<?=group60?>;
}
/* END */
<?php
}
if (theme!='terminal') {
?>
<?php
}
?>
</style>
<file_sep>/* AJAX REQUEST */
/* REQUEST */
$("#reset-all").on("click",function(e){
e.preventDefault();
var reset = confirm(constants['OUT_CONFIRM']+" ...");
if (reset == true) {
var arr = {
'act' : 'config',
'arg' : 'reset-all',
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result===true) {
window.open('index.php','_self');
}
});
}
});
$("#reset-channels").on("click",function(e){
e.preventDefault();
var reset = confirm(constants['OUT_CONFIRM']+" ...");
if (reset == true) {
var arr = {
'act' : 'config',
'arg' : 'reset',
'file' : elem.attr('class'),
'constants' : constants,
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result===true) {
$("[data-popup-close='edit']").click();
$("#diagnose").click();
}
});
}
});
$("#diagnose").on("click",function(e){
e.preventDefault();
$("[data-popup-close='general']").click();
$('.osd-inner').text(constants['OUT_APPLYING']+' ...');
$('.osd').css('background','rgba(0,0,0,0.9)');
$('.osd').css('display','initial');
maintain(true);
});
$('#submit-run').on('click', function() {
var arr = {
'act' : 'run',
'arg' : $('#sh_users').val(),
'command' : $('#shell_run').val(),
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
console.log(result['res']);
});
});
$("#shutdown").on("click",function(){
var halt = confirm(constants['OUT_CONFIRM']+" ...");
if (halt == true) {
var arr = {
'act' : 'halt',
'arg' : 'halt',
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
});
}
});
$("#reboot").on("click",function(){
var reboot = confirm(constants['OUT_CONFIRM']+" ...");
if (reboot == true) {
var arr = {
'act' : 'halt',
'arg' : 'reboot',
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
});
}
});
$('#reallocate').on("click",function(e){
e.preventDefault();
if (confirm(constants['DVB_SYNC_ALERT'])) {
$("[data-popup-close='edit']").click();
$('.osd-inner').text(constants['DVB_SYNC']+' ...');
$('.osd').css('background','rgba(0,0,0,0.9)');
$('.osd').css('display','initial');
var arr = {
'act' : 'reallocate',
'arg' : 'parse',
'type': elem.attr('class')
};
_ajax_xml(arr,"xml.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (typeof result['res'] != 'undefined' && result['err']===false) {
var channel_count = result['res'];
var retry=1;
for (var i=0;i<=channel_count;i++) {
var arr = {
'act' : 'reallocate',
'arg' : 'write',
'type': elem.attr('class'),
'id' : i
};
_ajax_xml(arr,"xml.php",false);
_ajax.done(function(results){
var result = JSON.parse(results);
console.log(retry + " " + '('+(i+1)+'/'+(channel_count+1)+')');
if (result['err']===true) {
/*if (retry>=3) {
retry=1;
}
else {
retry++;
i--;
}*/
}
$('.osd-inner').text(constants['DVB_SYNC']+' ... '+'('+(i+1)+'/'+(channel_count+1)+')');
});
}
window.open('index.php','_self');
}
});
$('.osd-inner').text('');
$('.osd').css('display','none');
}
});
$("#remove_element").on('click', function(){
var arr = {
"act": "remove-channel",
"type": elem.attr('class'),
"arg": elem.val(),
"constants" : constants
};
_ajax_xml(arr,"xml.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result===true) {
elem.remove();
}
});
$("[data-popup-close='edit']").click();
location.href='#webpos';
});
$('#submit-logo').on('click', function(){
var arr = {
"act": "writelogo",
"arg": elem.val(),
"type": elem.attr('class'),
"width": $('#dimension_width').val(),
"height": $('#dimension_height').val(),
"constants" : constants
};
var formData = new FormData($('form#upload_form')[0]);
_ajax_data(arr,"xml.php",formData);
_ajax.done(function(results){
var result = JSON.parse(results);
window.open('index.php','_self');
if (result===true) {
}
});
$("[data-popup-close='logo']").click();
location.href='#' + elem.attr('class') + 'pos';
});
$("#move_up").on('click', function(){
var arr = {
"act": "move-up",
"type": elem.attr('class'),
"arg": elem.val(),
"constants": constants
};
_ajax_xml(arr,"xml.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result===true) {
elem.parent().prependTo("." + elem.attr('class') + "_inner");
}
$("[data-popup-close='edit']").click();
location.href='#' + elem.attr('class') + 'pos';
});
});
$("#remove_logo").on('click', function(){
var arr = {
"act": "remove-logo",
"type": elem.attr('class'),
"arg": elem.val(),
"constants": constants
};
_ajax_xml(arr,"xml.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result===true) {
elem.css("font-size","12px").parent().find('img').remove();
}
});
$("[data-popup-close='edit']").click();
location.href='#' + elem.attr('class') + 'pos';
});
$("#submit-link").on('click', function(e){
e.preventDefault();
var arr = {
"act": "config",
"arg": "submit-links",
"form": $("#links").serialize(),
"constants" : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result['err']===true) {
console.log(0);
}
else if (result['res']=='reload') {
window.open('index.php','_self');
}
});
$("[data-popup-close='link']").click();
});
$("#submit-scripts").on('click', function(e){
e.preventDefault();
var arr = {
"act": "config",
"arg": "submit-scripts",
"form": $("#scripts_form").serialize(),
"constants" : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result['err']===true) {
console.log(0);
}
else {
window.open('index.php','_self');
}
});
$("[data-popup-close='scripts']").click();
});
$("#remove-script").on('click', function(e){
e.preventDefault();
var arr = {
"act": "config",
"arg": "remove-scripts",
"form": $("#scripts_form").serialize(),
"constants" : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result['err']===true) {
console.log(0);
}
else {
window.open('index.php','_self');
}
});
$("[data-popup-close='scripts']").click();
});
$("#submit-webtv").on('click', function(){
var arr = {
"act": "write",
"type": "web",
"arg": elem.val(),
"url": $('#webtv_url').val(),
"title": $('#webtv_name').val(),
"hls": $("#hls").prop('checked'),
"constants" : constants
};
_ajax_xml(arr,"xml.php");
_ajax.done(function(results){
var result = JSON.parse(results);
elem.text(result['title']).val(result['location']);
});
$("[data-popup-close='web']").click();
location.href='#' + elem.attr('class') + 'pos';
});
$("#submit-tv").on('click', function(){
var arr = {
"act": "write",
"type": "tv",
"arg": elem.val(),
"title": $('#dvb_name').val(),
"constants" : constants
};
_ajax_xml(arr,"xml.php");
_ajax.done(function(results){
var result = JSON.parse(results);
elem.text(result['title']);
});
$("[data-popup-close='tv']").click();
location.href='#' + elem.attr('class') + 'pos';
});
$("#expand_pane").on("click",function() {
$(".sidepane").width("250px");
});
$(".sidepane").on("click",function() {
if (isTouchSupported) {
$(".sidepane:visible").width("0px");
}
});
$("#sidepane").on("mouseleave",function() {
$(".sidepane").width("0px");
});
$("#expand_opt,#expand").on("click",function(){
if (!$('.option').css('opacity') || $('.option').css('opacity')=='0'){
$('.option').css({'max-height': '500px'});
$('.option').css({'opacity': '1'});
}
else {
$('.option').css({'max-height': '0'});
$('.option').css({'opacity': '0'});
}
$("html, body").animate({
scrollTop: 0
}, "fast");
});
$("#sidepane_search").on("mouseleave",function() {
$(".sidepane_search").width("0px");
$(".search_results").empty();
});
$('.hidepane_search').on('click',function(){
$(".sidepane_search").width("0px");
$(".search_results").empty();
});
$("#search_pane").on("click",function(e){
var arr = {
'act' : 'parse_history',
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result['err']===false) {
var his = [];
his = result['res'];
var i;
for (i=0;i<his.length;i++) {
$(".search_results").prepend('<a class="" onclick="hide_search_pane();ajax(\'play\',\''+his[i]['url']+'\',\'url\')">'+his[i]['name']+' '+'</a>');
}
}
});
$(".sidepane_search").width("100%");
$('#url_address').val('');
setTimeout(function() { $('#url_address').focus(); }, 600);
});
/* INTERFACE */
$('#clr').on('click', function() {
var arr = {
'act' : 'clear_history',
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result===true) {
$(".wrapper a").not("#clr").remove();
$("#clr").css({"opacity":"0"});
$(".wrapper").hide();
}
});
});
$('#expand_tv').on('click', function() {
var arr = {
'act' : 'config',
'arg' : 'tvheadend',
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result===true) {
drop(tv);
}
});
location.href='#tv';
});
$('#expand_web').on('click', function() {
var arr = {
'act' : 'config',
'arg' : 'web',
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result===true) {
drop(webtv_set);
}
});
location.href='#webpos';
});
$("[data-popup-open='web']").on('click', function(){
if (elem==null) {
return;
}
$('#webtv_url').val('').prop('disabled',true);
$('#webtv_name').val('').prop('disabled',true);
var arr = {
'act' : 'parse',
'arg' : elem.val(),
'type' : "web",
'constants' : constants
};
_ajax_xml(arr,"xml.php");
_ajax.done(function(results){
var result = JSON.parse(results);
$('#hls').prop('disabled', false);
$('#webtv_url').prop('disabled',false).val(result['location']);
$('#webtv_name').prop('disabled',false).val(result['title']);
if (result['hls']) {
$('#hls').prop('checked', true);
$('.hlsbox + .hlslabel').css({
"background-position": "0 -24px"
});
}
else {
$('#hls').prop('checked', false);
if (isTouchSupported) {
$('.hlsbox + .hlslabel').css({
"background-position": "0 0"
});
}
}
setTimeout(function() { $('#webtv_url').focus(); }, 600);
});
});
$("[data-popup-open='tv']").on('click', function(){
$('#dvb_name').val('').prop('disabled',true);
var arr = {
'act' : 'parse',
'arg' : elem.val(),
'type' : "tv",
'constants' : constants
};
_ajax_xml(arr,"xml.php");
_ajax.done(function(results){
var result = JSON.parse(results);
$('#dvb_name').prop('disabled',false).val(result['title']);
});
setTimeout(function() { $('#dvb_name').focus(); }, 600);
});
$('#import').change(function(){
var arr = {
"act": "import"
};
var formData = new FormData($('form#import_form')[0]);
var url = $('form#import_form').attr("action");
_ajax_data(arr,url,formData);
_ajax.done(function(results){
var result = JSON.parse(results);
window.open('index.php','_self');
});
});
$("#edit_logo").on('click', function(){
$("[data-popup-close='edit']").click();
$("[data-popup-open='logo']").click();
});
$("[data-popup-open='logo']").on('click', function(){
var arr = {
'act' : 'parse',
'arg' : elem.val(),
'type' : elem.attr('class'),
'constants' : constants
};
_ajax_xml(arr,"xml.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result['width']>0 && result['height']>0) {
$(".config_input.logo").css({"display":"block"});
$('#dimension_width').prop('disabled',false).val(result['width']).css({"display":"block"});
$('#dimension_height').prop('disabled',false).val(result['height']).css({"display":"block"});
$('#submit-logo').prop('disabled',true).css({"display":"none"});
$(".submit.logo").css({"display":"none"});
$('#browse').val('');
}
else {
$(".config_input.logo").css({"display":"none"});
$('#dimension_width').prop('disabled',true).val('30').css({"display":"none"});
$('#dimension_height').prop('disabled',true).val('30').css({"display":"none"});
$('#submit-logo').prop('disabled',true).css({"display":"none"});
$(".submit.logo").css({"display":"none"});
$('#browse').val('');
}
});
});
/* OPTIONS WRAP BAR */
$('#audio_layer').click(function(){
var arr = {
'act' : 'config',
'arg' : 'audio_lay',
'constants' : constants,
'position' : out[5],
'length' : out[4],
'state' : arg
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result['err']===false) {
console.log(0);
}
else {
if (arg!='idle') {
act='seekto';
}
else {
requesting=false;
}
var current = $("#audio_layer :last-child").text();
$("#audio_layer :last-child").empty();
$('<span/>',{
text: next_element(current,AUDIO_LAY)
}).appendTo('#audio_layer').css({'color':constants['group2b']});
}
});
});
$('#switch_theme').click(function(){
var arr = {
'act' : 'config',
'arg' : 'switch_theme',
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result['err']===false) {
console.log(0);
}
else {
var current = $("#switch_theme :last-child").text();
$("#switch_theme :last-child").empty();
$('<span/>',{
text: result['err']
}).appendTo('#switch_theme').css({'color':constants['group2b']});
window.open("index.php?bypass=","_self");
}
});
});
$('#audio_output').click(function(){
var arr = {
'act' : 'config',
'arg' : 'audio_out',
'constants' : constants,
'position' : out[5],
'length' : out[4],
'state' : arg
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result['err']===false) {
console.log(0);
}
else {
if (arg!='idle') {
act='seekto';
}
else {
requesting=false;
}
var current = $("#audio_output :last-child").text();
$("#audio_output :last-child").empty();
$('<span/>',{
text: next_element(current,AUDIO_OUT)
}).appendTo('#audio_output').css({'color':constants['group2b']});
}
});
});
$('#audio_passthrough').click(function(){
var arr = {
'act' : 'config',
'arg' : 'passthrough',
'constants' : constants,
'position' : out[5],
'length' : out[4],
'state' : arg
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result['err']===false) {
console.log(0);
}
else {
if (arg!='idle') {
act='seekto';
}
else {
requesting=false;
}
var current = $("#audio_passthrough :last-child").text();
$("#audio_passthrough :last-child").empty();
if (current == constants['OPT_PASSTHROUGH_1']) {
$('<span/>',{
text: constants['OPT_PASSTHROUGH_2']
}).appendTo('#audio_passthrough').css({'color':constants['group2b']});
}
else {
$('<span/>',{
text: constants['OPT_PASSTHROUGH_1']
}).appendTo('#audio_passthrough').css({'color':constants['group2b']});
}
}
});
});
$('#repeat_one').click(function(){
var arr = {
'act' : 'config',
'arg' : 'repeat_one',
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result===true) {
var current = $("#repeat_one :last-child").text();
$("#repeat_one :last-child").empty();
if (current == constants['OPT_REPEAT_1']) {
$('<span/>',{
text: constants['OPT_REPEAT_2']
}).appendTo('#repeat_one').css({'font-size':'0'});
$('#repeat_one mark').css({
'background-color':constants['group12b'],
'color':constants['group2c']
});
change_logo('play','2');
}
else {
$('<span/>',{
text: constants['OPT_REPEAT_1']
}).appendTo('#repeat_one').css({'font-size':'0'});
$('#repeat_one mark').css({
'background-color':constants['group12e'],
'color':constants['group2d']
});
change_logo('repeat','2');
}
}
});
});
$('#video_res').click(function(){
var arr = {
'act' : 'config',
'arg' : 'source_res',
'constants' : constants,
'position' : out[5],
'length' : out[4],
'state' : arg
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result['err']===false) {
console.log(0);
}
else {
if (arg!='idle') {
act='seekto';
}
else {
requesting=false;
}
var current = $("#video_res :last-child").text();
$("#video_res :last-child").empty();
if (current == constants['OPT_RESOLUTION_2']) {
$('<span/>',{
text: RES
}).appendTo('#video_res').css({'color':constants['group2b']});
}
else {
$('<span/>',{
text: constants['OPT_RESOLUTION_2']
}).appendTo('#video_res').css({'color':constants['group2b']});
}
}
});
});
$('#subtitle_source').click(function(){
var arr = {
'act' : 'config',
'arg' : 'subtitles',
'constants' : constants,
'position' : out[5],
'length' : out[4],
'state' : arg
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result['err']===false) {
console.log(0);
}
else {
if (arg!='idle') {
act='seekto';
}
else {
requesting=false;
}
var current = $("#subtitle_source :last-child").text();
$("#subtitle_source :last-child").empty();
if (current == constants['OPT_SUBTITLES_1']) {
$('<span/>',{
text: constants['OPT_SUBTITLES_2']
}).appendTo('#subtitle_source').css({'color':constants['group2b']});
}
else {
$('<span/>',{
text: constants['OPT_SUBTITLES_1']
}).appendTo('#subtitle_source').css({'color':constants['group2b']});
}
}
});
});
$('#scale').click(function(){
var arr = {
'act' : 'config',
'arg' : 'scale',
'constants' : constants,
'position' : out[5],
'length' : out[4],
'state' : arg
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result['err']===false) {
console.log(0);
}
else {
var current = $("#scale :last-child").text();
$("#scale :last-child").empty();
if (current == constants['OPT_SCALE_1']) {
$('<span/>',{
text: constants['OPT_SCALE_2']
}).appendTo('#scale').css({'color':constants['group2b']});
}
else {
$('<span/>',{
text: constants['OPT_SCALE_1']
}).appendTo('#scale').css({'color':constants['group2b']});
}
window.open("index.php?bypass=","_self");
}
});
});
$('#switch_font').click(function(){
var current = $("#switch_font :last-child").text();
$("#switch_font :last-child").empty();
if (current == constants['OPT_FONT_1']) {
$('<span/>',{
text: constants['OPT_FONT_2']
}).appendTo('#switch_font').css({'color':constants['group2b']});
}
else {
$('<span/>',{
text: constants['OPT_FONT_1']
}).appendTo('#switch_font').css({'color':constants['group2b']});
}
window.open('index.php?font=','_self');
});
$('#fetch_files').click(function(){
var arr = {
'act' : 'config',
'arg' : 'cache',
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result===true) {
console.log(constants['OUT_APPLYING']);
var current = $("#fetch_files :last-child").text();
$("#fetch_files :last-child").empty();
if (current == constants['OPT_FETCH_1']) {
$('<span/>',{
text: constants['OPT_FETCH_2']
}).appendTo('#fetch_files').css({'color':constants['group2b']});
}
else {
$('<span/>',{
text: constants['OPT_FETCH_1']
}).appendTo('#fetch_files').css({'color':constants['group2b']});
}
}
});
});
$('#monitor_edid').click(function(){
var arr = {
'act' : 'config',
'arg' : 'edid',
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result===true) {
console.log(constants['OUT_APPLYING']);
var result = JSON.parse(results);
if (result===true) {
console.log(constants['OUT_APPLYING']);
var current = $("#monitor_edid :last-child").text();
$("#monitor_edid :last-child").empty();
if (current == constants['OPT_EDID_1']) {
$('<span/>',{
text: constants['OPT_EDID_2']
}).appendTo('#monitor_edid').css({'color':constants['group2b']});
}
else {
$('<span/>',{
text: constants['OPT_EDID_1']
}).appendTo('#monitor_edid').css({'color':constants['group2b']});
}
}
}
});
});
$('#switch_scroll').click(function(){
var arr = {
'act' : 'config',
'arg' : 'scroll',
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result===true) {
console.log(constants['OUT_APPLYING']);
var current = $("#switch_scroll :last-child").text();
$("#switch_scroll :last-child").empty();
if (current == constants['OPT_SCROLL_1']) {
$('<span/>',{
text: constants['OPT_SCROLL_2']
}).appendTo('#switch_scroll').css({'font-size':'0'});
$('#switch_scroll mark').css({
'background-color':constants['group12b'],
'color':constants['group2c']
});
$('.wrapper_bar,.wrapper_bar_nav,.wrapper,.tv_style').removeClass('showscrollbars').addClass('hidescrollbars');
}
else {
$('<span/>',{
text: constants['OPT_SCROLL_1']
}).appendTo('#switch_scroll').css({'font-size':'0'});
$('#switch_scroll mark').css({
'background-color':constants['group12e'],
'color':constants['group2d']
});
$('.wrapper_bar,.wrapper_bar_nav,.wrapper,.tv_style').removeClass('hidescrollbars').addClass('showscrollbars');
}
}
});
});
$('#auto_update').click(function(){
var arr = {
'act' : 'config',
'arg' : 'autoupdate',
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result===true) {
var current = $("#auto_update :last-child").text();
$("#auto_update :last-child").empty();
if (current == constants['OPT_UPDATE_1']) {
$('<span/>',{
text: constants['OPT_UPDATE_2']
}).appendTo('#auto_update').css({'font-size':'0'});
$('#auto_update mark').css({
'background-color':constants['group12b'],
'color':constants['group2c']
});
}
else {
$('<span/>',{
text: constants['OPT_UPDATE_1']
}).appendTo('#auto_update').css({'font-size':'0'});
$('#auto_update mark').css({
'background-color':constants['group12e'],
'color':constants['group2d']
});
}
}
});
});
$("#hdmi_input").on("click",function(){
var arr = {
'act' : 'config',
'arg' : 'switch_hdmi',
'constants' : constants,
'sudoer' : sudoer,
'state' : arg
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
out[9]=result['hdmi']; // HDMI STATE -> GLOBAL
if (result['hdmi']!==true) {
$('<span/>',{
text: constants['OPT_HDMI_2']
}).appendTo('#hdmi_input').css({'font-size':'0'});
$('#hdmi_input mark').css({
'background-color':constants['group12b'],
'color':constants['group2c']
});
}
else {
$('<span/>',{
text: constants['OPT_HDMI_1']
}).appendTo('#hdmi_input').css({'font-size':'0'});
$('#hdmi_input mark').css({
'background-color':constants['group12e'],
'color':constants['group2d']
});
}
});
});<file_sep>function run(script) {
var arr = {
'act' : 'run',
'arg' : 'default',
'command' : script,
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
console.log(result['res']);
});
}
function maintain(argument) {
var arr = {
'act' : 'maintain',
'sudoer' : sudoer,
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
console.log(result['res']);
out[1]=constants['OUT_IDLE'];
out[3]='';
out[4]=0;
out[5]=0;
out[6]=0;
arg='idle';
$('.osd-inner').text("");
$('.osd').fadeOut('600');
if (result['res']===true) {
window.open('index.php?update=','_self');
}
else if (typeof result['err'] != 'undefined') {
if (result['err']=='dvb') {
if (tvheadend===true) {
window.open('index.php','_self');
}
}
else if (result['err']=='web') {
window.open('index.php','_self');
}
else {
console.log(result['err']);
}
}
if (typeof argument != 'undefined' && argument===true) {
window.open('index.php','_self');
}
});
}
function drop(area) {
if ((!area.style.opacity) || (area.style.opacity=='0')){
slideDown(area);
}
else {
slideUp(area);
}
}
function slideDown( elem ) {
$(elem).css({'opacity': '1'});
$(elem).css({'max-height': '500px'});
if (elem==webtv_set) {
$('.up_webtv').fadeIn(0);
}
/*else if (elem==tv) {
$('.up_tv').fadeIn(0);
}*/
}
function slideUp( elem )
{
$(elem).css({'max-height': '0'});
once( 1, function ()
{
$(elem).css({'opacity': '0'});
} );
if (elem==webtv_set) {
$('.up_webtv').fadeOut(0);
}
/*else if (elem==tv) {
$('.up_tv').fadeOut(0);
} */
}
function once( seconds, callback ) {
var counter = 0;
clearInterval(time);
var time=null;
time = window.setInterval( function () {
counter++;
if ( counter >= seconds )
{
callback();
window.clearInterval( time );
time=null;
}
}, 1000 );
}
function history_write() {
var history = $(".wrapper a[onclick*='"+file+"']");
if (history.length) {
history.prependTo(".wrapper");
var listed=true;
}
if(!listed) {
var text;
if (out[7].length > 45 ) {
text = out[7].substr(0, 45)+"...";
}
else {
text = out[7] + " ";
}
$(".wrapper").show();
$("a:contains('" + text + "')").closest('.history').remove();
$(".wrapper").prepend('<a class="internal history" onclick="ajax(\'play\',\''+file+'\',\'url\')">'+text+' '+'</a>');
$("#clr").css({"opacity":"1"});
}
$('#url_address').val('');
}
function volmix(action) {
if (arg!='idle') {
if (action=='up') {
out[10]+=3;
}
else if (action=='down') {
out[10]-=3;
}
}
var arr = {
'act' : 'vol',
'action' : action,
'control' : remote['alsa']['control'],
'card' : remote['alsa']['card'],
'state' : arg,
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
var result_mess;
setTimeout(function(){
if (result['err']===true){
if (arg==='idle') {
console.log(constants['OUT_ALSA_PERM']);
}
}
else {
if (arg=='idle') {
result_mess=constants['OUT_VOLUME'] + " " + result['res'] + "%";
document.getElementById('osd').textContent= result_mess;
if (document.getElementById('osd').style.display!='block') {
document.getElementById('osd').style.display='block';
}
}
}
}, 200);
});
}
function next_element(element, array){
var point = array.indexOf(element);
if(point < array.length - 1) {
return array[point+1];
}
else {
return array[0];
}
}
function hide_search_pane() {
$('.sidepane_search').width('0');
}
function hide_side_pane() {
$('.sidepane').width('0');
}
function change_logo(type,box){
if (box==undefined) {
box="1";
}
switch (type) {
case 'web':
$("#timeline_logo").attr("src","img/" + constants['theme'] + "/web.png?v=" + constants['VER']);
break;
case 'tv':
$("#timeline_logo").attr("src","img/" + constants['theme'] + "/tv.png?v=" + constants['VER']);
break;
case 'url':
$("#timeline_logo").attr("src","img/" + constants['theme'] + "/yt.png?v=" + constants['VER']);
break;
case 'paused':
$("#timeline_signal"+ box).attr("src","img/" + constants['theme'] + "/paused.png?v=" + constants['VER']);
break;
case 'seek30':
$("#timeline_signal" + box).attr("src","img/" + constants['theme'] + "/seek30_timeline.png?v=" + constants['VER']);
break;
case 'seek30m':
$("#timeline_signal" + box).attr("src","img/" + constants['theme'] + "/seek30m_timeline.png?v=" + constants['VER']);
break;
case 'repeat':
$("#timeline_signal" + box).attr("src","img/" + constants['theme'] + "/repeat.png?v=" + constants['VER']);
break;
case 'play':
$("#timeline_signal" + box).attr("src","img/trans.png?v=" + constants['VER']);
break;
case 'vol':
if ($("#timeline_logo").attr("src")!="img/" + constants['theme'] + "/vol.png?v=" + constants['VER']) {
$("#timeline_logo").attr("src","img/" + constants['theme'] + "/vol.png?v=" + constants['VER']);
}
break;
default:
$("#timeline_logo").attr("src","img/" + constants['theme'] + "/local.png?v=" + constants['VER']);
break;
}
}
function scale_text() {
if (arg!=='idle') {
var size = document.getElementsByTagName('body')[0].clientWidth - document.getElementsByClassName("timeline_current_time")[0].clientWidth - document.getElementsByClassName("timeline_logo")[0].clientWidth - 45;
$(".timeline_media").width(size);
if (document.getElementsByTagName('body')[0].clientWidth>340) {
size = document.getElementsByTagName('body')[0].clientWidth - document.getElementsByClassName("timeline_remaintime")[0].clientWidth - 25;
}
else {
size = document.documentElement["offsetWidth"] - document.getElementsByClassName("timeline_remaintime")[0].clientWidth - 35;
}
$(".timeline_console").width(size);
}
}
function extend_timeline() {
$('.marquee').css({
'height':'73px'
});
$('.timeline_extra_button').css({
'display':'block'
});
$('.timeline_current_time').css({
'display':'none'
});
$('.timeline_logo').css({
'display':'none'
});
$('.timeline_media').css({
'display':'none'
});
$('.timeline_signals').css({
'display':'none'
});
if (navigator.userAgent.indexOf("Trident") != -1) {
$('#timeline').css({
'margin-top':'17px'
});
}
else if (navigator.userAgent.indexOf("Edge") != -1) {
if (constants['theme'].indexOf("material")===-1) {
$('#timeline').css({
'margin-top':'28px'
});
}
else {
$('#timeline').css({
'margin-top':'33px'
});
}
}
else if (navigator.userAgent.indexOf("Gecko") > -1 && navigator.userAgent.indexOf("Chrome") == -1 && navigator.userAgent.indexOf("Safari") == -1 &&!isTouchSupported) {
if (constants['theme'].indexOf("material")===-1) {
$('#timeline').css({
'margin-top':'31px'
});
}
else {
$('#timeline').css({
'margin-top':'31px'
});
}
}
else {
if (constants['theme'].indexOf("material")===-1) {
$('#timeline').css({
'margin-top':'31px'
});
}
else {
$('#timeline').css({
'margin-top':'37px'
});
}
}
scale_text();
$('.remoteFocus').css("bottom",($('.marquee').height() + 18) + "px");
}
function extendplus_timeline() {
$('.marquee').css({
'height':'130px'
});
$('.timeline_extra_button').css({
'display':'block'
});
$('.timeline_current_time').css({
'display':'block'
});
$('.timeline_logo').css({
'display':'block'
});
$('.timeline_media').css({
'display':'block'
});
$('.timeline_signals').css({
'display':'block'
});
if (navigator.userAgent.indexOf("Trident") != -1) {
$('#timeline').css({
'margin-top':'74px'
});
}
else if (navigator.userAgent.indexOf("Edge") != -1) {
if (constants['theme'].indexOf("material")===-1) {
$('#timeline').css({
'margin-top':'85px'
});
}
else {
$('#timeline').css({
'margin-top':'90px'
});
}
}
else if (navigator.userAgent.indexOf("Gecko") > -1 && navigator.userAgent.indexOf("Chrome") == -1 && navigator.userAgent.indexOf("Safari") == -1 &&!isTouchSupported) {
if (constants['theme'].indexOf("material")===-1) {
$('#timeline').css({
'margin-top':'88px'
});
}
else {
$('#timeline').css({
'margin-top':'88px'
});
}
}
else {
if (constants['theme'].indexOf("material")===-1) {
$('#timeline').css({
'margin-top':'88px'
});
}
else {
$('#timeline').css({
'margin-top':'94px'
});
}
}
scale_text();
$('.remoteFocus').css("bottom",($('.marquee').height() + 18) + "px");
}
function reset_timeline() {
$('.marquee').css({
'height':'65px'
});
$('.timeline_extra_button').css({
'display':'none'
});
$('.timeline_current_time').css({
'display':'none'
});
$('.timeline_logo').css({
'display':'none'
});
$('.timeline_media').css({
'display':'none'
});
$('.timeline_signals').css({
'display':'none'
});
if (navigator.userAgent.indexOf("Trident") != -1) {
$('#timeline').css({
'margin-top':'9px'
});
}
else if (navigator.userAgent.indexOf("Edge") != -1) {
if (constants['theme'].indexOf("material")===-1) {
$('#timeline').css({
'margin-top':'20px'
});
}
else {
$('#timeline').css({
'margin-top':'25px'
});
}
}
else if (navigator.userAgent.indexOf("Gecko") > -1 && navigator.userAgent.indexOf("Chrome") == -1 && navigator.userAgent.indexOf("Safari") == -1 &&!isTouchSupported) {
if (constants['theme'].indexOf("material")===-1) {
$('#timeline').css({
'margin-top':'23px'
});
}
else {
$('#timeline').css({
'margin-top':'23px'
});
}
}
else {
if (constants['theme'].indexOf("material")===-1) {
$('#timeline').css({
'margin-top':'23px'
});
}
else {
$('#timeline').css({
'margin-top':'29px'
});
}
}
scale_text();
$('.remoteFocus').css("bottom",($('.marquee').height() + 18) + "px");
}
function switch_timeline(arg_) {
if (arg_=='undefined') {
arg_=null;
}
var arr = {
'act' : 'config',
'arg' : 'switch_timeline',
'type' : arg_,
'constants' : constants
};
_ajax_xml(arr,"request.php");
_ajax.done(function(results){
var result = JSON.parse(results);
if (result===false) {
console.log(0);
}
else {
remote['options']['timeline']=result;
switch (remote['options']['timeline']) {
case '2':
extend_timeline();
break;
case '3':
extendplus_timeline();
break;
default:
reset_timeline();
break;
}
}
});
};
function checkVisible_partial( elm, evalType ) { // http://stackoverflow.com/a/5354536
evalType = evalType || "visible";
var vpH = $(window).height(), // Viewport Height
st = $(window).scrollTop(), // Scroll Top
y = $(elm).offset().top,
elementHeight = $(elm).height();
if (evalType === "visible") return (y> st) && ((y < (vpH + st)) && (y > (st - elementHeight)));
if (evalType === "above") return ((y < (vpH + st)));
}
function focus_remote_pad() {
if ($('body').css("zoom") > 1.3) {
location.href='#bb_img';
if (constants['theme'].indexOf("material")===-1) {
$('html,body').animate({
scrollTop: '-=50px'
});
}
else {
$('html,body').animate({
scrollTop: '-=160px'
});
}
}
else if ($('body').css("zoom") > 1) {
location.href='#bb_img';
if (constants['theme'].indexOf("material")===-1) {
$('html,body').animate({
scrollTop: '-=25px'
});
}
else {
$('html,body').animate({
scrollTop: '-=135px'
});
}
}
else {
if (constants['theme'].indexOf("material")===-1) {
$('html,body').animate({
scrollTop: $('.play').offset().top - 25
});
}
else {
$('html,body').animate({
scrollTop: $('.play').offset().top - 100
});
}
}
}
$(window).bind('resize load', function(event) {
if(window.innerWidth==window_cache && event.type=="resize") {
//iOS SAFARI SCROLL>RESIZE ISSUES
return;
}
window_cache=window.innerWidth;
if ( event.type=="load") {
switch (remote['options']['timeline']) {
case '2':
extend_timeline();
break;
case '3':
extendplus_timeline();
break;
}
}
scale_text();
});
/* INDEX */
var act,arg,type,file,text,typing,longpress,elem,_ajax,subtitles,loop,timeout_vol_1,timeout_vol_2,timeout_vol_3,timeout_ch_1,timeout_ch_2,timeout_ch_3,timeout_button,timeout_play,timeout_play_2,timeout_play_3,timeout_timeline;
var timer=paused=scroll=timeline_move=delay=false;
var i=webseek=0;
var out=[];
var keys=new Array(
13, //ENTER
27, //ESC
32, //SPACE
37, //LEFT
//38, //UP
39, //RIGHT
//40, //DOWN
80, //P
81, //Q
107, //+
109 //-
);
var AUDIO_OUT = [
constants["OPT_AUDIO_OUT_1"],
constants["OPT_AUDIO_OUT_2"],
constants["OPT_AUDIO_OUT_3"]
];
var AUDIO_LAY = [
constants["OPT_LAYER_1"],
constants["OPT_LAYER_2"],
constants["OPT_LAYER_3"]
];
var isTouchSupported = "ontouchend" in document;
//ON PAGE LOAD
$(document).ready(function() {
if (isTouchSupported && window_cache<1000) {
$('.wrapper_bar,.wrapper_bar_nav,.wrapper,.tv_style,.popup-inner').addClass('hidescrollbars_wide');
}
$('input').attr({
autocomplete: 'off',
autocorrect: 'off',
autocapitalize: 'off',
spellcheck: 'false'
});
if (pure===true) {
$('#pure').prop('checked', true);
}
else {
$('#pure').prop('checked', false);
}
if (users.length <= 0) {
$('#users').prop('disabled', true);
}
if (remote['options']['mdns']!="") {
$('#mdns').val(remote['options']['mdns']);
}
$('<span/>',{
text: constants['themes'][0][constants['theme']]
}).appendTo('#switch_theme').css({'color':constants['group2b']});
if (remote['omxplayer']['audio_out'] == "both") {
$('<span/>',{
text: AUDIO_OUT[2]
}).appendTo('#audio_output').css({'color':constants['group2b']});
}
else if (remote['omxplayer']['audio_out'] == "hdmi"){
$('<span/>',{
text: AUDIO_OUT[0]
}).appendTo('#audio_output').css({'color':constants['group2b']});
}
else if (remote['omxplayer']['audio_out'] == "local"){
$('<span/>',{
text: AUDIO_OUT[1]
}).appendTo('#audio_output').css({'color':constants['group2b']});
}
if (remote['omxplayer']['audio_lay'] == "none"){
$('<span/>',{
text: AUDIO_LAY[0]
}).appendTo('#audio_layer').css({'color':constants['group2b']});
}
else if (remote['omxplayer']['audio_lay'] == "51"){
$('<span/>',{
text: AUDIO_LAY[2]
}).appendTo('#audio_layer').css({'color':constants['group2b']});
}
else if (remote['omxplayer']['audio_lay'] == "21"){
$('<span/>',{
text: AUDIO_LAY[1]
}).appendTo('#audio_layer').css({'color':constants['group2b']});
}
if (remote['omxplayer']['passthrough'] == "0"){
$('<span/>',{
text: constants['OPT_PASSTHROUGH_2']
}).appendTo('#audio_passthrough').css({'color':constants['group2b']});
}
else {
$('<span/>',{
text: constants['OPT_PASSTHROUGH_1']
}).appendTo('#audio_passthrough').css({'color':constants['group2b']});
}
if (remote['options']['replay'] == "1"){
$('<span/>',{
text: constants['OPT_REPEAT_1']
}).appendTo('#repeat_one').css({'font-size':'0'});
$('#repeat_one mark').css({
'background-color':constants['group12e'],
'color':constants['group2d']
});
change_logo('repeat','2');
}
else {
$('<span/>',{
text: constants['OPT_REPEAT_2']
}).appendTo('#repeat_one').css({'font-size':'0'});
$('#repeat_one mark').css({
'background-color':constants['group12b'],
'color':constants['group2c']
});
}
if (remote['omxplayer']['source_res'] == "0"){
$('<span/>',{
text: RES
}).appendTo('#video_res').css({'color':constants['group2b']});
}
else {
$('<span/>',{
text: constants['OPT_RESOLUTION_2']
}).appendTo('#video_res').css({'color':constants['group2b']});
}
if (remote['options']['font'] == "NotoSans"){
$('<span/>',{
text: constants['OPT_FONT_1']
}).appendTo('#switch_font').css({'color':constants['group2b']});
}
else {
$('<span/>',{
text: constants['OPT_FONT_2']
}).appendTo('#switch_font').css({'color':constants['group2b']});
}
if (pidof_tvservice == "off"){
$('<span/>',{
text: constants['OPT_HDMI_2']
}).appendTo('#hdmi_input').css({'font-size':'0'});
$('#hdmi_input mark').css({
'background-color':constants['group12b'],
'color':constants['group2c']
});
}
else {
$('<span/>',{
text: constants['OPT_HDMI_1']
}).appendTo('#hdmi_input').css({'font-size':'0'});
$('#hdmi_input mark').css({
'background-color':constants['group12e'],
'color':constants['group2d']
});
}
if (remote['omxplayer']['subtitles'] == "local"){
$('<span/>',{
text: constants['OPT_SUBTITLES_1']
}).appendTo('#subtitle_source').css({'color':constants['group2b']});
}
else {
$('<span/>',{
text: constants['OPT_SUBTITLES_2']
}).appendTo('#subtitle_source').css({'color':constants['group2b']});
}
if ((navigator.userAgent.indexOf("Firefox") == -1 ) && (navigator.userAgent.indexOf("Trident") == -1 ) ) {
if (remote['options']['scale'] == "1"){
$('<span/>',{
text: constants['OPT_SCALE_1']
}).appendTo('#scale').css({'color':constants['group2b']});
}
else {
$('<span/>',{
text: constants['OPT_SCALE_2']
}).appendTo('#scale').css({'color':constants['group2b']});
}
}
if (remote['options']['cache']=="1"){
$('<span/>',{
text: constants['OPT_FETCH_1']
}).appendTo('#fetch_files').css({'color':constants['group2b']});
}
else {
$('<span/>',{
text: constants['OPT_FETCH_2']
}).appendTo('#fetch_files').css({'color':constants['group2b']});
}
if (remote['omxplayer']['compatible']=="yes"){
$('<span/>',{
text: constants['OPT_EDID_1']
}).appendTo('#monitor_edid').css({'color':constants['group2b']});
}
else {
$('<span/>',{
text: constants['OPT_EDID_2']
}).appendTo('#monitor_edid').css({'color':constants['group2b']});
}
if (remote['options']['autoupdate']=="yes") {
$('<span/>',{
text: constants['OPT_UPDATE_1']
}).appendTo('#auto_update').css({'font-size':'0'});
$('#auto_update mark').css({
'background-color':constants['group12e'],
'color':constants['group2d']
});
}
else {
$('<span/>',{
text: constants['OPT_UPDATE_2']
}).appendTo('#auto_update').css({'font-size':'0'});
$('#auto_update mark').css({
'background-color':constants['group12b'],
'color':constants['group2c']
});
}
if ((navigator.userAgent.indexOf("Firefox") != -1 ) || ((navigator.userAgent.indexOf("Edge") != -1 ) || (navigator.userAgent.indexOf("Trident") != -1 ) || (!!document.documentMode == true ))) {
if (remote['options']['scroll']!='yes') {
$('<span/>',{
text: constants['OPT_SCROLL_2']
}).appendTo('#switch_scroll').css({'font-size':'0'});
$('#switch_scroll mark').css({
'background-color':constants['group12b'],
'color':constants['group2c']
});
$('.wrapper_bar,.wrapper_bar_nav,.wrapper,.tv_style').addClass('hidescrollbars');
}
else {
$('<span/>',{
text: constants['OPT_SCROLL_1']
}).appendTo('#switch_scroll').css({'font-size':'0'});
$('#switch_scroll mark').css({
'background-color':constants['group12e'],
'color':constants['group2d']
});
$('.wrapper_bar,.wrapper_bar_nav,.wrapper,.tv_style').addClass('showscrollbars');
}
}
$("#select_service,#input_name,#input_dimension").css({"display":"none"});
if (remote['options']['tvheadend']!="") {
if (typeof tv != 'undefined') {
drop(tv);
}
}
else {
$('.up_tv').fadeOut(0);
}
if (remote['options']['webtv']!="") {
if (typeof webtv_set != 'undefined') {
drop(webtv_set);
}
}
else {
$('.up_webtv').fadeOut(0);
}
if (remote['omxplayer']['subtitles']=='internet') {
subtitles=true;
}
$(document).removeClass('marquee');
if (ignore_setup) {
$('.osd').fadeOut('600');
}
if (recent !== null && recent!='') {
$("#clr").css({"opacity":"1"});
}
else {
$(".wrapper").hide();
}
if (typeof remote['options']['scale'] != 'undefined') {
if (remote['options']['scale']!=1) {
$('body').css('zoom','1');
}
}
// ON PAGE LOAD END
});<file_sep>$(window).on('scroll touchmove', function() {
var scrollTop = $(this).scrollTop();
if (constants['theme'].indexOf("material")!==-1) {
if ( scrollTop == 0 ) {
$('.material_menu').css("box-shadow","0px 1px 10px transparent");
}
else if (scrollTop > 0 && scrollTop < 100) {
$('.material_menu').css("box-shadow","0px 1px 10px #111");
}
}
if (checkVisible_partial('.round_style')) {
$('.remoteFocus').css({
"opacity":"0",
"max-height":"0"
});
}
else {
if ($('.marquee').css("display") == "none") {
if((scrollTop + $(this).height() > $(document).height() - 100) && constants['theme'].indexOf("material")!==-1) {
$('.remoteFocus').css("bottom","86px");
}
else {
$('.remoteFocus').css("bottom","36px");
}
}
else {
$('.remoteFocus').css("bottom",($('.marquee').height() + 18) + "px");
}
$('.remoteFocus').css({
"opacity":"1",
"max-height":"40px"
});
}
});
$('.remoteFocus').on('click', function() {
focus_remote_pad();
});
/* WEBTV SELECTION */
$('#webtv_name,#webtv_url,#hls').on('change keyup paste input propertychange', function() {
if (($.trim($('#webtv_name').val()) == '') || ($.trim($('#webtv_url').val()) == '')) {
$('#submit-webtv').prop('disabled', true);
$("#submit-webtv").css({"display":"none"});
$('#hls').prop('disabled', true);
}
else {
$('#submit-webtv').prop('disabled', false);
$("#submit-webtv").css({"display":"block"});
$('#hls').prop('disabled', false);
}
});
$('.hlslabel').on("mouseenter",function(){
if ($('#hls').is( ":enabled" )) {
$('.hlsbox + .hlslabel').css({
"background-position": "0 -24px"
});
}
});
$('.hlslabel').on("mouseleave",function(){
if (($('#hls').is(":enabled")) && ($('#hls').is(':not(:checked)'))) {
$('.hlsbox + .hlslabel').css({
"background-position": "0 0"
});
}
});
$('#browse').change(function(){
$(".config_input.logo,.submit.logo").css({"display":"block"});
$('#submit-logo').prop('disabled',false).css({"display":"block"});
$('#dimension_width').prop('disabled',false).val('30').css({"display":"block"});
$('#dimension_height').prop('disabled',false).val('30').css({"display":"block"});
});
$('#addnewlink').click(function(){
elem=null;
$("[data-popup-open='web']").click();
$('#webtv_name,#webtv_url').val('');
$('#hls,#submit-webtv').prop('disabled', true);
setTimeout(function() { $('#webtv_url').focus(); }, 600);
});
$('#webtvopen').click(function(){
if ( $('#webtv_set').css('max-height') == '0px' ) {
drop(webtv_set);
}
location.href='#webpos';
});
$('#dvb_name').on('change keyup paste input propertychange', function() {
if ($.trim($('#dvb_name').val()) == '') {
$('#submit-tv').prop('disabled', true).css({"display":"none"});
}
else {
$('#submit-tv').prop('disabled', false).css({"display":"block"});
}
});
$('[data-popup-open]').on('click', function(e) {
if (document.querySelectorAll(".marquee")[0].style.display=="block" && arg!='idle') {
document.querySelectorAll(".marquee")[0].style.display = "none";
}
var targeted_popup_class = $(this).attr('data-popup-open');
$('[data-popup="' + targeted_popup_class + '"]').fadeIn(0);
e.preventDefault();
if (isTouchSupported) {
$('body').not('.popup-inner').css({
"overflow":"hidden",
"position": "fixed"
});
}
});
$('[data-popup-close]').on('click', function(e) {
if (document.querySelectorAll(".marquee")[0].style.display=="none" && arg!='idle') {
document.querySelectorAll(".marquee")[0].style.display = "block";
}
if (isTouchSupported) {
$('body').not('.popup-inner').css({
"overflow":"auto",
"position": "static"
});
}
var targeted_popup_class = $(this).attr('data-popup-close');
$('[data-popup="' + targeted_popup_class + '"]').fadeOut(0);
e.preventDefault();
});
$("#edit_element").on('click', function(){
$("[data-popup-close='edit']").click();
$("[data-popup-open='"+elem.attr('class')+"']").click();
});
$("[data-popup-open='edit']").on('click', function(){
var image=elem.parent().find('img').attr('src');
if (typeof image != 'undefined') {
$('#edit_logo').prop('disabled',false).text(constants['ST_EDIT_LOGO']);
$('#remove_logo').prop('disabled',false);
$('.remove_inner').css('display','block');
}
else {
$('#edit_logo').prop('disabled',false).text(constants['ST_ADD_LOGO']);
$('#remove_logo').prop('disabled',true);
$('.remove_inner').css('display','none');
}
if (elem.attr('class')=='web') {
$('.import_inner').css('display','block');
$('.sync_inner').css('display','none');
} else {
$('.import_inner').css('display','none');
$('.sync_inner').css('display','block');
}
});
$('#dimension_width,#dimension_height').on('change keyup paste input propertychange', function() {
if (($.trim($('#dimension_width').val()) == '') || ($.trim($('#dimension_height').val()) == '')) {
$('#submit-logo').prop('disabled',true);
$(".submit.logo").css({"display":"none"});
}
else {
$('#submit-logo').prop('disabled',false);
$(".submit.logo,#submit-logo").css({"display":"block"});
}
});
$('#shell_run').on('change keyup paste input propertychange', function() {
if($.trim($('#shell_run').val()) == '') {
$('#submit-run').prop('disabled', true);
}
else {
$('#submit-run').prop('disabled', false);
}
});
$("#shell_run").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
$('[data-popup="run"]').fadeOut(0);
$('#submit-run').click();
}
});
$("#script_sh").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
$('[data-popup="scripts"]').fadeOut(0);
$('#submit-scripts').click();
}
});
$('.osd').on('scroll touchmove mousewheel', function(e){
e.preventDefault();
e.stopPropagation();
return false;
})
$('.purelabel').on("mouseenter",function(){
$('.purebox + .purelabel').css({
"background-position": "0 -24px"
});
});
$('.purelabel').on("mouseleave",function(){
if ($('#pure').is(':not(:checked)')) {
$('.purebox + .purelabel').css({
"background-position": "0 0"
});
}
});
$('#pure').on("change", function() {
if ($('#pure').is(':not(:checked)')) {
if (isTouchSupported) {
$('.purebox + .purelabel').css({
"background-position": "0 0"
});
}
}
else {
if (isTouchSupported) {
$('.purebox + .purelabel').css({
"background-position": "0 -24px"
});
}
}
});
/* TIMELINE */
$('#switch_timeline').on('click', function() {
switch_timeline();
});
$('#timeline').on("mousemove touchmove", function(e) {
if ($('#timeline').is(':enabled')) {
if(e.which==1 || isTouchSupported)
{
var sec_num = parseInt($(this).val(), 10); // stackoverflow.com/questions/6312993
var hours = Math.floor(sec_num / 3600);
var minutes = Math.floor((sec_num - (hours * 3600)) / 60);
var seconds = sec_num - (hours * 3600) - (minutes * 60);
if (hours < 10) {hours = "0"+hours;}
if (minutes < 10) {minutes = "0"+minutes;}
if (seconds < 10) {seconds = "0"+seconds;}
var time = hours+':'+minutes+':'+seconds;
$('#console').html(constants['OUT_SEEKTO'] + ': ' + time);filename='';
if (parseInt($('.marquee').css('height'), 10) <= 73) {
if (document.getElementById('osd').style.display!='block') {
document.getElementById('osd').style.display='block';
}
document.getElementById('osd').textContent=time;
}
document.querySelectorAll(".playtime")[1].innerText = time;
}
}
}).on("touchend mouseup mouseleave", function() {
setTimeout (function () {
document.getElementById('osd').textContent='OSD';
document.getElementById('osd').style.display='none';
}, 500);
});
$('#timeline').on("change", function() {
ajax('seekto',$(this).val());
});
$('#timeline').on('touchend mouseup', function(){
$('html').removeClass('ontouch_thumb');
clearInterval(timeout_timeline);
timeout_timeline=null;
timeout_timeline = setTimeout(function(){
timeline_move=false;
},2500);
}).on('touchstart mousedown', function(){
clearInterval(timeout_timeline);
timeout_timeline=null;
timeline_move=true;
$('html').addClass('ontouch_thumb');
});
/* THEME */
$('#themes, #pure').change(function(){
$('#submit-general').prop('disabled', false);
});
/* FILE SELECTION */
$('#selected').change(function(){
stop=true;
if (arg!='idle') {
ajax('play',$('#selected').val(),'file');
}
});
/* SCRIPTS */
$('#script_edit').on('change keyup paste input propertychange', function() {
$('#remove-script').prop('disabled', false);
$('#submit-scripts').prop('disabled', true);
var script = $('#script_edit').val().split("|||");
$('#script_pre').val(script[0]);
$('#script_sh').val(script[1]);
});
$('#script_pre,#script_sh').on('change keyup paste input propertychange', function() {
$('#remove-script').prop('disabled', true);
if(($.trim($('#script_pre').val()) == '') ||
($.trim($('#script_sh').val()) == '')) {
$('#submit-scripts').prop('disabled', true);
}
else {
$('#submit-scripts').prop('disabled', false);
}
});
/* SELECT USER */
$('#users,#mdns').on('change keyup paste input propertychange', function() {
$('#submit-general').prop('disabled', false);
});
/* SELECT LOCALIZATION */
$('#enc,#lang,#font-size,#fonts,#custom_subs').on('change keyup paste input propertychange', function() {
$('#submit-localization').prop('disabled', false);
});
/* MEDIA PATHS TEXT INPUT */
$('#text').on('change keyup paste input propertychange', function() {
$('#submit-paths').prop('disabled', false);
});
$('#mediapaths').click(function(){
var eol = $("#text").val().trim();
setTimeout(function() { $('#text').focus().val("").val(eol + "\n"); }, 600);
});
/* KODI VNC TVHEADEND CONFIGURATION */
$('#scheme_kodi,#username_kodi,#password_kodi,#port_kodi,#port_kodi,#port_kodi,#port_kodi,#port_kodi,#scheme_vnc,#username_vnc,#password_vnc,#port_vnc,#username_tvheadend,#password_tvheadend,#port_tvheadend,#path').on('change keyup paste input propertychange', function() {
$('#submit-link').prop('disabled', false).css({"display":"initial"});
});
/* BUTTON EFFECTS */
$(".channels button,.extra button").on("mouseenter",function(){
if (!isTouchSupported) {
$(this).css({
"background-color":constants['group9b'],
});
}
});
$(".channels button,.extra button").on("mouseleave",function(){
if (!isTouchSupported) {
$(this).css({
"background-color":constants['group12d']
});
}
});
$('.bb').on('mouseenter', function(){
if (!isTouchSupported) {
$("#bb_img").attr("src","img/" + constants['theme'] + "/left_arrow_hovered.png?v=" + constants['VER']);
$(".bb").css({
"border-color":constants['group44']
});
}
});
$('.bb').on('mouseleave', function(){
if (!isTouchSupported) {
$("#bb_img").attr("src","img/" + constants['theme'] + "/left_arrow.png?v=" + constants['VER']);
$(".bb").css({
"border-color":constants['group41']
});
}
});
$('.ff').on('mouseenter', function(){
if (!isTouchSupported) {
$("#ff_img").attr("src","img/" + constants['theme'] + "/left_arrow_hovered.png?v=" + constants['VER']);
$(".ff").css({
"border-color":constants['group44']
});
}
});
$('.ff').on('mouseleave', function(){
if (!isTouchSupported) {
$("#ff_img").attr("src","img/" + constants['theme'] + "/left_arrow.png?v=" + constants['VER']);
$(".ff").css({
"border-color":constants['group41']
});
}
});
$('.play').on('mouseenter', function(){
if (!isTouchSupported) {
$("#play_img").attr("src","img/" + constants['theme'] + "/play_hovered.png?v=" + constants['VER']);
$(".play").css({
"border-color":constants['group44']
});
if (parseInt(out[4])>0) {
clearInterval(timeout_play);
timeout_play=null;
timeout_play = setTimeout(function(){
if (!paused) {
$("#play_img").attr("src","img/" + constants['theme'] + "/pause_hovered.png?v=" + constants['VER']);
}
}, 200);
}
}
});
$('.play').on('mouseleave', function(){
if (!isTouchSupported) {
clearInterval(timeout_play);
timeout_play=null;
$("#play_img").attr("src","img/" + constants['theme'] + "/play.png?v=" + constants['VER']);
$(".play").css({
"border-color":constants['group41']
});
}
});
$('#url_address').on('mouseenter', function(){
if (!isTouchSupported) {
if (!$("#url_address").is(":focus")){
if ($.trim($('#url_address').val()) != '') {
$("#clear").css('cursor','initial');
$('#url_address').css({
'border-left':'6px solid',
'border-left-color':constants['group51']
});
}
}
$("#url_address").css({
"color":constants['group1b']
});
}
});
$('#clear').click(function(){
$('#url_address').val('');
setTimeout(function() { $('#url_address').focus(); }, 600);
});
$("#url_address").keypress(function(event) {
if (event.which == 13) {
$('#url_address').blur();
ajax('play',$('#url_address').val(),'url');
$(".sidepane_search").width("0px");
}
});
$('#url_address').on('mouseleave', function(){
if (!isTouchSupported) {
if (!$("#url_address").is(":focus")){
$('#url_address').css({
'border-left':'0px solid',
'border-left-color':constants['group51']
});
$("#url_address").css({
"color":constants['group1c']
});
}
}
});
$('#url_address').on('blur', function() {
if (!$("#url_address").is(":focus")){
$('#url_address').css({
'border-left':'0 solid',
'border-left-color':constants['group51']
});
}
$("#url_address").css({
"color":constants['group1c']
});
$("#url_address").attr('placeholder',constants['INDEX_SEARCH']);
});
$('#url_address').on('focus', function() {
$("#url_address").attr('placeholder',constants['INDEX_SEARCH_FOCUS']);
})
$('#url_address').on('change keyup paste input propertychange', function() {
if ($.trim($('#url_address').val()) == '') {
$('#url_address').css({
'border-left':'0 solid',
'border-left-color':constants['group51']
});
}
else {
$('#url_address').css({
'border-left':'6px solid',
'border-left-color':constants['group51']
});
}
$("#url_address").css({
"color":constants['group1b']
});
});
$('#url_address').on('touchstart', function() {
if ($.trim($('#url_address').val()) != '') {
$("#url_address").css({
'border-left':'0 solid'
});
}
else {
$('#url_address').css({
'border-left':'0 solid',
'border-left-color':constants['group51']
});
}
$("#url_address").css({
"color":constants['group1b']
});
});
$('#clear').on('touchstart mouseenter', function(){
if ($.trim($('#url_address').val()) != '') {
$("#url_address").css({
'border-left':'0 solid'
});
$("#clear").css('cursor','pointer');
}
else {
$("#clear").css('cursor','initial');
}
$("#url_address").css({
"color":constants['group1b']
});
});
$('#clear').on('touchend mouseleave', function(){
if ($.trim($('#url_address').val()) != '') {
$("#url_address").css({
'border-left':'6px solid',
'border-left-color':constants['group51']
});
}
else {
$('#url_address').css({
'border-left':'0 solid'
});
}
$("#url_address").css({
"color":constants['group1c']
});
});
/* PAGE NAVIGATORS */
$('.up_tv').on('touchstart mousedown', function(){
$("#up_tv").attr("src","img/" + constants['theme'] + "/up_hovered.png?v=" + constants['VER']);
});
$('.up_tv').on('touchend mouseup', function(){
$("html, body").animate({ scrollTop: 0 }, "slow");
setTimeout(function() {
$("#up_tv").attr("src","img/" + constants['theme'] + "/up.png?v=" + constants['VER']);
},1000);
});
$('.up_tv').on('mouseenter', function(){
if (!isTouchSupported) {
$("#up_tv").attr("src","img/" + constants['theme'] + "/up_hovered.png?v=" + constants['VER']);
}
});
$('.up_tv').on('mouseleave', function(){
if (!isTouchSupported) {
$("#up_tv").attr("src","img/" + constants['theme'] + "/up.png?v=" + constants['VER']);
}
});
$('.up_webtv').on('touchstart mousedown', function(){
$("#up_webtv").attr("src","img/" + constants['theme'] + "/up_hovered.png?v=" + constants['VER']);
});
$('.up_webtv').on('touchend mouseup', function(){
$("html, body").animate({ scrollTop: 0 }, "slow");
setTimeout(function() {
$("#up_webtv").attr("src","img/" + constants['theme'] + "/up.png?v=" + constants['VER']);
},1000);
});
$('.up_webtv').on('mouseenter', function(){
if (!isTouchSupported) {
$("#up_webtv").attr("src","img/" + constants['theme'] + "/up_hovered.png?v=" + constants['VER']);
}
});
$('.up_webtv').on('mouseleave', function(){
if (!isTouchSupported) {
$("#up_webtv").attr("src","img/" + constants['theme'] + "/up.png?v=" + constants['VER']);
}
});
/* SHELL SCRIPT TAGS */
$('.expand .nav_inner').on('mouseenter', function(){
if (!isTouchSupported) {
$('.expand .nav_inner').css('color',constants['group3b']);
}
});
$('.expand .nav_inner').on('mouseleave', function(){
if (!isTouchSupported) {
$('.expand .nav_inner').css('color',constants['group55b']);
}
});
$('.expand .nav_inner').on('touchstart', function(){
$('.expand .nav_inner').css('color',constants['group3b']);
});
$('.expand .nav_inner').on('touchend', function(){
setTimeout (function() {
$('.expand .nav_inner').css('color',constants['group55b']);
},600);
});
$(".wrapper_bar_nav button").on("touchstart mousedown",function(){
$(this).not('#RR').css({
"color":constants['group7b']
});
});
$(".wrapper_bar_nav button").on("touchend mouseup",function(){
$(this).not('#RR').css({
"color":constants['group7']
});
});
$(".wrapper_bar_nav button").on("mouseenter",function(){
if (!isTouchSupported) {
$(this).not('#RR').css({
"color":constants['group7b']
});
}
});
$(".wrapper_bar_nav button").on("mouseleave",function(){
if (!isTouchSupported) {
$(this).not('#RR').css({
"color":constants['group7']
});
}
});
//TERMINAL INTERFACE
if (constants['theme']=='terminal') {
$('.wrapper_bar').css({
"font-weight":"400",
"border":"1px solid #4c9900",
"border-left":"0"
});
$('.wrapper_bar button').css({
"font-size":"14px"
});
$('.option').css({
"border-color":"transparent"
});
$('#signal').remove();
$('#RR').remove();
$('<img/>',{
src: "img/"+constants['theme']+"/raspberry.png?v=" + constants['VER']
}).prependTo('.wrapper_bar_nav').css({
'width':'350px',
'height':'34px',
'background-color':'#000',
'image-rendering':'pixelated',
'position':'relative'
});
$('.wrapper_bar_nav').css({
"height":"48px"
});
$('.basic button').css({
"font-weight":"400"
});
$( ".nofont img" ).each(function() {
$( this ).remove();
});
$('.channels').removeClass('nofont');
$('.button button, .button a').css({"font-size":"12px","width":"80px"});
}
//MATERIAL INTERFACE
if (constants['theme'].indexOf("material")!==-1) {
$('body').css('margin','0 auto');
$('.round_style.control').css('margin','0 auto');
$('#clear').remove();
$('#RR').remove();
$('#signal').remove();
$('.wrapper_bar_nav').appendTo('.file_select');
$('#expand_pane,#search_pane,#expand_opt').on('mouseenter', function () {
if (!isTouchSupported) {
$(this).addClass('material_focus');
}
});
$('#expand_pane,#search_pane,#expand_opt').on('mouseleave', function () {
if (!isTouchSupported) {
$(this).removeClass('material_focus');
}
});
$('#expand_pane,#search_pane,#expand_opt').on('touchstart', function () {
$(this).addClass('material_focus');
});
$('#expand_pane,#search_pane,#expand_opt').on('touchend', function () {
$(this).removeClass('material_focus');
});
$('.url_address').prependTo(".sidepane_search");
$('.option').css('margin-top', $('.material_menu').height()-1 + 'px');
}
|
cc76bc5ad71495ef295873f5bd2bd447c359c82a
|
[
"JavaScript",
"PHP"
] | 4 |
PHP
|
flysurfer28/raspberry-remote
|
dfb8afa775569449d85a69572073d4b89220385d
|
47a610502a04eb55690a6975398deb979ccdfce9
|
refs/heads/master
|
<repo_name>abdulmannan17/JS-Practice<file_sep>/C3/app.js
var age = 15;
alert("I am " +age+ " years old");
var birthYear = 2004;
document.write("my birth year is " + birthYear + "<br>");
var name = prompt('Your Name');
var product = "Shirts";
var quantity = prompt('how many '+product);
document.write(name + " ordered " + quantity + ''+product);<file_sep>/README.md
# JS-Practice
Only App.JS and Index.html contain code of all 20 chapters
Other folders are topical.
<file_sep>/C4/app.js
var a = 15;
var b = "-";
var c = 5;
alert( a+ ''+b+''+c);
// 1. name1 2.firstName 3. value2 4. age 5. percentage
// 1. for 2. while 3. 3name 4. log 5. 1value
document.write('Rules for naming JS Variables' + "<br>"+"<br>" + "Variable names can only contain ,numbers, $ and_.For e.g:$my+1stValue " + "<br>"+"Variable must begin with a letter,$ or _."+"<br>"+"Varibles are case sensitive"+"<br>"+"Variables cannot be Keywords");
<file_sep>/C2/app.js
var userName = "Mannan17";
var myName = "<NAME>";
var message = "Hello World";
alert(message);
alert(myName);
alert("15 Years Old");
alert("Certified Mobile App Developer");
var food = "Pizza";
alert("Pizza\nPizz\nPiz\nPi\nP");
var email = "<EMAIL>";
alert("My email address is " + email);
var book = "A smarter way to learn Javascript";
alert("I am trying to learn from the book " + book);
document.write("Ya! I can write HTML content through JS");
var sign = "▬▬▬▬▬▬▬▬▬ஜ ۩۞۩ ஜ▬▬▬▬▬▬▬▬▬"
alert(sign);<file_sep>/C6/app.js
/*var num = prompt("Enter any number:");
var num1 = num++;
var num2 = ++num;
var num3 = num--;
var num4 = --num;
document.write("++num "+ num1+"<br>"+"num++ "+ num2 + "<br>"+"--num "+ num3 + "<br>" + "num-- " + num4);
*/
/*var a = prompt("Enter any");
var b = prompt("Enter num");
var result = -a - -b + ++b + b--;
var a1 = --a - --b;
var a2 = --a - --b + ++b;
var a3 = --a - --b + ++b + b--;
document.write("-a - -b + ++b + b-- = "+result+"<br>");
document.write("-a = "+a+"<br>");
document.write("--a - --b = "+a1+"<br>");
document.write("--a - --b + ++b = "+a2+"<br>");
document.write("--a - --b + ++b + b-- = "+ a3+"<br>");
*/
/*var a = prompt("Enter Name");
alert("Hello! "+ a)*/
/*var table = prompt("Which Table");
document.write("Table of "+table);
for(var i =1; i <= 12; i++){
document.write(table+"x"+i+"="+table*i+"<br>");
}
if(table = ''){
document.write(5+"x"+i+"="+5*i+"<br>");
}
*/
/*var s1 = prompt("Enter Subject");
var m1 = prompt("Enter Marks");
var s2 = prompt("Enter Subject");
var m2 = prompt("Enter Marks");
var s3 = prompt("Enter Subject");
var m3 = prompt("Enter Marks");
var totalMarks = 100;
document.write(s1+": "+ m1 +" "+totalMarks+" "+ " "+ m1 +"%" +"<br>");
document.write(s2+": "+ m2 +" "+totalMarks+" "+ " "+ m2 +"%" +"<br>");
document.write(s3+": "+ m3 +" "+totalMarks+" "+ " "+ m3 +"%" +"<br>");
*/
<file_sep>/app.js
/*Chapter 1
alert("Hello");
var a = prompt("Enter Password");
alert("Error! Please enter a valid password");
alert("Welcome to JS land\nHappy Coding!");
alert("Welocme to JS Land");
alert("Welcome to JS land\nHappy Coding!");
alert("Happy Coding\n ~ Prevent this page from creating additional dialogs");
alert("Hello...I can run JS through my web browser's console");
*/
/*Chapter 2
var userName = "Mannan17";
var myName = "<NAME>";
var message = "Hello World";
alert(message);
alert(myName);
alert("15 Years Old");
alert("Certified Mobile App Developer");
var food = "Pizza";
alert("Pizza\nPizz\nPiz\nPi\nP");
var email = "<EMAIL>";
alert("My email address is " + email);
var book = "A smarter way to learn Javascript";
alert("I am trying to learn from the book " + book);
document.write("Ya! I can write HTML content through JS");
var sign = "▬▬▬▬▬▬▬▬▬ஜ ۩۞۩ ஜ▬▬▬▬▬▬▬▬▬"
alert(sign);
*/
/*Chapter 3
var age = 15;
alert("I am " +age+ " years old");
var birthYear = 2004;
document.write("my birth year is " + birthYear + "<br>");
var name = prompt('Your Name');
var product = "Shirts";
var quantity = prompt('how many '+product);
document.write(name + " ordered " + quantity + ''+product);
*/
/*Chapter 4
var a = 15;
var b = "-";
var c = 5;
alert( a+ ''+b+''+c);
// 1. name1 2.firstName 3. value2 4. age 5. percentage
// 1. for 2. while 3. 3name 4. log 5. 1value
document.write('Rules for naming JS Variables' + "<br>"+"<br>" + "Variable names can only contain ,numbers, $ and_.For e.g:$my+1stValue " + "<br>"+"Variable must begin with a letter,$ or _."+"<br>"+"Varibles are case sensitive"+"<br>"+"Variables cannot be Keywords");
*/
/*Chapter 5
var a = prompt('FirstNumber');
var b = prompt('SecNumber');
var sign = prompt('Operator')
var c = (+a)+(+b);
var d = a-b;
var e = a*b;
var f= a/b;
var g = a % b;
//document.write("Sum of "+ a +" and "+ b + " is " + c);
if (sign === "+"){
document.write("Sum of "+ a +" and "+ b + " is " + c);
}
else if (sign === "+"){
document.write("Subtraction of "+ a +" and "+ b + " is " + d);
}
else if (sign === "*"){
document.write("Multiplication of "+ a +" and "+ b + " is " + e);
}
else if ( sign === "/"){
document.write("Division of "+ a +" and "+ b + " is " + f);
}
else if (sign === "%"){
document.write("Modulus of "+ a +" and "+ b + " is " + e)
}
*/
/*var initial = prompt("Your Number");
initial1 = initial;
var incre = (+initial1)+(+1);
var add = (+initial)+(+7);
var initial2 = 1;
var subtract = add-1;
var zero = 0;
document.write('<br>'+'Value after variable declaration is undefined');
document.write('<br>'+'Initial Value: ' + initial1);
document.write('<br>'+ 'Val after increment is '+ incre);
document.write('<br>'+ 'Val after addition is '+ add);
document.write('<br>'+ 'Val after decrement is '+ subtract);
document.write('<br>'+ 'Remainder is '+ zero);
*/
/*var ticket = 600;
var numberOfTickets = prompt("How many tickets");
var cost = ticket*numberOfTickets;
document.write('Total cost to buy ' + numberOfTickets + ' tickets to a movie is ' +cost );
*/
/*var table = prompt("Which Table");
document.write("Table of "+table);
for(var i =1; i <= 10; i++){
document.write(table+"x"+i+"="+table*i+"<br>");
}*/
/*var celsius = prompt('Temperature in Celsius');
var convert1 = (celsius*9/5)+32;
document.write(celsius +"C"+" is"+ convert1+"<br>");
var fahrenheit = prompt('Temperature in Fahrenheit');
var convert2 = [(fahrenheit-32)*5]/9;
document.write(fahrenheit +"F"+" is"+ convert2);
*/
/*var head = "Shopping Cart";
var price1 = 650;
var q1 = prompt("How Many?");
var price2 = 100;
var q2 = prompt('How Many?');
var charges = 100;
var tcost = (+price1*q1) +(+price2*q2);
document.write(head + "<br>"+"<br>" + "Price of item 1 is " + price1 +"<br>"+"Quantity of item 1 is "+ q1+"<br>" + "Price of item 2 is " + price2 +"<br>"+"Quantity of item 2 is "+ q2+"<br>"+"Shipping Charges: "+ charges +"<br>"+"<br>"+"Total cost of your order is "+ tcost);
*/
/*var markTotal = 980;
var markObtained = prompt("Your Marks");
var headmark = "Marks Sheet";
var Percentage = markObtained / markTotal *100
document.write(headmark + "<br>" + "<br>" + "Total marks: "+markTotal+"<br>"+"Marks obtained: "+markObtained+"<br>"+"Percentage: "+ Percentage)
*/
/*var dollar = prompt("How many Dollars?");
var riyal = prompt("How many in Riyals");
var pkr = (dollar*104.8)+(riyal*28);
document.write("Total Currency in PKR: "+ pkr);
*/
/*var val1 = prompt("Enter Number");
var aritmetic = [(+val1)+(+5)]*10/2;
document.write(aritmetic);
*/
/*var birthYear = prompt("Birth Year");
var currentYear = prompt("Current Year");
var a = "Age Calculator";
document.write( a +"<br>"+currentYear - birthYear);
*/
/*var radius = prompt("Enter Radius");
var circumference = 2*(3.142)*radius;
var area = (3.142)*radius;
document.write("Radius: "+ radius +"<br>" +"Circumference: "+ circumference+"<br>"+"Area: "+ area);
*/
/*var favSnack = prompt("Fav Snacks");
var currentAge = prompt("Current Age");
var estAge = 70;
var aPerDay = 1;
var totalSnacks = 365*(estAge-currentAge);
document.write(totalSnacks +""+ favSnack);
*/
/*Chapter 6-9
var num = prompt("Enter any number:");
var num1 = num++;
var num2 = ++num;
var num3 = num--;
var num4 = --num;
document.write("++num "+ num1+"<br>"+"num++ "+ num2 + "<br>"+"--num "+ num3 + "<br>" + "num-- " + num4);
*/
/*var a = prompt("Enter any");
var b = prompt("Enter num");
var result = -a - -b + ++b + b--;
var a1 = --a - --b;
var a2 = --a - --b + ++b;
var a3 = --a - --b + ++b + b--;
document.write("-a - -b + ++b + b-- = "+result+"<br>");
document.write("-a = "+a+"<br>");
document.write("--a - --b = "+a1+"<br>");
document.write("--a - --b + ++b = "+a2+"<br>");
document.write("--a - --b + ++b + b-- = "+ a3+"<br>");
*/
/*var a = prompt("Enter Name");
alert("Hello! "+ a)*/
/*var table = prompt("Which Table");
document.write("Table of "+table);
for(var i =1; i <= 12; i++){
document.write(table+"x"+i+"="+table*i+"<br>");
}
if(table = ''){
document.write(5+"x"+i+"="+5*i+"<br>");
}
*/
/*var s1 = prompt("Enter Subject");
var m1 = prompt("Enter Marks");
var s2 = prompt("Enter Subject");
var m2 = prompt("Enter Marks");
var s3 = prompt("Enter Subject");
var m3 = prompt("Enter Marks");
var totalMarks = 100;
document.write(s1+": "+ m1 +" "+totalMarks+" "+ " "+ m1 +"%" +"<br>");
document.write(s2+": "+ m2 +" "+totalMarks+" "+ " "+ m2 +"%" +"<br>");
document.write(s3+": "+ m3 +" "+totalMarks+" "+ " "+ m3 +"%" +"<br>");
*/
/*Chapter 9-11
var city = prompt("Enter City");
if(city === "Karachi"){
alert("Welcome to city of lights");
}
else{
alert("OK");
}*/
/*var gender = prompt("Gender");
if(gender === "Male"){
alert("Good Morning Sir!");
}
else if(gender === "Female"){
alert("Good Morning Madam!");
}
else{
alert("Enter valid Gender");
}
var lights = prompt("Red, Green Or Yellow");
var yellow = "Ready To Move";
var green = "Move Now";
if(lights = "Red"){
alert("Must Stop");
}
else if (lights = "Green"){
alert("Move Now");
}
else{
alert("Ready to move");
}*/
/*var fuel = prompt("How much fuel?");
if(fuel < 0.25){
alert("Please refill the fuel in your car");
}
else{
alert("You are good to go!");
}
*/
/*var a = 4;
if (++a === 5){
alert("given condition for variable a is true");
}
//true
var b = 82;
if (b++ === 83){
alert("given condition for variable b is true");
}//false
var c = 12;
if (c++ === 13){
alert("condition 1 is true");
}//false
if (c === 13){
alert("condition 2 is true");
}//true
if (++c < 14){
alert("condition 3 is true");
}//false
if(c === 14){
alert("condition 4 is true");
}//true
var materialCost = 20000;
var laborCost = 2000;
var totalCost = materialCost + laborCost;
if (totalCost === laborCost + materialCost){
alert("The cost equals");
}//true
if (true){
alert("True");
} //true
if (false){
alert("False");
}
if("car" < "cat"){
alert("car is smaller than cat");
}//true*/
/*var s1 = prompt("Enter Subject");
var m1 = prompt("Enter Marks");
var s2 = prompt("Enter Subject");
var m2 = prompt("Enter Marks");
var s3 = prompt("Enter Subject");
var m3 = prompt("Enter Marks");
var totalMarks = 100;
if(m1,m2,m3 >= 90 && m1,m2,m3 <= 100 ){
document.write("A+"+"<br>"+"Excellent");
}
else if (m1,m2,m3 >= 80 && m1,m2,m3 <= 89){
document.write("A"+"<br>"+"Good");
}
else if (m1,m2,m3 >= 70 && m1,m2,m3 <= 79){
document.write("B"+"<br>"+"Average");
}
else{
document.write("You need to improve");
}
document.write("<br>"+s1+": "+ m1 +" "+totalMarks+" "+ " "+ m1 +"%" +"<br>");
document.write("<br>"+s2+": "+ m2 +" "+totalMarks+" "+ " "+ m2 +"%" +"<br>");
document.write("<br>"+s3+": "+ m3 +" "+totalMarks+" "+ " "+ m3 +"%" +"<br>");
*/
/*var a = 7;
var b = prompt("1-10?");
if(b == a){
alert("Bingo! Correct answer");
}
else if(b == (+a+1)){
alert("Close enough to the correct answer");
}
else {
alert("Wrong!")
}
var a = prompt("Any Number");
var b = a % 3;
if(b == 0){
alert("Number is Divisble by 3");
}
else{
alert("Number is not Divisible by 3");
}
var num = prompt("Any Number");
var even = num % 2;
if(even == 0){
alert("Even");
}
else{
alert("Odd");
}
var t = prompt("Temperature");
if (t >= 40){
alert("It's Too Hot");
}
else if (t >= 30){
alert("The Weather Is Normal");
}
else if (t >= 20){
alert("Today's Weather is cool");
}
else if (t >= 10){
alert("OMG!");
}
else{
alert("");
}*/
/*var a = prompt('FirstNumber');
var b = prompt('SecNumber');
var sign = prompt('Operator')
var c = (+a)+(+b);
var d = a-b;
var e = a*b;
var f= a/b;
var g = a % b;
//document.write("Sum of "+ a +" and "+ b + " is " + c);
if (sign === "+"){
document.write("Sum of "+ a +" and "+ b + " is " + c);
}
else if (sign === "+"){
document.write("Subtraction of "+ a +" and "+ b + " is " + d);
}
else if (sign === "*"){
document.write("Multiplication of "+ a +" and "+ b + " is " + e);
}
else if ( sign === "/"){
document.write("Division of "+ a +" and "+ b + " is " + f);
}
else if (sign === "%"){
document.write("Modulus of "+ a +" and "+ b + " is " + e)
}
*/
/*Chapter 12-13
var a = prompt("Enter anything");
if ( a = Number){
alert("Number");
}
else if (a = "A"||"B"||"C"||"D"||"E"||"F"||"G"||"H"||"I"||"J"||"K"||"L"||"M"||"N"||"O"||"P"||"Q"||"R"||"S"||"T"||"U"||"V"||"W"||"X"||"Y"||"Z"){
alert("UpperCase");
}
else{
alert("LowerCase");
}
var a = prompt("Num1");
var b = prompt("Num2");
var c = b < a ;
var d = b > a;
if(c){
alert(a);
}
else if(d){
alert(b);
}
else if(a == b){
alert("Equal");
}
else {
alert("Invalid");
}
var password = prompt("Enter Password");
var password1 = prompt("Enter Password again");
if(password=""){
alert("Please Enter Your Password");
}
else if(password1 === password){
alert("Correct Password");
}
else{
alert("Wrong");
}
var x = prompt("Enter a number");
if (x > 0){
alert("Positive");
}
else if (x < 0){
alert("Negative");
}
else{
alert("Zero")
}
var v = prompt("Enter a letter in lowercase");
var vowels = ["a", "e","i","o","u"];
if( v === vowels[0]){
alert("vowel");
}
else if( v === vowels[1]){
alert("vowel");
}
else if( v === vowels[2]){
alert("vowel");
}
else if( v === vowels[3]){
alert("vowel");
}
else if( v === vowels[4]){
alert("vowel");
}
else{
alert("false");
}*/
/*var greeting = prompt("Enter Time") ;
var morning = "Good Day";
var night = "Good evening";
if (greeting < 18) {
alert(morning);
}
else {
alert(night);
}
var time = prompt("24 Hour Clock");
var convert = time - 12;
if (time >=12){
alert(convert + "PM");
}
else {
alert(time + "AM");
}*/
/*CHAPTER 14-16
var students = [];
var students1 = new Array();
var string = ["ali","ahmes"];
var num = [1,2,2];
var bool = [true,false];
var mixed = ["day",4,false];
var eduPk = ["SSC","HSC","BCS","BS","BCOM","MS","M.Phil","PhD"];
var cities = ["KHI","LHE","QUE"];
var a = ["Michael", "John", "Tony"];
var m = [320,230,480];
document.write("Score of "+ a[0]+ " is " + m[0]+ ". Percentage: " + m[0]/500*100 + "%" + "<br>" +
"Score of "+ a[1]+ " is " + m[1]+ ". Percentage: " + m[1]/500*100 + "%" + "<br>" +
"Score of "+ a[2]+ " is " + m[2]+ ". Percentage: " + m[2]/500*100 + "%" + "<br>");
var color = ["red","yellow","green"];
var a1 = prompt("Add a color");
var b1 = color.unshift(a1);
alert(color);
var a2 = prompt("Add a color to the end");
var b2 = color.push(a2);
alert(color);
var a3 = prompt("Add another color");
var a4 = prompt("Add another color");
var b3 = color.unshift(a3);
var b4 = color.unshift(a4);
alert(color);
var b5 = color.shift();
alert(color);
var b6 = color.pop();
alert(color);
var color = ["red","yellow","green"];
var a5 = prompt("Where to add new color");
var a6 = prompt("Color Name");
var b7 = color.splice(a5,0,a6)
alert(color);
var a7 = prompt("Where to delete");
var a8 = prompt("How Many");
var b8 = color.splice(a7,a8)
alert(color);
var score = [320,230,350,190];
document.write(score + "<br>" + "Ascending Order: " + score.sort(function(a, b){return a-b}));
var city = ["Karachi", "Lahore", "Islamabad", "Quetta", "Peshawar"];
var selectedCities = [city[0], city[3], city[2]];
document.write(city + "<br>" + selectedCities);
var arr = ["This","is","my","cat"];
var join = arr.join();
document.write(join);
var a = new Array();
var count = a.push("A", "B", "C");
document.write(a + "<br>");
var item1 = a.shift();
document.write(item1 + "<br>");
var item2 = a.slice(0,1);
document.write(item2 + "<br>");
var item3 = a.pop();
document.write(item3 + "<br>");
var a = new Array();
var count = a.unshift("A", "B", "C");
document.write(a + "<br>");
var item1 = a.pop();
document.write(item1 + "<br>");
var item2 = a.splice(1,1);
document.write(item2 + "<br>");
var item3 = a.shift();
document.write(item3 + "<br>");
var phone = ["Apple", "Samsung", "Motorola", "Nokia", "Sony", "Haier"];
document.write(phone);*/
/*CHAPTER 17-20
var num = [[0,1,2,3],[1,0,1,2],[2,1,0,1]];
document.write(num[0]+"<br>"+num[1]+"<br>"+num[2]);
var i;
for( i=1; i<=10;i++) {
document.write(i+"<br>");
}
var mul = prompt("Enter Multiplication Table");
document.write("Table of "+mul+"<br>");
var len = prompt("Enter length");
document.write("Lenght "+len+"<br>");
for (var i = 1; i<=len; i++){
document.write(mul+" x "+i+" = "+mul*i+"<br>");
}
var fruits = ["apple", "banana", "mango", "orange", "strawberry", "pear"];
for( var i= 0 ; i <= 5; i++){
document.write( fruits[i]+ "<br>");
}
for( var index= 0; index <=5; index++){
document.write("Element at index "+index + " is "+ fruits[index]+ "<br>");
}
for(var i = 1; i <=15; i++){
document.write(i + " , ");
}
for(var i = 15; i >=1; i--){
document.write(i + " , ");
}
for (var i = 0 ; i<=20; i++){
if( i%2 == 0){
document.write(i+ " , ");
}
}
for (var o = 0 ; o<=20; o++){
if( o%2 == 1){
document.write(o+ " , ");
}
}
for (var i = 2 ; i<=20; i++){
if( i%2 == 0){
document.write(i+ "k , ");
}
}
var a = ["cake","apple pie", "cookie", "chips", "patties"];
var b = prompt("Welcome to the ABC Bakery. What do you want to order sir/maam?");
var c = b.toLowerCase()
if(c === a[0]){
document.write("cake is available at index 0 in our bakery");
}
else if(c === a[1]){
document.write("apple pie is available at index 1 in our bakery");
}
else if(c === a[2]){
document.write("cookie is available at index 2 in our bakery");
}
else if(c === a[3]){
document.write("chips is available at index 3 in our bakery");
}
else if(c === a[4]){
document.write("patties is available at index 4 in our bakery");
}
else {
document.write(b + " is not available in our bakery");
}
var arr = [24, 53, 78, 91, 12];
var max = arr.reduce(function(a, b) {
return Math.max(a, b);
});
document.write("Greatest Number is "+max+"<br>");
var arr = [24, 53, 78, 91, 12];
var min = arr.reduce(function(a, b) {
return Math.min(a, b);
});
document.write("Lowest Number is "+min);
var a = 5;
for(var i = 0; i <=100; i++){
if(i%a == 0){
document.write(i+ " , ");
}
}
*/<file_sep>/C9/app.js
var students = [];
var students1 = new Array();
var string = ["ali","ahmes"];
var num = [1,2,2];
var bool = [true,false];
var mixed = ["day",4,false];
var eduPk = ["SSC","HSC","BCS","BS","BCOM","MS","M.Phil","PhD"];
var cities = ["KHI","LHE","QUE"];
<file_sep>/C8/app.js
/*var a = prompt("Enter anything");
if ( a = Number){
alert("Number");
}
else if (a)*/
/*var a = prompt("Num1");
var b = prompt("Num2");
var c = b < a ;
var d = b > a;
if(c){
alert(a);
}
else if(d){
alert(b);
}
else if(a == b){
alert("Equal");
}
else {
alert("Invalid");
}
var password = prompt("Enter Password");
var password1 = prompt("Enter Password again");
if(password=""){
alert("Please Enter Your Password");
}
else if(password1 === password){
alert("Correct Password");
}
else{
alert("Wrong");
}*/
/*var greeting = prompt("Enter Time") ;
var morning = "Good Day";
var night = "Good evening";
if (greeting < 18) {
alert(morning);
}
else {
alert(night);
}
var time = prompt("24 Hour Clock");
var convert = time - 12;
if (time >=12){
alert(convert + "PM");
}
else {
alert(time + "AM");
}*/
|
485c37ddbd97f38167bf6e19a51ae60945639d4c
|
[
"JavaScript",
"Markdown"
] | 8 |
JavaScript
|
abdulmannan17/JS-Practice
|
02dda7eee78521160d722e218f3f36734886aa1a
|
ae946792ea0d1dc5e19dcf199e077313da7c51e4
|
refs/heads/master
|
<file_sep>import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import faker from 'faker';
import CommentDetail from './components/CommentDetail';
import ApprovalCard from './components/ApprovalCard';
const App = () => {
return (
<div>
<ApprovalCard>
<CommentDetail author={faker.name.firstName()}
date={faker.date.past().toLocaleDateString()}
image={faker.image.avatar()}
comment={faker.lorem.sentences(3)}
/>
</ApprovalCard>
<ApprovalCard>
<CommentDetail author={faker.name.firstName()}
date={faker.date.past().toLocaleDateString()}
image={faker.image.avatar()}
comment={faker.lorem.sentences(3)}
/>
</ApprovalCard>
<ApprovalCard>
<CommentDetail author={faker.name.firstName()}
date={faker.date.past().toLocaleDateString()}
image={faker.image.avatar()}
comment={faker.lorem.sentences(3)}
/>
</ApprovalCard>
</div>
);
}
ReactDOM.render(<App />, document.querySelector('#root'));
<file_sep>import React from 'react';
const CommentDetail = (props) => {
return (
<div className="flex flex-row">
<div className="mr-2 w-48">
<img className="rounded" alt="avatar" src={props.image} />
</div>
<div className="flex flex-col">
<div className="flex flex-row justify-between">
<div className="font-bold">{props.author}</div>
<div className="text-gray-400">{props.date}</div>
</div>
<div className="">{props.comment}</div>
</div>
</div>
);
}
export default CommentDetail;
|
bdbc5c72b9963e71fd1dc1a3e79a052644e14296
|
[
"JavaScript"
] | 2 |
JavaScript
|
a-tem/UD-react-course-s3-1
|
c43b8900783bf626397336616ad030222922fcaf
|
dc722c3dcc5a07ee17cedf497e902ef2a171ae0c
|
refs/heads/master
|
<file_sep>app.service('beerService', ['$http', function ($http){
var beerData = {
allBeers: []
};
beerData.getAll = function () {
return $http.get('/beers').success(function (data) {
// this copies the response posts from route /beers to the client side
// 'beers' under 'beerService'
angular.copy(data, beerData.allBeers); //this is array under beerData.allBeers
});
};
beerData.addBeer = function(newBeer) {
$http.post('/beers', newBeer).then(function(){
beerData.getAll();
});
}
beerData.removeBeer = function(beer) {
$http.post('/beersremove', beer).then(function(){
beerData.getAll();
});
}
/* var rateBeer = function(newRating, index){
allBeers[index].rating = newRating
}*/
return beerData;/*, rateBeer: rateBeer*/
}]);
/*app.service('beerService', function(){
var allBeers = [{name: "Goldstar", style: "lager", abv: "4%", img:"http://cdn.timesofisrael.com/uploads/2015/04/Gold.jpg"},
{name: "Maccabi", style: "lager", abv: "5%", img:"https://upload.wikimedia.org/wikipedia/commons/1/1d/Makabi_beer.jpg"},
{name: "<NAME>", style: "lager", abv: "5%", img:"http://1.bp.blogspot.com/_BihBQIG3Ccg/TKuVCwTMjuI/AAAAAAAADWs/6h1JjCmngSE/s1600/20101005_2078.jpg"}]
var addBeer = function(newBeer) {
allBeers.push(newBeer)
}
var removeBeer = function(index) {
allBeers.splice([index], 1)
}
/* var rateBeer = function(newRating, index){
allBeers[index].rating = newRating
}*/
/*return {allBeers: allBeers, addBeer: addBeer, removeBeer: removeBeer}
};*/
<file_sep>app.controller('beerCntrl', function($scope, beerService) {
/*connect controller to beerData object on services
and call getAll()*/
beerService.getAll().then(function () {
/*once we called getAll, and the array in the services recieved a response
we can put the data in the view with this line*/
$scope.allBeers = beerService.allBeers;
});
$scope.addBeer = function() {
var newBeer = {
name: $scope.name,
style: $scope.style,
abv: $scope.abv,
img: $scope.image
}
beerService.addBeer(newBeer)
}
$scope.removeBeer = function(beer) {
beerService.removeBeer(beer)
}
});
/*app.controller('beerCntrl', function($scope, beerService) {
//connect allmovies section to array
$scope.allBeers = beerService.allBeers;
$scope.addBeer = function() {
var newBeer = {
name: $scope.name,
style: $scope.style,
abv: $scope.abv,
img: $scope.image
}
beerService.addBeer(newBeer)
}
$scope.removeBeer = function(index) {
beerService.removeBeer (index)
}
/* $scope.rateBeer = function(index) {
var newRating = $scope.rating;
beerService.rateBeer(newRating, index);
}
*/
|
340455dcf144a2965a2ef73d7e513acf503438f1
|
[
"JavaScript"
] | 2 |
JavaScript
|
erikbrodch/beerlist-mean
|
a506554427d833c139e1acacac9e568aafc7d413
|
0b29078bf8513b06ab7260569d8659e46b6b2fa2
|
refs/heads/master
|
<file_sep>export function fetchMeetupApiDataFromBackend(maxResults, sortBy) {
['Best Match', 'Most Attendees', 'Least Attendees', 'Earliest Date', 'Latest Date']
if (sortBy === "Most Attendees") {
sortBy = { method: "members", type: false }
} else if (sortBy === "Least Attendees") {
sortBy = { method: "members", type: true }
} else if (sortBy === "Earliest Date") {
sortBy = { method: "time", type: false }
} else if (sortBy === "Latest Date") {
sortBy = { method: "time", type: true }
} else if (sortBy === "Best Match") {
sortBy = { method: "BestMatch", type: null }
}
return function (dispatch) {
fetch('/eventsApi/events', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'same-origin',
body: JSON.stringify({
maxResults,
sortBy,
}),
})
.then(res => res.json())
.then((responseJson) => {
if (!responseJson) {
dispatch({ type: "FETCH_EVENTS_DATA_FROM_MEETUP_API_REJECTED", payload: null });
} else {
let data = fixMeetupApiData(responseJson)
dispatch({
type: "FETCH_EVENTS_DATA_FROM_MEETUP_API_FULFILLED",
payload: {
eventsDataFromMeetupAPI: responseJson,
},
});
}
})
.catch(err => {
dispatch({ type: "FETCH_EVENTS_DATA_FROM_MEETUP_API_REJECTED", payload: err });
});
};
}
function fixMeetupApiData(arr) {
return arr.forEach(item => {
item.item_id = item.id;
item.address_1 = item.venue.address_1;
item.address_2 = item.venue.address_2;
item.city = item.venue.city;
item.country = item.venue.country.toUpperCase();
})
}
export function fetchRsvpDataFromBackend(id) {
return function (dispatch) {
fetch('/eventsApi/rsvp', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'same-origin',
body: JSON.stringify({
id,
}),
})
.then(res => res.json())
.then((responseJson) => {
if (!responseJson) {
dispatch({ type: "FETCH_RSVP_DATA_FROM_MEETUP_API_REJECTED", payload: null });
} else {
dispatch({
type: "FETCH_RSVP_DATA_FROM_MEETUP_API_FULFILLED",
payload: {
itemInfoForModal: responseJson,
},
});
}
})
.catch(err => {
dispatch({ type: "FETCH_RSVP_DATA_FROM_MEETUP_API_REJECTED", payload: err });
});
};
}
export function transferDataFromLocalStorageToDB(userId) {
return function (dispatch) {
let favLocalStorageItems = JSON.parse(localStorage.getItem("savedItemsObj"));
for (let key in favLocalStorageItems) {
dispatch(addFavItemToDB(favLocalStorageItems[key], userId));
}
localStorage.setItem("savedItemsObj", null);
};
}
export function fetchFavDataFromDatabase(userId) {
return function (dispatch) {
fetch('/fav/show', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'same-origin',
body: JSON.stringify({
user_id: userId,
}),
})
.then((response) => {
return response.json();
})
.then((responseJson) => {
dispatch({ type: "FETCH_FAV_DATA_FROM_DATABASE_FULFILLED", payload: responseJson.data.data });
})
};
}
export function change_hasFetchedFavDataFromDB(data) {
return function (dispatch) {
dispatch({ type: "CHANGE_hasFetchedFavDataFromDB", payload: data });
};
}
export function addFavItemToDB(item, userId) {
return function (dispatch) {
fetch('/fav/create', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'same-origin',
body: JSON.stringify({
item_id: item.id,
user_id: userId,
name: item.name,
local_date: item.local_date,
address_1: item.address_1,
address_2: item.address_2,
city: item.city,
country: item.country,
yes_rsvp_count: item.yes_rsvp_count,
link: item.link,
description: item.description,
}),
})
.then(res => res.json())
.then((responseJson) => {
dispatch({ type: "ADD_FAV_ITEM_TO_DB_FULFILLED", payload: responseJson.data.data });
})
};
}
export function deleteFavItemFromDB(item_id, userId) {
return function (dispatch) {
fetch('/fav/destroy', {
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
credentials: 'same-origin',
body: JSON.stringify({
item_id: item_id,
user_id: userId,
}),
})
.then(res => res.json())
.then((responseJson) => {
dispatch({ type: "DELETE_FAV_ITEM_FROM_DB_FULFILLED", payload: item_id });
})
};
}
export function areTwoArrSame(arrOne, arrTwo) {
return function () {
if (arrOne.length !== arrTwo.length) {
return false;
}
for (let i = 0; i < arrOne.length; i++) {
if (JSON.stringify(arrOne[i]) !== JSON.stringify(arrTwo[i]))
return false;
}
return true;
};
}
export function changeUrlToUserInput(searchBoxValue, sortBy, maxResults, history) {
return function (dispatch) {
history.push(`/Search=${searchBoxValue}&sortBy=${sortBy}&maxResults=${maxResults}`);
};
}
export function changeUserInputSortBy(value) {
return function (dispatch) {
dispatch({ type: "CHANGE_USERINPUT_SortBy", payload: value });
};
}
export function changeUserInputSearchBoxValue(value) {
return function (dispatch) {
dispatch({ type: "CHANGE_USERINPUT_SearchBoxValue", payload: value });
};
}
export function changeUserInputMaxResults(value) {
return function (dispatch) {
dispatch({ type: "CHANGE_USERINPUT_MaxResults", payload: value });
};
}
export function changeUserInfoId(value) {
return function (dispatch) {
dispatch({ type: "CHANGE_USERINFO_ID", payload: value });
};
}
export function changeUserInfoUsername(value) {
return function (dispatch) {
dispatch({ type: "CHANGE_USERINFO_USERNAME", payload: value });
};
}
export function changeUserInfoEmail(value) {
return function (dispatch) {
dispatch({ type: "CHANGE_USERINFO_EMAIL", payload: value });
};
}
export function playAuthFailedAnimation(ele, animation) {
return function () {
ele.classList.add(animation);
setTimeout(() => {
ele.classList.remove(animation);
}, 1000);
};
}
export function changeShouldFetch(value) {
return function (dispatch) {
dispatch({ type: "CHANGE_ShouldFetch", payload: value });
};
}
export function changeComingFromInput(value) {
return function (dispatch) {
dispatch({ type: "CHANGE_ComingFromInput", payload: value });
};
}
export function updateMenu() {
return function (dispatch) {
dispatch({ type: "UPDATE_MENU", payload: null });
};
}
export function updateResults() {
return function (dispatch) {
dispatch({ type: "UPDATE_RESULTS", payload: null });
};
}
export function emptyFavDataFromDB() {
return function (dispatch) {
dispatch({ type: "EMPTY_FAV_DATA_FROM_DB", payload: null });
};
}
export function updateSideBarState(value) {
return function (dispatch) {
dispatch({ type: "UPDATE_SIDEBAR_STATE", payload: value });
};
}
export function updateItemInfoModal(itemInfoForModal, showItemInfoModal) {
return function (dispatch) {
dispatch({
type: "ZOOM_IMAGE",
payload: {
itemInfoForModal,
showItemInfoModal,
},
});
};
}
export function updateRsvpState(showRSVP) {
return function (dispatch) {
dispatch({
type: "UPDATE_RSVP_STATE",
payload: {
showRSVP,
},
});
};
}
export function udpateShownEventsLength(shownEventsLength) {
return function (dispatch) {
dispatch({
type: "UPDATE_SHOWN_EVENTS_LENGTH",
payload: {
shownEventsLength,
},
});
};
}
<file_sep>const db = require("../db/config");
const favoriteModel = {};
favoriteModel.findAll = () => {
return db.query(`SELECT * FROM userdata ORDER BY id ASC`);
};
favoriteModel.findFavByUserId = item => {
return db.query(`SELECT *, events.item_id AS id
FROM (events
INNER JOIN favorites ON events.item_id = favorites.events_ref_item_id)
WHERE
favorites.user_ref_id = $1
`, [item.user_id]);
};
favoriteModel.create = item => {
return db.one(
`
INSERT INTO events (item_id, name, yes_rsvp_count, local_date, address_1, address_2, city, country, description, link)
SELECT * FROM (SELECT $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) AS tmp
WHERE NOT EXISTS (
SELECT item_id FROM events WHERE item_id = $2
);
INSERT INTO favorites (events_ref_item_id, user_ref_id)
SELECT * FROM (SELECT $2, $1) AS tmp
WHERE NOT EXISTS (
SELECT * FROM favorites WHERE events_ref_item_id = $2 AND user_ref_id = $1
);
SELECT * FROM events WHERE item_id = $2;
`,
[
item.user_id,
item.item_id,
item.name,
item.yes_rsvp_count,
item.local_date,
item.address_1,
item.address_2,
item.city,
item.country,
item.description,
item.link
]
);
};
favoriteModel.destroy = data => {
return db.none(
`
DELETE FROM favorites
WHERE events_ref_item_id = $1 AND user_ref_id = $2;
DELETE FROM events
WHERE item_id NOT IN (SELECT favorites.events_ref_item_id
FROM favorites);
`,
[data.item_id, data.userId]
);
};
module.exports = favoriteModel;
<file_sep>const express = require('express');
const eventsHelpers = require('../services/events/eventsHelpers');
const events = express.Router();
events.post('/events', eventsHelpers.fetchEventsFromMeetup, (req, res) => {
res.json(res.locals.eventsDataFromMeetupAPI);
});
events.post('/rsvp', eventsHelpers.fetchEventRsvpFromMeetup, (req, res) => {
res.json(res.locals.rsvpDataFromMeetupAPI);
});
module.exports = events;<file_sep>import React, { Component } from "react";
import { connect } from "react-redux";
import {
updateMenu,
updateResults,
areTwoArrSame,
updateItemInfoModal,
addFavItemToDB,
deleteFavItemFromDB,
updateRsvpState,
fetchRsvpDataFromBackend,
udpateShownEventsLength
} from ".././actions/eventsAppActions";
import FlipMove from 'react-flip-move';
class Results extends Component {
shouldComponentUpdate(newProps, newState) {
if (
this.props.eventsAppStore.fetched !== newProps.eventsAppStore.fetched ||
this.props.eventsAppStore.updateResults !== newProps.eventsAppStore.updateResults ||
this.props.eventsAppStore.userInput.searchBoxValue !== newProps.eventsAppStore.userInput.searchBoxValue ||
JSON.stringify(this.props.eventsAppStore.favDataFromDB) !== JSON.stringify(newProps.eventsAppStore.favDataFromDB) ||
!this.props.dispatch(areTwoArrSame(this.props.eventsAppStore.eventsDataFromMeetupAPI, newProps.eventsAppStore.eventsDataFromMeetupAPI))
) {
return true;
} else {
return false;
}
}
filterSearchInput = arr => {
let newArr = [...arr];
let searchBoxValue = this.props.eventsAppStore.userInput.searchBoxValue;
if (searchBoxValue !== null && searchBoxValue.trim() !== "") {
newArr = newArr.filter(e => e.name.toLowerCase().includes(searchBoxValue.toLowerCase()));
}
this.props.dispatch(udpateShownEventsLength(newArr.length));
return newArr;
}
handleFavButton = item => {
if (this.props.eventsAppStore.userInfo.id === null) {
let savedItemsObj = JSON.parse(localStorage.getItem("savedItemsObj")) || {};
if (savedItemsObj[item.item_id] === undefined) {
savedItemsObj[item.item_id] = item;
} else if (savedItemsObj[item.item_id] !== undefined) {
delete savedItemsObj[item.item_id];
}
localStorage.setItem("savedItemsObj", JSON.stringify(savedItemsObj));
// this.forceUpdate();
this.props.dispatch(updateMenu());
this.props.dispatch(updateResults());
} else {
if (this.props.eventsAppStore.favDataFromDB[item.item_id] === undefined) {
this.props.dispatch(addFavItemToDB(item, this.props.eventsAppStore.userInfo.id));
} else {
this.props.dispatch(deleteFavItemFromDB(item.item_id, this.props.eventsAppStore.userInfo.id));
}
}
};
handleMoreDetailsBttn = (item) => {
this.props.dispatch(updateItemInfoModal(item, true));
}
handleRsvpBttn = (id) => {
this.props.dispatch(updateRsvpState(true));
this.props.dispatch(updateItemInfoModal(null, true));
this.props.dispatch(fetchRsvpDataFromBackend(id));
}
renderList = () => {
let savedItemsObj = (this.props.eventsAppStore.hasFetchedFavDataFromDB && this.props.eventsAppStore.favDataFromDB) || (JSON.parse(localStorage.getItem("savedItemsObj"))) || {};
let monthArr = ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEV"];
let eventsData = this.filterSearchInput(this.props.eventsAppStore.eventsDataFromMeetupAPI);
if (eventsData.length > 0) {
return eventsData.map((item, index) => {
let date = item.local_date.split('-');
let headingDate = `${date[2]} ${monthArr[date[1] - 1]}`;
return (
<li key={item.item_id} className="list">
<div className="image-container">
<h3 className="heading-date">{headingDate}</h3>
</div>
<div className="content-container">
<h4 className="name">{item.name}</h4>
<p ><span>Attendees: </span>{item.yes_rsvp_count}</p>
<p ><span>Date: </span>{`${date[1]}/${date[2]}/${date[0]}`}</p>
<p>
<span>Address:</span>
<div>{item.address_1} {item.address_2}</div>
<div>{item.city}, {item.country}</div>
</p>
<button className="bttn more-details-bttn" onClick={() => this.handleMoreDetailsBttn(item)}>More Details</button>
<button className="bttn more-details-bttn" onClick={() => this.handleRsvpBttn(item.item_id)}>View RSVP</button>
<button className="bttn more-details-bttn" onClick={() => window.open(item.link)}>View Meetup</button>
<div className={"fav-star " + ((savedItemsObj[item.item_id]) ? "fav-star-filled" : "")} onClick={() => this.handleFavButton(item)}></div>
</div>
</li>
);
});
} else {
return <h1>Nothing was found</h1>
}
};
renderLoading = () => {
return <h1 className="loading">Loading</h1>
}
render() {
return (
<div className="results">
{(!this.props.eventsAppStore.fetched) ? this.renderLoading() : (
<ul>
<FlipMove className="flip-move" >
{this.renderList()}
</FlipMove>
</ul>)}
</div>
);
}
}
function mapStateToProps({ eventsAppStore }) {
return { eventsAppStore };
}
export default connect(mapStateToProps)(Results);
<file_sep>import { combineReducers } from "redux";
import eventsAppStore from "./eventsAppReducer";
export default combineReducers({
eventsAppStore,
});
<file_sep>import React, { Component } from "react";
import { connect } from "react-redux";
import { Link } from 'react-router-dom'
import { withRouter } from "react-router-dom";
import Dropdown from 'react-dropdown'
import {
changeUserInputSortBy,
changeUrlToUserInput,
changeShouldFetch,
changeComingFromInput,
fetchMeetupApiDataFromBackend,
} from "../actions/eventsAppActions";
class SortBy extends Component {
shouldComponentUpdate(newProps, newState) {
let oldData = this.props.eventsAppStore;
let newData = newProps.eventsAppStore;
if (
oldData.userInput.sortBy !== newData.userInput.sortBy
) {
return true;
} else {
return false;
}
}
handleSortByChange = (e) => {
this.props.dispatch(changeUserInputSortBy(e.value))
this.props.dispatch(changeUrlToUserInput(this.props.eventsAppStore.userInput.searchBoxValue, e.value, this.props.eventsAppStore.userInput.maxResults, this.props.history))
this.submitForm(e.value);
}
submitForm = (value) => {
this.props.dispatch(changeShouldFetch(true));
this.props.dispatch(changeComingFromInput(true));
this.props.dispatch(fetchMeetupApiDataFromBackend(this.props.eventsAppStore.userInput.maxResults, value));
};
render() {
return (
<div className="sortby">
<Dropdown
name="sortBy"
options={['Best Match', 'Least Attendees', 'Most Attendees', 'Earliest Date', 'Latest Date']}
onChange={this.handleSortByChange}
value={this.props.eventsAppStore.userInput.sortBy}
placeholder="Select an option"
ref="sortBy"
/>
</div>
);
}
}
function mapStateToProps({ eventsAppStore }) {
return { eventsAppStore };
}
export default withRouter(connect(mapStateToProps)(SortBy));
<file_sep>import React, { Component } from "react";
import { connect } from "react-redux";
import { updateItemInfoModal, updateMenu, updateResults, updateSideBarState, deleteFavItemFromDB, updateRsvpState } from ".././actions/eventsAppActions";
import zoomBttnImg from ".././images/zoomBttnImg.png";
import delBttnImg from ".././images/delBttnImg.png";
import { scaleRotate as Menu } from "react-burger-menu";
class BurgerMenu extends Component {
shouldComponentUpdate(newProps, newState) {
return ((this.props.eventsAppStore.updateMenu !== newProps.eventsAppStore.updateMenu) || (JSON.stringify(this.props.eventsAppStore.favDataFromDB) !== JSON.stringify(newProps.eventsAppStore.favDataFromDB)));
}
deleteItem = id => {
if (this.props.eventsAppStore.userInfo.id === null) {
let savedItemsObj = JSON.parse(localStorage.getItem("savedItemsObj"));
delete savedItemsObj[id];
localStorage.setItem("savedItemsObj", JSON.stringify(savedItemsObj));
this.props.dispatch(updateMenu());
this.props.dispatch(updateResults());
} else {
this.props.dispatch(deleteFavItemFromDB(id, this.props.eventsAppStore.userInfo.id));
}
};
openItem = item => {
(this.props.eventsAppStore.showRSVP) && (this.props.dispatch(updateRsvpState(false)));
this.props.dispatch(updateItemInfoModal(item, true));
};
handleMenuStateChange = e => {
this.props.dispatch(updateSideBarState(e.isOpen));
}
renderList = () => {
let savedItemsObj = (this.props.eventsAppStore.hasFetchedFavDataFromDB && this.props.eventsAppStore.favDataFromDB) || (JSON.parse(localStorage.getItem("savedItemsObj")));
if (savedItemsObj !== null) {
let monthArr = ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEV"];
let listArr = [];
for (let key in savedItemsObj) {
let date = savedItemsObj[key].local_date.split('-');
let headingDate = `${date[2]} ${monthArr[date[1] - 1]}`;
listArr.push(
<li key={savedItemsObj[key].item_id}>
<div className="img-container">
<h3 className="heading-date">{headingDate}</h3>
</div>
<h4 className="name">{savedItemsObj[key].name}</h4>
<div className="options">
<img
onClick={e => this.openItem(savedItemsObj[key])}
className="open-img-bttn"
src={zoomBttnImg}
alt="Zoom Button"
/>
<img
onClick={e => this.deleteItem(savedItemsObj[key].item_id)}
className="delete-img-bttn"
src={delBttnImg}
alt="Delete Button"
/>
</div>
</li>
)
}
return listArr;
}
};
render() {
return (
<Menu
onStateChange={this.handleMenuStateChange}
className="sidebar"
width={"15%"}
pageWrapId={"page-wrap"}
outerContainerId={"outer-container"}
>
<ul>{this.renderList()}</ul>
</Menu>
);
}
}
function mapStateToProps({ eventsAppStore }) {
return { eventsAppStore };
}
export default connect(mapStateToProps)(BurgerMenu);
<file_sep>require('isomorphic-fetch');
require('dotenv').config();
function fetchEventsFromMeetup(req, res, next) {
let URL = `https://api.meetup.com/`;
URL += `reactjs-dallas`;
URL += `/events?&sign=true&photo-host=public`;
URL += `&page=${req.body.maxResults}`;
(req.body.sortBy.method !== "BestMatch") && (URL += `&order=${req.body.sortBy.method}&desc=${req.body.sortBy.type}`);
fetch(URL, {
method: 'GET'
}).then((fetchRes) => {
return fetchRes.json();
}).then((jsonFetchRes) => {
if (jsonFetchRes.errors) {
res.locals.eventsDataFromMeetupAPI = null;
} else {
res.locals.eventsDataFromMeetupAPI = jsonFetchRes;
}
next();
}).catch((err) => {
res.locals.eventsDataFromMeetupAPI = null;
next();
});
}
function fetchEventRsvpFromMeetup(req, res, next) {
let URL = `https://api.meetup.com/reactjs-dallas/events/${req.body.id}/rsvps`;
fetch(URL, {
method: 'GET'
}).then((fetchRes) => {
return fetchRes.json();
}).then((jsonFetchRes) => {
if (jsonFetchRes.errors) {
res.locals.rsvpDataFromMeetupAPI = null;
} else {
res.locals.rsvpDataFromMeetupAPI = jsonFetchRes;
}
next();
}).catch((err) => {
res.locals.rsvpDataFromMeetupAPI = null;
next();
});
}
module.exports = {
fetchEventsFromMeetup,
fetchEventRsvpFromMeetup
};<file_sep>-- \connect reactjs_dallas_events;
DROP TABLE favorites;
DROP TABLE users;
DROP TABLE events;
CREATE TABLE users (
id BIGSERIAL PRIMARY KEY,
username VARCHAR(255) UNIQUE NOT NULL,
email VARCHAR(255),
password TEXT UNIQUE NOT NULL
);
CREATE TABLE events (
id BIGSERIAL PRIMARY KEY,
item_id VARCHAR(255) UNIQUE NOT NULL,
name VARCHAR(1024),
yes_rsvp_count INTEGER,
local_date VARCHAR(300),
address_1 VARCHAR(255),
address_2 VARCHAR(255),
city VARCHAR(255),
country VARCHAR(255),
description TEXT,
link VARCHAR(1024)
);
CREATE TABLE favorites (
id BIGSERIAL PRIMARY KEY,
events_ref_item_id VARCHAR(255) REFERENCES events(item_id),
user_ref_id INTEGER REFERENCES users(id)
);
|
c954b98c5ce0faf9dcf8a2d08cb1565fefce84e2
|
[
"JavaScript",
"SQL"
] | 9 |
JavaScript
|
musmanrao1994/reactjs-dallas-events-app
|
8ed292b40039361022e718beb89b504a68b28407
|
08783c0c5c25c56982e5d76673e67d672a503a43
|
refs/heads/master
|
<repo_name>davidiamyou/redux-react-beginner<file_sep>/src/actions/index.js
export const selectBook = (book) => {
// selectBook is an Action Creator, it needs to return an Action with a type and payload
return {
type: 'BOOK_SELECTED',
payload: book
}
}<file_sep>/README.md
# redux-react-beginner
Learning project for redux.
## To Run
```
npm install
npm start
```
|
95bbb5b894e97b020fe1be36a48a01b65563a266
|
[
"JavaScript",
"Markdown"
] | 2 |
JavaScript
|
davidiamyou/redux-react-beginner
|
e507e2228077e9719d2fe82592e958acb63d3c37
|
92fa1ef96715302ef26dacb1daf6820fe020588f
|
refs/heads/master
|
<file_sep>function createNode(element) {
return document.createElement(element);
}
function append(parent, el) {
return parent.appendChild(el);
}
const ul = document.getElementById('people');
fetch('https://jsonplaceholder.typicode.com/users')
.then(response => response.json())
.then(data => {
let people = data;
return people.map(function (person) {
let li = createNode('li')
span = createNode('span');
li.innerHTML = person.name;
span.innerHTML = person.email;
append(li, span);
append(ul, li);
});
}).catch(e => {
console.log(e);
var img = document.createElement("img");
img.src = "./images/download.png";
img.width="300";
img.height="150";
append(ul,img);
})
|
f577362c694390a8ed405aa787dc89e3b92fe4da
|
[
"JavaScript"
] | 1 |
JavaScript
|
nakulrathore97/build
|
5fa25ce903aab99e6e4bd775a7203747d9200ddd
|
841eaa12337af225e928ee06dec89019ea325f99
|
refs/heads/master
|
<repo_name>SAC-CS112-Radke-Darrin/Midterm<file_sep>/src/DiceGame.java
import javax.swing.JOptionPane;
public class DiceGame {
public static void main(String[] args) {
// TODO Auto-generated method stub
int answer = 1 + (int)(Math.random()*7);
int guess;
int count = 0;
int wins = 0;
int losses = 0;
guess = Integer.parseInt(JOptionPane.showInputDialog("Guess if an even or odd number will be rolled. even/odd"));
switch(answer)
{case "even":
break;}
{case "odd":
break;
}
if(guess == (1)||guess == (3)||guess == (5))
JOptionPane.showMessageDialog(null, "You guessed correctly!");
else
JOptionPane.showMessageDialog(null, "Wrong answer.");
do{
JOptionPane.showInputDialog("Play again? Y/N");
boolean play = true;
String repeat;
if(repeat == ("Y")||repeat == ("y"))
{play = true;}
else
{play = false;}
}while(play = true);
}
}
|
fc21a1434d8da54df52b9193b0d1789239fcc759
|
[
"Java"
] | 1 |
Java
|
SAC-CS112-Radke-Darrin/Midterm
|
2d230bbf4ea31aceb55f1b380a1aef3c1cd85a6d
|
9ebc292c79acb275428648993c42bf72fd2e052a
|
refs/heads/master
|
<file_sep>import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
data = pd.read_csv('age.csv')
ljl = data['22']
plt.plot(ljl, '.')
plt.ylim((1,200))
plt.xlabel('X')
plt.ylabel('Y')
plt.show()
|
998579c383ccf0352106af80bf8aa523ff6bb1e7
|
[
"Python"
] | 1 |
Python
|
ljl1231/ljl1231
|
458180435b27930d21555b0d889b552775fc34b1
|
90d3ca4c3ca518318acd4dd9280c0cf6068a731f
|
refs/heads/master
|
<file_sep># Article-Generation
Article Generation using LSTM
<file_sep>
# load the network weights
filename = "weights-improvement-13-2.1469.hdf5"
model.load_weights(filename)
model.compile(loss='categorical_crossentropy', optimizer='adam')
int_to_char = dict((i, c) for i, c in enumerate(chars))
import sys
# pick a random seed
start = numpy.random.randint(0, len(dataX)-1)
pattern = dataX[start]
print ("Seed:")
print( "\"", ''.join([int_to_char[value] for value in pattern]), "\"")
# generate characters
for i in range(1000):
x = numpy.reshape(pattern, (1, len(pattern), 1))
x = x / float(n_vocab)
prediction = model.predict(x, verbose=0)
index = numpy.argmax(prediction)
result = int_to_char[index]
seq_in = [int_to_char[value] for value in pattern]
sys.stdout.write(result)
pattern.append(index)
pattern = pattern[1:len(pattern)]
print ("\nDone.")
|
464366567fad9737d36aef74261d3c849323b89e
|
[
"Markdown",
"Python"
] | 2 |
Markdown
|
Srikanth-Rubique/Article-Generation
|
bf3185639b0ca6942b17ad11055dfd86ec9d3cd0
|
f0ef929e899c3f9236970bba53f3e1d9d7c58a4d
|
refs/heads/main
|
<repo_name>ac1d3/stepik_selenium_module_four<file_sep>/pages/locators.py
from selenium.webdriver.common.by import By
class BasePageLocators:
LOGIN_LINK = (By.CSS_SELECTOR, "#login_link")
LOGIN_LINK_INVALID = (By.CSS_SELECTOR, "#login_link_inc")
class MainPageLocators:
LOGIN_LINK = (By.CSS_SELECTOR, "#login_link")
class LoginPageLocators:
LOGIN_FORM = (By.CSS_SELECTOR, "#login_form")
REGISTER_FORM = (By.CSS_SELECTOR, "#register_form")
class ProductPageLocators:
ADD_TO_CART_BUTTON = (By.CSS_SELECTOR, "button.btn-add-to-basket")
MAIN_PRICE = (By.CSS_SELECTOR, "div.product_main > p.price_color")
MAIN_BOOK_NAME = (By.CSS_SELECTOR, "div.product_main > h1")
PRICE_MSG = (By.CSS_SELECTOR, ".alert-info strong")
BOOK_NAME_MSG = (By.CSS_SELECTOR, ".alert-success strong")
SUCCESS_MSG = (By.CSS_SELECTOR, ".alert-success")
<file_sep>/test_product_page.py
from .pages.product_page import ProductPage
import pytest
def test_guest_should_see_login_link_on_product_page(browser):
link = "http://selenium1py.pythonanywhere.com/en-gb/catalogue/the-city-and-the-stars_95/"
page = ProductPage(browser, link)
page.open()
page.should_be_login_link()
def test_guest_can_go_to_login_page_from_product_page(browser):
link = "http://selenium1py.pythonanywhere.com/en-gb/catalogue/the-city-and-the-stars_95/"
page = ProductPage(browser, link)
page.open()
page.go_to_login_page()
def test_guest_can_add_product_to_basket(browser):
link = "http://selenium1py.pythonanywhere.com/catalogue/coders-at-work_207/?promo=newYear2019"
page = ProductPage(browser, link)
page.open()
page.guest_can_add_product_to_basket()
page.solve_quiz_and_get_code()
page.prices_should_be_equal()
page.book_names_should_be_equal()
@pytest.mark.xfail
def test_guest_cant_see_success_message_after_adding_product_to_basket(browser):
link = "http://selenium1py.pythonanywhere.com/catalogue/coders-at-work_207/?promo=newYear2019"
page = ProductPage(browser, link)
page.open()
page.guest_can_add_product_to_basket()
page.solve_quiz_and_get_code()
page.guest_cant_see_success_message()
def test_guest_cant_see_success_message(browser):
link = "http://selenium1py.pythonanywhere.com/catalogue/coders-at-work_207/?promo=newYear2019"
page = ProductPage(browser, link)
page.open()
page.guest_cant_see_success_message()
@pytest.mark.xfail
def test_message_disappeared_after_adding_product_to_basket(browser):
link = "http://selenium1py.pythonanywhere.com/catalogue/coders-at-work_207/?promo=newYear2019"
page = ProductPage(browser, link)
page.open()
page.guest_can_add_product_to_basket()
page.solve_quiz_and_get_code()
page.success_message_should_be_disappeared()
<file_sep>/pages/product_page.py
from .base_page import BasePage
from .locators import ProductPageLocators
class ProductPage(BasePage):
def guest_can_add_product_to_basket(self):
add_to_cart_button = self.browser.find_element(*ProductPageLocators.ADD_TO_CART_BUTTON)
add_to_cart_button.click()
def prices_should_be_equal(self):
book_price = self.browser.find_element(*ProductPageLocators.MAIN_PRICE).text
basket_total_msg = self.browser.find_element(*ProductPageLocators.PRICE_MSG).text
assert book_price == basket_total_msg
def book_names_should_be_equal(self):
book_name = self.browser.find_element(*ProductPageLocators.MAIN_BOOK_NAME).text
book_name_msg = self.browser.find_element(*ProductPageLocators.BOOK_NAME_MSG).text
assert book_name == book_name_msg
def guest_cant_see_success_message(self):
assert self.is_not_element_present(*ProductPageLocators.SUCCESS_MSG)
def success_message_should_be_disappeared(self):
assert self.is_disappeared(*ProductPageLocators.SUCCESS_MSG)
<file_sep>/conftest.py
import pytest
from selenium import webdriver
def pytest_addoption(parser):
parser.addoption('--browser_name', action='store', default="chrome",
help="Choose browser: chrome or firefox")
parser.addoption('--language', action='store', default="en",
help="Choose website language")
@pytest.fixture(scope="function")
def browser(request):
browser_name = request.config.getoption("browser_name")
if browser_name == "chrome":
print("\nstart chrome browser for test..")
browser = webdriver.Chrome()
elif browser_name == "firefox":
print("\nstart firefox browser for test..")
browser = webdriver.Firefox()
else:
raise pytest.UsageError("--browser_name should be chrome or firefox")
yield browser
print("\nquit browser..")
browser.quit()
@pytest.fixture(scope="function")
def language(request):
valid_language_codes = ["ar", "ca", "cs", "da", "de", "en-gb", "el", "es", "fi", "fr", "it", "ko", "nl", "pl", "pt",
"pt-br", "ro", "ru", "sk", "uk", "zh-cn"]
language_option = request.config.getoption("language")
if language_option in valid_language_codes:
print(f"\nstart test with {language_option} language..")
language = language_option
else:
raise pytest.UsageError("please, enter valid language code for --language option, e.g. 'de' - Deutsch")
yield language
|
6c5587f2272b385191b6c9d0cfb3b9246ff92665
|
[
"Python"
] | 4 |
Python
|
ac1d3/stepik_selenium_module_four
|
d0ede9ab47fd0ae689761429966ab39e07a5f4a9
|
289b9757b00cfe57f498ebda02ba5cf499bb521d
|
refs/heads/master
|
<file_sep>import java.util.*;
import java.io.*;
/*
<NAME>
N01383793
COP3530
<NAME>
Project 6
Linear and Quadratic HashTable
*/
public class n01383793
{
public static void main( String[] args ) throws FileNotFoundException
{
File file1 = new File(args[0]);
File file2 = new File(args[1]);
File file3 = new File(args[2]);
Scanner inputOne = new Scanner( file1 ); // reads file name from console
Scanner inputTwo = new Scanner( file2 );
Scanner inputThree = new Scanner( file3 );
// holds the data that will be hashed
ArrayList<String> hashedContent = new ArrayList<String>();
int value = 0; // ??
while( inputOne.hasNext() )
{
String dataString = inputOne.next(); // gets line
//if(dataString.length() != 0) // if not a blank line
hashedContent.add(dataString);
}
LinearProbe LHashTable = new LinearProbe( primeNumLargerThan( 2 * hashedContent.size() ) ); // creates hashtable 3 times the number of elements
QuaHashTable QHashTable= new QuaHashTable( primeNumLargerThan( 2 * hashedContent.size() ) );
// Inputting string into hash table
for( int index = 0; index < hashedContent.size(); index++)
{
//System.out.println("Inserting: " + tempList.get(index) );
LHashTable.insert( hashedContent.get(index) );
QHashTable.insert( hashedContent.get(index));
}
System.out.println("Linear Probing Hash Table: ");
LHashTable.displayTable();
System.out.println("\nQuadratic Probing Hash Table: ");
QHashTable.displayTable();
ArrayList<String> searchStrings = new ArrayList<String>(); // strings that are used to search HashTables
while( inputTwo.hasNextLine() )
{
String searchKey = inputTwo.nextLine();
if(searchKey.length() != 0)
{
searchStrings.add(searchKey);
}
}
ArrayList<String> deleteStrings = new ArrayList<String>(); // strings to be deleted in hashtable
while( inputThree.hasNextLine() )
{
String searchKey = inputThree.nextLine();
if(searchKey.length() != 0)// if not a blank line
{
deleteStrings.add( searchKey );
}
}
System.out.println("\nSearched Keys using Linear Probing: ");
LHashTable.searchList( searchStrings );// display info on searched Strings
System.out.println("\nDeleted Keys using Linear Probing: ");
LHashTable.deleteList( deleteStrings ); // display info on deleted Strings
System.out.println(""); // prints newline
System.out.println("\nSearched Key using Quadratic Probing: ");
QHashTable.searchList( searchStrings );
System.out.println("\nDeleted Keys using Quadratic Probing: ");
QHashTable.deleteList( deleteStrings );
System.out.println(""); // prints newline
//LHashTable.displayTable();
//QHashTable.displayTable(); // prints after strings have been deleted
}
public static int primeNumLargerThan(int n)
{
for(int i = n + 1; true; i++)
if(isPrime(i))
return i;
}
public static boolean isPrime(int n)
{
for(int j = 2; ( j*j <= n ); j++)
if(n % j == 0)
return false;
return true;
}
}
class Data
{
private String m_key;
private int m_probLength;
private int m_index;
/*
Used for when finding or trying to delete a Node
*/
Data( int probLength )
{
m_probLength = probLength;
m_key = null;
}
Data( int index, String key, int probLength)
{
m_key = key;
m_probLength = probLength;
m_index = index;
}
public String toString()
{
return new String(m_index + " " + m_key + " " + m_probLength);
}
public String getKey(){ return m_key; }
public int getLocation() { return m_index; }
public int getProbLen() { return m_probLength; }
}
abstract class HashTable
{
protected Data[] hashArray;
protected int m_size;
protected Data nonItem; // for deleted items
private int totalSuccess = 0; // total number of successful finds
private int totalSucProbLen = 0; // total accumulated prob length of successful finds
private int averageSuccess = 0;
private int totalFail = 0; // total number of failed finds
private int totalFailProbLen = 0; // total accumulated prob length of failed finds
private int averageFail = 0;
HashTable(int size)
{
m_size = size;
hashArray = new Data[m_size];
//nonItem = new Data( -1, null, 0);
for( int index = 0; index < m_size; index++ )
{
hashArray[index] = null;
}
}
public int hashFunc(String key)
{
int location = 0;
for(int index = 0; index < key.length(); index++)
{
int letter = key.charAt(index) - 96; // gets character code
// 26 for number of characters
location = (location * 26 + letter) % m_size;
}
return location;
}
public void displayTable()
{
System.out.println("Index String Probe Length for Insertion");
for(int index = 0; index < m_size; index++)
{
if( hashArray[index] != null && hashArray[index].getKey() != null)
{
int loc = hashArray[index].getLocation();
String key = hashArray[index].getKey();
int pLen = hashArray[index].getProbLen();
System.out.println( String.format( "%-7d %-40s %d ", loc, key, pLen));
}
}
}
// Used to get the stats of the average success
public void searchList(ArrayList<String> list)
{
System.out.printf("%-40s Success Failure Probe length for success Probe length for failure\n", "String");
int probLen = 0;
for(int index = 0; index < list.size(); index++ )
{
String searchKey = list.get( index );
Data key = find( searchKey );
if( key.getKey() != null)
{
probLen = key.getProbLen();
totalSuccess++; // total Number of succesfully found keys
totalSucProbLen += probLen; // total tally of probe lengths.. used to get the average of successfully found keys
System.out.printf("%-40s yes %d \n", searchKey, probLen);
// System.out.println("SUCCESS: " + searchKey + " Prob length: " + probLen);
// System.out.println(searchKey + " yes " + probLen);
}
else
{
probLen = key.getProbLen();
totalFail++;
totalFailProbLen += probLen;
System.out.printf("%-40s yes %d \n", searchKey, probLen);
// System.out.println("FAIl: " + searchKey + "Prob length: " + probLen);
}
}
printStats();
clear();
}
/*
First uses the searchlist to get the Probe length averages
Then deleted the key from the hashtable
*/
public void deleteList(ArrayList<String> list)
{
searchList( list );
for( int index = 0; index < list.size(); index++ )
delete(list.get(index)); // deletes key from hashtable
}
public void clear()
{
totalSuccess = 0; // total number of successful finds
totalSucProbLen = 0; // total accumulated prob length of successful finds
averageSuccess = 0;
totalFail = 0; // total number of failed finds
totalFailProbLen = 0; // total accumulated prob length of failed finds
averageFail = 0;
}
/*
Will have the stats in the HashTable class
*/
public void printStats()
{
//System.out.println("Success: " + totalSucProbLen + " / " + totalSuccess);
//System.out.println("Fail: " + totalFailProbLen + " / " + totalFail);
System.out.println(String.format("\nAverage probe length: %41.2f %22.2f", (double)totalSucProbLen/ totalSuccess, (double)totalFailProbLen / totalFail ));
}
abstract public Data find(String str);
abstract public void insert(String key);
abstract public Data delete(String key);
}
class LinearProbe extends HashTable // linear hash table
{
LinearProbe(int size)
{
super(size);
}
// returns DataLink if key found,
// return null if not found
/*
// checks if there is a node already at hash locations
public boolean collision(int location)
{
return hashArray[location].getFirst() != null;
}
*/
// CHANGE TO INSERT STRING
public void insert(String key)
{
int hashVal = hashFunc(key); // hash the key
int probeLength = 0;
while(hashArray[hashVal] != null ) // until empty cell or -1, .. WHY was there originally hashArray[hashVal].getKey() != -1
{
//System.out.println("Attempting to store: " + key + ": " + hashVal); // debugging
probeLength++;
++hashVal; // go to next cell
hashVal %= m_size; // wraparound if necessary
}
//System.out.println(key + " Stored at location: " + hashVal + " probe length: " + probeLength + "\n" ); // debugging
hashArray[hashVal] = new Data(hashVal, key, probeLength); // insert item
} // end linearInsert()
public Data find(String key)
{
int location = hashFunc( key );
int probLength = 0;
while( hashArray[location] != null )
{
if(hashArray[location].getKey() != null && hashArray[location].getKey().equals( key ))
{
return hashArray[location];
}
++probLength;
++location;
location %= m_size;
}
return new Data( probLength); // will have null string
//System.out.println("ERROR " + key.getKey() + " " + "already exists and location " + location);
// return location of value
// or return location not found
// if end of array is reached, wrap aroud to beginning using %
}
public Data delete(String key)
{
Data item = find( key );
Data nonItem = new Data( -1); // need to make this represent a deleted node
if(item.getKey() != null)
{
Data temp = item;
hashArray[item.getLocation()] = nonItem;
return temp;
}
else
return item; // returns a Data node with null key and the probLength found int the find method
}
}
class QuaHashTable extends HashTable
{
QuaHashTable(int size)
{
super(size);
}
// -------------------------------------------------------------
public void insert(String key)
// (assumes table not full)
{
int hashVal = hashFunc(key); // hash the key
int stepSize = 1;
int probLength = 0;
// until empty cell or -1
while(hashArray[hashVal] != null ) //&& hashArray[hashVal].getKey() != -1)
{
hashVal += stepSize; // add the step
hashVal %= m_size; // for wraparound
++probLength;
stepSize = (int) Math.pow( probLength + 1, 2);// 1 4 9 16 25 ...
}
hashArray[hashVal] = new Data(hashVal, key, probLength); // insert item
} // end insert()
//-------------------------------------------------------------
public Data find(String key)
{
int location = hashFunc( key );
int stepSize = 1; // get step size
int probLength = 0;
while( hashArray[location] != null )
{
//System.out.println("Searching.. " + hashArray[location].toString());
if(hashArray[location].getKey() != null && hashArray[location].getKey().equals( key ))
{
//System.out.println("Found.. " + hashArray[location].toString());
return hashArray[location];
}
++probLength;
location += stepSize;
location %= m_size;
stepSize =(int) Math.pow( probLength + 1, 2); // 1 4 9 16 25 ...
}
return new Data( probLength );
}
//-------------------------------------------------------------
public Data delete(String key )
{
Data item = find( key );
Data nonItem = new Data(-1); // need to make this represent a deleted node
if( item != null )
{
Data temp = item;
hashArray[item.getLocation()] = nonItem;
return temp;
}
else
return item;
}
//-------------------------------------------------------------
}
|
8fca79d572f8569106f69e76f1a952cc196bb9da
|
[
"Java"
] | 1 |
Java
|
Gpridham/COP3530_Assign_6
|
38318f8cb72fe7a9bb97e06fc0ec3d8ee3bf79db
|
01c25c7e52e515220b8f1ea418019aabbc66ab50
|
refs/heads/master
|
<file_sep>var articles = React.createClass({
propTypes: {
title: React.PropTypes.string,
author: React.PropTypes.string,
year: React.PropTypes.string,
coop: React.PropTypes.string,
text: React.PropTypes.string
},
render: function() {
return (
<div>
{this.props.articles.map(function(article, i){
return <p>Title {i+1}: {article.title}</p>
})}
</div>
);
}
});
|
26b12708407c4018ab3c680f6c794ee7b0b4a664
|
[
"JavaScript"
] | 1 |
JavaScript
|
MsSterh/reactest
|
061fda54330311e6176b0e3ecfde8e1975b605f9
|
1a2c018dbc638fd98c4be0223de23c616c0d63d2
|
refs/heads/master
|
<file_sep>require 'httparty'
module DarkskyWeather
module Api
class Client
include HTTParty
base_uri "https://api.darksky.net/forecast/"
def get_weather(lat:, lng:, timestamp: nil, **options)
key = DarkskyWeather::Api.configuration.api_key
request_path = "/#{key}/#{lat},#{lng}"
request_path << ",#{timestamp}" if timestamp
request_path << prepare_options(options) if options.any?
raw_result = self.class.get(request_path)
request_uri = raw_result.request.uri.to_s
return WeatherData.new(timestamp, request_uri, raw_result.parsed_response)
end
private
def prepare_options(hash_options)
'?' + hash_options.map { |k, v| "#{k}=#{v}" }.join('&')
end
end
end
end
<file_sep>### 0.1.2 (2019-09-20)
* Changed module names and paths to make auto-inclusion work properly
|
d72becb2123c80e89b8490d88051f6c7666d9d65
|
[
"Markdown",
"Ruby"
] | 2 |
Ruby
|
f1nwe/DarkSky-gem
|
49155145d9ddda07f3b7a15195c8e8069113e8ae
|
c46db0305d8ba17647c638dfe751b60687b22283
|
refs/heads/main
|
<file_sep>import json
import re
import sys
import bibtexparser
import argparse
from tqdm import tqdm
import os
filepath = os.path.dirname(os.path.abspath(__file__)) + '/'
def normalize_title(title_str):
title_str = re.sub(r'[^a-zA-Z]',r'', title_str)
return title_str.lower().replace(" ", "").strip()
def load_bib_file(bibpath):
all_bib_entries = []
with open(bibpath, encoding='utf8') as f:
bib_entry_buffer = []
lines = f.readlines() + ["\n"]
for ind, line in enumerate(lines):
# line = line.strip()
if "@string" in line:
continue
bib_entry_buffer.append(line)
if line.strip() == "}" or (line.strip().endswith("}") and "{" not in line and ind+1<len(lines) and lines[ind+1]=="\n"):
all_bib_entries.append(bib_entry_buffer)
bib_entry_buffer = []
return all_bib_entries
def build_json(all_bib_entries):
all_bib_dict = {}
num_expections = 0
for bib_entry in tqdm(all_bib_entries[:]):
bib_entry_str = " ".join([line for line in bib_entry if "month" not in line.lower()]).lower()
try:
bib_entry_parsed = bibtexparser.loads(bib_entry_str)
bib_key = normalize_title(bib_entry_parsed.entries[0]["title"])
all_bib_dict[bib_key] = bib_entry
except Exception as e:
print(bib_entry)
print(e)
num_expections += 1
return all_bib_dict
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input_bib", default=filepath+"data/acl.bib",
type=str, help="The input bib file")
parser.add_argument("-o", "--output_json", default=filepath+"data/acl.json",
type=str, help="The output json file")
args = parser.parse_args()
all_bib_entries = load_bib_file(args.input_bib)
all_bib_dict = build_json(all_bib_entries)
with open(args.output_json, "w") as f:
json.dump(all_bib_dict, f, indent=2)
<file_sep>import rebiber
from rebiber.bib2json import normalize_title, load_bib_file
import argparse
import json
import bibtexparser
import os
import re
def construct_bib_db(bib_list_file, start_dir=""):
with open(bib_list_file) as f:
filenames = f.readlines()
bib_db = {}
for filename in filenames:
with open(start_dir+filename.strip()) as f:
db = json.load(f)
print("Loaded:", f.name, "Size:", len(db))
bib_db.update(db)
return bib_db
def is_contain_var(line):
if "month=" in line.lower().replace(" ",""):
return True # special case
line_clean = line.lower().replace(" ","")
if "=" in line_clean:
if '{' in line_clean or '"' in line_clean or "'" in line_clean:
return False
else:
return True
return False
def post_processing(output_bib_entries, removed_value_names, abbr_dict):
bibparser = bibtexparser.bparser.BibTexParser(ignore_nonstandard_types=False)
bib_entry_str = ""
for entry in output_bib_entries:
for line in entry:
if is_contain_var(line):
continue
bib_entry_str += line
bib_entry_str += "\n"
parsed_entries = bibtexparser.loads(bib_entry_str, bibparser)
if len(parsed_entries.entries) < len(output_bib_entries)-5:
print("Warning: len(parsed_entries.entries) < len(output_bib_entries) -5 -->", len(parsed_entries.entries), len(output_bib_entries))
output_str = ""
for entry in output_bib_entries:
for line in entry:
# if any([re.match(r".*%s.*=.*"%n, line) for n in removed_value_names if len(n)>1]):
# continue
output_str += line
output_str += "\n"
return output_str
for output_entry in parsed_entries.entries:
for remove_name in removed_value_names:
if remove_name in output_entry:
del output_entry[remove_name]
for short, pattern in abbr_dict.items():
for place in ["booktitle", "journal"]:
if place in output_entry:
if re.match(pattern, output_entry[place]):
output_entry[place] = short
return bibtexparser.dumps(parsed_entries)
def normalize_bib(bib_db, all_bib_entries, output_bib_path, deduplicate=True, removed_value_names=[], abbr_dict={}):
output_bib_entries = []
num_converted = 0
bib_keys = set()
for bib_entry in all_bib_entries:
# read the title from this bib_entry
bibparser = bibtexparser.bparser.BibTexParser(ignore_nonstandard_types=False)
original_title = ""
original_bibkey = ""
bib_entry_str = " ".join([line for line in bib_entry if not is_contain_var(line)])
bib_entry_parsed = bibtexparser.loads(bib_entry_str, bibparser)
if len(bib_entry_parsed.entries)==0 or "title" not in bib_entry_parsed.entries[0]:
continue
original_title = bib_entry_parsed.entries[0]["title"]
original_bibkey = bib_entry_parsed.entries[0]["ID"]
if deduplicate and original_bibkey in bib_keys:
continue
bib_keys.add(original_bibkey)
title = normalize_title(original_title)
# try to map the bib_entry to the keys in all_bib_entries
found_bibitem = None
if title in bib_db and title:
# update the bib_key to be the original_bib_key
for line_idx in range(len(bib_db[title])):
line = bib_db[title][line_idx]
if line.strip().startswith("@"):
bibkey = line[line.find('{')+1:-1]
if not bibkey:
bibkey = bib_db[title][line_idx+1].strip()[:-1]
line = line.replace(bibkey, original_bibkey+",")
found_bibitem = bib_db[title].copy()
found_bibitem[line_idx] = line
break
if found_bibitem:
log_str = "Converted. ID: %s ; Title: %s" % (original_bibkey, original_title)
num_converted += 1
print(log_str)
output_bib_entries.append(found_bibitem)
else:
output_bib_entries.append(bib_entry)
print("Num of converted items:", num_converted)
# post-formatting
output_string = post_processing(output_bib_entries, removed_value_names, abbr_dict)
with open(output_bib_path, "w", encoding='utf8') as output_file:
output_file.write(output_string)
print("Written to:", output_bib_path)
def load_abbr_tsv(abbr_tsv_file):
abbr_dict = {}
with open(abbr_tsv_file) as f:
for line in f.read().splitlines():
ls = line.split("|")
if len(ls) == 2:
abbr_dict[ls[0].strip()] = ls[1].strip()
return abbr_dict
def update(filepath):
def execute(cmd):
print(cmd)
os.system(cmd)
execute("wget https://github.com/yuchenlin/rebiber/archive/main.zip -O /tmp/rebiber.zip")
execute("unzip -o /tmp/rebiber.zip -d /tmp/")
execute(f"cp /tmp/rebiber-main/rebiber/bib_list.txt {filepath}/bib_list.txt")
execute(f"cp /tmp/rebiber-main/rebiber/abbr.tsv {filepath}/abbr.tsv")
execute(f"cp /tmp/rebiber-main/rebiber/data/* {filepath}/data/")
print("Done Updating.")
def main():
filepath = os.path.dirname(os.path.abspath(__file__)) + '/'
parser = argparse.ArgumentParser()
parser.add_argument("-u", "--update", action='store_true', help="Update the data of bib and abbr.")
parser.add_argument("-v", "--version", action='store_true', help="Print the version of Rebiber.")
parser.add_argument("-i", "--input_bib",
type=str, help="The input bib file")
parser.add_argument("-o", "--output_bib", default="same",
type=str, help="The output bib file")
parser.add_argument("-l", "--bib_list", default=filepath+"bib_list.txt",
type=str, help="The list of candidate bib data.")
parser.add_argument("-a", "--abbr_tsv", default=filepath+"abbr.tsv",
type=str, help="The list of conference abbreviation data.")
parser.add_argument("-d", "--deduplicate", default=True,
type=bool, help="True to remove entries with duplicate keys.")
parser.add_argument("-s", "--shorten", default=False,
type=bool, help="True to shorten the conference names.")
parser.add_argument("-r", "--remove", default="",
type=str, help="A comma-seperated list of values you want to remove, such as '--remove url,biburl,address,publisher'.")
args = parser.parse_args()
if args.update:
update(filepath)
return
if args.version:
print(rebiber.__version__)
return
assert args.input_bib is not None, "You need to specify an input path by -i xxx.bib"
bib_db = construct_bib_db(args.bib_list, start_dir=filepath)
all_bib_entries = load_bib_file(args.input_bib)
output_path = args.input_bib if args.output_bib == "same" else args.output_bib
removed_value_names = [s.strip() for s in args.remove.split(",")]
if args.shorten:
abbr_dict = load_abbr_tsv(args.abbr_tsv)
else:
abbr_dict = {}
normalize_bib(bib_db, all_bib_entries, output_path, args.deduplicate, removed_value_names, abbr_dict)
if __name__ == "__main__":
main()
<file_sep>"""
Rebiber: A tool for normalizing bibtex with official info.
"""
from rebiber.bib2json import load_bib_file
from rebiber.normalize import construct_bib_db, normalize_bib
from ._version import __version__
__all__ = [
"__version__",
"load_bib_file",
"construct_bib_db",
"normalize_bib"
]<file_sep>conf_name=$1
shift
for year in "$@"
do
echo "$conf_name-$year"
python bib2json.py \
-i raw_data/$conf_name$year.bib \
-o data/$conf_name$year.bib.json
echo "data/$conf_name$year.bib.json" >> bib_list.txt
done
|
d17cda95d7784b88e6372643097df6212031c2fb
|
[
"Python",
"Shell"
] | 4 |
Python
|
tianyu-z/rebiber
|
8db6b2cb69f638774432e47516f8723e701db099
|
76058b099b3eb9d63c35c49ee13681226db5f4a9
|
refs/heads/master
|
<file_sep>include ':app', ':SlidingMenu', ':actionbarsherlock'
project(':SlidingMenu').projectDir = new File('libraires/SlidingMenu')
project(':actionbarsherlock').projectDir = new File('libraires/actionbarsherlock')<file_sep>package com.example.administrator.slidingmenutest.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListView;
import com.example.administrator.slidingmenutest.R;
import com.example.administrator.slidingmenutest.adapter.drawerAdapter;
import com.example.administrator.slidingmenutest.model.Drawer;
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
private Button button;
private SlidingMenu menu;
private Toolbar toolbar;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setTitle("SlidingTest");
//初始化侧滑菜单
initSlidingMenu();
//初始化侧滑菜单的ListView
initDrawerList();
ImageView drawer= (ImageView) findViewById(R.id.imageView);
drawer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
menu.showMenu();
}
});
//设置标题
// button = (Button) findViewById(R.id.button);
// button.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// menu.toggle();
// }
// });
}
public void initSlidingMenu() {
menu = new SlidingMenu(this);
//设置侧滑菜单的模式
menu.setMode(SlidingMenu.LEFT);
// 设置触摸屏幕的模式
//TOUCHMODE_FULLSCREEN 全屏监测,若监测到滑动则显示侧滑菜单
//TOUCHMODE_MARGIN 监测到所设置的边缘有滑动则显示侧滑菜单
//TOUCHMODE_NONE 只能通过按钮打开侧滑菜单
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
// 设置滑动阴影的宽度
menu.setShadowWidthRes(R.dimen.shadow_width);
// 设置滑动阴影的图像资源
menu.setShadowDrawable(R.drawable.drawer_shadow9);
// 设置滑动菜单视图的宽度
menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
// 设置渐入渐出效果的值
// menu.setFadeDegree(0.15f);
menu.attachToActivity(this, SlidingMenu.SLIDING_WINDOW);
menu.setMenu(R.layout.drawer);
//设置SlidingMenu与下方视图的移动的速度比,当为1时同时移动,取值0-1
//drawer.setBehindScrollScale(1.5f);
//设置二级菜单的阴影效果
//drawer.setSecondaryShadowDrawable(R.drawable.shadow);
//设置右边(二级)侧滑菜单
//drawer.setSecondaryMenu(R.layout.right_menu_frame);
}
public void initDrawerList() {
ListView listView = (ListView) findViewById(R.id.drawerList);
// ArrayAdapter<String> arrayAdapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1);
//
// listView.setAdapter(arrayAdapter);
// arrayAdapter.add("今日要闻");
// arrayAdapter.add("体育赛事");
// arrayAdapter.add("娱乐播报");
// arrayAdapter.add("国际新闻");
List<Drawer> list = new ArrayList<Drawer>();
list.add(new Drawer("新品推荐", "pic1.jpg"));
list.add(new Drawer("披萨", "pic2.jpg"));
drawerAdapter adapter = new drawerAdapter(this, list);
listView.setAdapter(adapter);
}
// @Override
// public boolean onCreateOptionsMenu(Menu menu) {
// // Inflate the drawer; this adds items to the action bar if it is present.
// getMenuInflater().inflate(R.menu.menu_main, menu);
// return true;
// }
//
// @Override
// public boolean onOptionsItemSelected(MenuItem item) {
// // Handle action bar item clicks here. The action bar will
// // automatically handle clicks on the Home/Up button, so long
// // as you specify a parent activity in AndroidManifest.xml.
// int id = item.getItemId();
//
// //noinspection SimplifiableIfStatement
// if (id == R.id.action_settings) {
// return true;
// }
//
// return super.onOptionsItemSelected(item);
// }
}
<file_sep>package com.example.administrator.slidingmenutest.model;
/**
* Created by Administrator on 2015/8/6.
*/
public class Drawer {
private String item;
private String path;
public Drawer(String item, String path) {
this.item = item;
this.path = path;
}
public String getItem() {
return item;
}
public void setItem(String item) {
this.item = item;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
}
<file_sep>package com.example.administrator.slidingmenutest.util;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.ref.WeakReference;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
/**
* Created by Administrator on 2015/8/4.
*/
public class ImageUtil {
private static final int IO_BUFFER_SIZE = 2*1024 ;
//从SD中获取图片资源
public static Bitmap getBitmapFromStorage(String path, int w, int h) {
BitmapFactory.Options opts = new BitmapFactory.Options();
// 设置为ture只获取图片大小
opts.inJustDecodeBounds = true;
opts.inPreferredConfig = Bitmap.Config.ARGB_8888;
// 返回为空
BitmapFactory.decodeFile(path, opts);
int width = opts.outWidth;
int height = opts.outHeight;
float scaleWidth = 0.f, scaleHeight = 0.f;
if (width > w || height > h) {
// 缩放
scaleWidth = ((float) width) / w;
scaleHeight = ((float) height) / h;
}
opts.inJustDecodeBounds = false;
float scale = Math.max(scaleWidth, scaleHeight);
opts.inSampleSize = (int)scale;
WeakReference<Bitmap> weak = new WeakReference<Bitmap>(BitmapFactory.decodeFile(path, opts));
return Bitmap.createScaledBitmap(weak.get(), w, h, true);
}
//从web中获取图片
public static Bitmap getBitmapFromServer(String imagePath) {
URL imageUrl = null;
Bitmap bitmap = null;
InputStream inputStream = null;
try {
imageUrl = new URL(imagePath);
} catch (MalformedURLException e) {
e.printStackTrace();
}
try {
HttpURLConnection conn = (HttpURLConnection) imageUrl
.openConnection();
conn.connect();
conn.setConnectTimeout(3000);
conn.setRequestMethod("GET");
conn.setDoInput(true);
int responseCode = conn.getResponseCode(); // 获取服务器响应值
if (responseCode == HttpURLConnection.HTTP_OK) { //正常连接
inputStream = conn.getInputStream(); //获取输入流
}
bitmap = BitmapFactory.decodeStream(inputStream);
inputStream.close();
conn.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
return bitmap;
// Bitmap bitmap = null;
// InputStream in = null;
// BufferedOutputStream out = null;
// try
// {
// in = new BufferedInputStream(new URL(imagePath).openStream(), IO_BUFFER_SIZE);
// ByteArrayOutputStream dataStream = new ByteArrayOutputStream();
// out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE);
// copy(in, out);
// out.flush();
// byte[] data = dataStream.toByteArray();
// bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
// data = null;
// return bitmap;
// }
// catch (IOException e)
// {
// e.printStackTrace();
// return null;
// }
}
private static void copy(InputStream in, OutputStream out)
throws IOException {
byte[] b = new byte[IO_BUFFER_SIZE];
int read;
while ((read = in.read(b)) != -1) {
out.write(b, 0, read);
}
}
}
<file_sep>package com.example.administrator.slidingmenutest.adapter;
import android.content.Context;
import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import com.example.administrator.slidingmenutest.R;
import com.example.administrator.slidingmenutest.model.Drawer;
import com.example.administrator.slidingmenutest.util.ImageUtil;
import java.util.List;
import java.util.zip.Inflater;
/**
* Created by Administrator on 2015/8/6.
*/
public class drawerAdapter extends BaseAdapter {
private List<Drawer> lists;
private Context context;
private ListView listView;
public drawerAdapter(Context context,List<Drawer> lists){
this.context=context;
this.lists=lists;
}
@Override
public int getCount() {
return lists.size();
}
@Override
public Object getItem(int position) {
return lists.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView==null){
LayoutInflater layoutInflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView=layoutInflater.inflate(R.layout.item_drawer, null);
}
ImageView imageView= (ImageView) convertView.findViewById(R.id.imageView);
Bitmap bitmap= ImageUtil.getBitmapFromStorage("/mnt/sdcard/APAO/photo/" + lists.get(position).getPath(),200,200);
imageView.setImageBitmap(bitmap);
TextView textView= (TextView) convertView.findViewById(R.id.textView);
textView.setText(lists.get(position).getItem());
return convertView;
}
}
|
1521fbf5b291ae837d5e92a797a2302615118ce7
|
[
"Java",
"Gradle"
] | 5 |
Gradle
|
LoveYouSoMuch-Seven/MusicApp
|
46d2d41753f5154c88fe3b80783dff4e509de734
|
127bba300fb1529d3210126a4001f0880880ff8a
|
refs/heads/master
|
<file_sep>const express = require("express");
const { defaultController } = require("../controllers/defaultController");
const {
addMovie,
updateMovie,
getMovie,
getAllMoviesInAYear,
getAllMoviesStartingWith,
getAllMoviesInRange,
deleteMovie,
} = require("../controllers/movies/movies.controller");
const { movieValidation } = require("../controllers/movies/movies.validator");
const router = express.Router();
router.get("/", defaultController);
router.post("/addMovie", movieValidation, addMovie);
router.post("/updateMovie", movieValidation, updateMovie);
router.post("/getMovie", getMovie);
router.post("/getAllMoviesInYear", getAllMoviesInAYear);
router.post("/getAllMoviesStartsWith", getAllMoviesStartingWith);
router.post("/getAllMoviesInRange", getAllMoviesInRange);
router.post("/deleteMovie", deleteMovie);
module.exports = router;
<file_sep>const { AWS } = require("../../utils/awsConfiguration");
const { errorFunction } = require("../../utils/errorFunction");
const addMovie = async (req, res, next) => {
try {
const docClient = new AWS.DynamoDB.DocumentClient();
const { year, title, info } = req.body;
const getParams = {
TableName: "Movies",
Key: {
year: year,
title: title,
},
};
docClient.get(getParams, (err, data) => {
if (err) {
console.log(
"Unable to Get Movie. Error JSON:",
JSON.stringify(err, null, 2)
);
res.status(400);
return res.json(errorFunction(true, "Unable to Get Movie"));
} else if (JSON.stringify(data) !== "{}") {
res.status(302);
return res.json(
errorFunction(true, "Movie Already Exists", {})
);
} else {
const params = {
TableName: "Movies",
Item: {
year,
title,
info,
},
};
docClient.put(params, (err, data) => {
if (err) {
console.log(
`Unable to Add the Movie titled - ${title}. Error JSON:`,
JSON.stringify(err, null, 2)
);
res.status(501);
return res.json(
errorFunction(true, "Unable to Add Movie")
);
} else {
res.status(201);
return res.json(
errorFunction(false, "Movie Added", req.body)
);
}
});
}
});
} catch (error) {
console.log(
"Error Adding Movie. Error JSON",
JSON.stringify(error, null, 2)
);
res.status(500);
return res.json(errorFunction(true, "Error Adding Movie"));
}
};
const getMovie = async (req, res, next) => {
try {
const docClient = new AWS.DynamoDB.DocumentClient();
const { year, title } = req.body;
if (
title === undefined ||
year === undefined ||
title === "" ||
typeof year !== "number" ||
typeof title !== "string"
) {
res.status(406);
return res.json(
errorFunction(true, "Data required to Get Movie")
);
} else {
const params = {
TableName: "Movies",
Key: {
year: year,
title: title,
},
};
docClient.get(params, (err, data) => {
if (err) {
console.log(
"Unable to Get Movie. Error JSON:",
JSON.stringify(err, null, 2)
);
res.status(400);
return res.json(
errorFunction(true, "Unable to Get Movie")
);
} else if (JSON.stringify(data) === "{}") {
res.status(404);
return res.json(
errorFunction(true, "Movie Not Found")
);
} else {
res.status(200);
return res.json(
errorFunction(false, "Movie Details", data.Item)
);
}
});
}
} catch (error) {
console.log(
"Error Getting Movie. Error JSON",
JSON.stringify(error, null, 2)
);
res.status(500);
return res.json(errorFunction(true, "Error Getting Movie"));
}
};
const deleteMovie = async (req, res, next) => {
try {
const docClient = new AWS.DynamoDB.DocumentClient();
const { year, title } = req.body;
if (
title === undefined ||
year === undefined ||
title === "" ||
typeof year !== "number" ||
typeof title !== "string"
) {
res.status(406);
return res.json(
errorFunction(true, "Data required to Delete Movie")
);
} else {
const params = {
TableName: "Movies",
Key: {
year,
title,
},
};
docClient.get(params, (err, data) => {
if (err) {
console.log(
"Unable to get Movie. Error JSON:",
JSON.stringify(err, null, 2)
);
res.status(400);
return res.json(
errorFunction(true, "Unable to Get Movie")
);
} else if (JSON.stringify(data) === "{}") {
res.status(404);
return res.json(
errorFunction(true, "Movie Not Found")
);
} else {
docClient.delete(params, (err, deletedData) => {
if (err) {
console.log(
"Unable to Delete Movie. Error JSON:",
JSON.stringify(err, null, 2)
);
res.status(400);
return res.json(
errorFunction(
true,
"Unable to Delete Movie"
)
);
} else {
res.status(200);
return res.json(
errorFunction(
false,
"Movie Deleted",
data.Item
)
);
}
});
}
});
}
} catch (error) {
console.log(
"Error Deleting Movie. Error JSON",
JSON.stringify(error, null, 2)
);
res.status(500);
return res.json(errorFunction(true, "Error Deleting Movie"));
}
};
const updateMovie = async (req, res, next) => {
try {
const docClient = new AWS.DynamoDB.DocumentClient();
const { year, title, info } = req.body;
const getParams = {
TableName: "Movies",
Key: {
year,
title,
},
};
docClient.get(getParams, (err, data) => {
if (err) {
console.log(
"Unable to get Movie. Error JSON:",
JSON.stringify(err, null, 2)
);
res.status(400);
return res.json(errorFunction(true, "Unable to Get Movie"));
} else if (JSON.stringify(data) === "{}") {
res.status(404);
return res.json(errorFunction(true, "Movie Not Found"));
} else {
const params = {
TableName: "Movies",
Key: {
year: year,
title: title,
},
UpdateExpression:
// "set info.directors = :d, info.rating = :r, info.actors = :a",
"set info = :i",
ExpressionAttributeValues: {
// ":d": info.directors,
// ":r": info.rating,
// ":a": info.actors,
":i": info,
},
ReturnValues: "UPDATED_NEW",
};
docClient.update(params, (err, data) => {
if (err) {
// console.log(
// "Unable to Update Movie. Error JSON:",
// JSON.stringify(err, null, 2)
// );
res.status(400);
return res.json(
errorFunction(
true,
"Error Updating Movie",
JSON.stringify(err, null, 2)
)
);
} else {
res.status(200);
return res.json(
errorFunction(
false,
"Movie Updated",
req.body
)
);
}
});
}
});
} catch (error) {
console.log(
"Error Updating Movie. Error JSON",
JSON.stringify(error, null, 2)
);
res.status(500);
return res.json(errorFunction(true, "Error Updating Movie"));
}
};
const getAllMoviesInAYear = async (req, res, next) => {
try {
const docClient = new AWS.DynamoDB.DocumentClient();
const { year } = req.body;
if (year === undefined || typeof year !== "number") {
res.status(406);
return res.json(
errorFunction(true, "Data required to Get All the Movies")
);
} else {
const params = {
TableName: "Movies",
KeyConditionExpression: "#y= :y",
ExpressionAttributeNames: {
"#y": "year",
},
ExpressionAttributeValues: {
":y": year,
},
};
docClient.query(params, (err, data) => {
if (err) {
console.log(
"Unable to Get the Movies. Error JSON:",
JSON.stringify(err, null, 2)
);
res.status(400);
return res.json(
errorFunction(true, "Unable to Get Movies")
);
} else if (JSON.stringify(data) === "{}") {
res.status(200);
return res.json(
errorFunction(true, "Movies Not Found")
);
} else {
res.status(200);
return res.json(
errorFunction(false, "Movie Details", data.Items)
);
}
});
}
} catch (error) {
console.log(
"Error Getting Movie. Error JSON",
JSON.stringify(error, null, 2)
);
res.status(500);
return res.json(errorFunction(true, "Error Getting Movie"));
}
};
const getAllMoviesStartingWith = async (req, res, next) => {
try {
const docClient = new AWS.DynamoDB.DocumentClient();
const { year, startsWith } = req.body;
if (
startsWith === undefined ||
startsWith === "" ||
typeof startsWith !== "string" ||
year === undefined ||
typeof year !== "number"
) {
res.status(406);
return res.json(
errorFunction(true, "Data required to Get All the Movies")
);
} else {
const params = {
TableName: "Movies",
ProjectionExpression: "#y, title, info.actors, info.rating",
KeyConditionExpression: "#y= :y and begins_with(title, :s)",
ExpressionAttributeNames: {
"#y": "year",
},
ExpressionAttributeValues: {
":y": year,
":s": startsWith,
},
};
docClient.query(params, (err, data) => {
if (err) {
console.log(
"Unable to Get the Movies. Error JSON:",
JSON.stringify(err, null, 2)
);
res.status(400);
return res.json(
errorFunction(true, "Unable to Get Movies")
);
} else if (JSON.stringify(data) === "{}") {
res.status(200);
return res.json(
errorFunction(true, "Movies Not Found")
);
} else {
res.status(200);
return res.json(
errorFunction(false, "Movie Details", data.Items)
);
}
});
}
} catch (error) {
console.log(
"Error Getting Movie. Error JSON",
JSON.stringify(error, null, 2)
);
res.status(500);
return res.json(errorFunction(true, "Error Getting Movie"));
}
};
const getAllMoviesInRange = async (req, res, next) => {
try {
const docClient = new AWS.DynamoDB.DocumentClient();
const { startingYear, endingYear } = req.body;
if (
startingYear === undefined ||
typeof startingYear !== "number" ||
endingYear === undefined ||
typeof endingYear !== "number"
) {
res.status(406);
return res.json(
errorFunction(true, "Data required to Get All the Movies")
);
} else {
const params = {
TableName: "Movies",
ProjectionExpression: "#y, title, info.rating",
FilterExpression: "#y between :sy and :ey",
ExpressionAttributeNames: {
"#y": "year",
},
ExpressionAttributeValues: {
":sy": startingYear,
":ey": endingYear,
},
};
docClient.scan(params, (err, data) => {
if (err) {
console.log(
"Unable to Get the Movies. Error JSON:",
JSON.stringify(err, null, 2)
);
res.status(400);
return res.json(
errorFunction(true, "Unable to Get Movies")
);
} else if (JSON.stringify(data) === "{}") {
res.status(200);
return res.json(
errorFunction(true, "Movies Not Found")
);
} else {
res.status(200);
return res.json(
errorFunction(false, "Movie Details", data.Items)
);
}
});
}
} catch (error) {
console.log(
"Error Getting Movie. Error JSON",
JSON.stringify(error, null, 2)
);
res.status(500);
return res.json(errorFunction(true, "Error Getting Movie"));
}
};
module.exports = {
addMovie,
updateMovie,
getMovie,
getAllMoviesInAYear,
getAllMoviesStartingWith,
getAllMoviesInRange,
deleteMovie,
};
<file_sep>const errorFunction = (errorBit, msg, result) => {
if (errorBit) return { is_error: errorBit, message: msg };
else return { is_error: errorBit, message: msg, data: result };
};
module.exports = {
errorFunction,
};
<file_sep>const app = require("./app");
const http = require("http");
const routes = require("./routes/routes");
const { checkMovieTable, deleteMovieTable } = require("./models/movie");
const port = process.env.PORT || 3000;
const server = http.createServer(app);
server.listen(port, () => {
try {
console.log(`Server Started on Port ${port}`);
checkMovieTable();
// deleteMovieTable();
app.use("/", routes);
} catch (error) {
console.log("Error Occured while running Server : ", error);
}
});
<file_sep>module.exports = {
tables: [
{
TableName: "Movies",
KeySchema: [
{
AttributeName: "year",
KeyType: "HASH",
},
{
AttributeName: "title",
KeyType: "RANGE",
},
],
AttributeDefinitions: [
{
AttributeName: "year",
AttributeType: "N",
},
{
AttributeName: "title",
AttributeType: "S",
},
],
ProvisionedThroughput: {
ReadCapacityUnits: 10,
WriteCapacityUnits: 10,
},
},
],
};
<file_sep>const { AWS } = require("../utils/awsConfiguration");
const fs = require("fs");
const path = require("path");
const checkMovieTable = () => {
const alreadyExists = true;
try {
const dynamoDB = new AWS.DynamoDB();
const params = {
TableName: "Movies",
};
dynamoDB.describeTable(params, async (err, data) => {
if (err) {
if (err.code === "ResourceNotFoundException") {
alreadyExists = true;
await createMovieTable();
}
} else {
alreadyExists = false;
return;
}
});
} catch (error) {
return console.log(
"Error Checking Table. Error JSON:",
JSON.stringify(error, null, 2)
);
}
};
const createMovieTable = async () => {
let alreadyExists = false;
try {
const dynamoDB = new AWS.DynamoDB();
const params = {
TableName: "Movies",
KeySchema: [
// Creating a PARTITION KEY
{ AttributeName: "year", KeyType: "HASH" },
// Creating a SORT KEY
{ AttributeName: "title", KeyType: "RANGE" },
],
AttributeDefinitions: [
{ AttributeName: "year", AttributeType: "N" },
{ AttributeName: "title", AttributeType: "S" },
],
ProvisionedThroughput: {
ReadCapacityUnits: 10,
WriteCapacityUnits: 10,
},
};
dynamoDB.createTable(params, async (err, data) => {
if (err) {
if (err.code === "ResourceInUseException") {
alreadyExists = true;
return;
} else
return console.log(
"Unable to Create Table. Error JSON:",
JSON.stringify(err, null, 2)
);
} else {
// console.log(
// "Table Created. Table JSON:",
// JSON.stringify(data, null, 2)
// );
// console.log("Table Created");
if (data.TableDescription.TableStatus === "ACTIVE")
return await loadMovieTableData();
}
});
} catch (error) {
return console.log(
"Error Creating Table. Error JSON:",
JSON.stringify(error, null, 2)
);
}
};
const deleteMovieTable = () => {
let notExists = false;
try {
const dynamoDB = new AWS.DynamoDB();
const params = {
TableName: "Movies",
};
dynamoDB.deleteTable(params, (err, data) => {
if (err) {
if (err.code === "ResourceNotFoundException") {
notExists = true;
return console.log("Table Does not Exists");
}
return console.log(
"Unable to Delete Table. Error JSON:",
JSON.stringify(err, null, 2)
);
} else {
console.log(
"Table Deleted. Table JSON:",
JSON.stringify(data, null, 2)
);
}
});
} catch (error) {
return console.log(
"Error Deleting Table. Error JSON:",
JSON.stringify(error, null, 2)
);
}
};
const loadMovieTableData = async () => {
try {
const docClient = new AWS.DynamoDB.DocumentClient();
const filePath = path.join(__dirname, "./../data/movieData.json");
const allMovies = JSON.parse(fs.readFileSync(filePath, "utf8"));
allMovies.forEach((movie) => {
var params = {
TableName: "Movies",
Item: {
year: movie.year,
title: movie.title,
info: movie.info,
},
};
docClient.put(params, (err, data) => {
if (err) {
console.log(
"Unable to Add a Movie titled - ",
movie.title,
". Error JSON:",
JSON.stringify(err, null, 2)
);
} else {
console.log("Movie Added. Movie Title:", movie.title);
}
});
});
} catch (error) {
console.log(
"Error Loading Movies. Error JSON:",
JSON.stringify(error, null, 2)
);
}
};
module.exports = { checkMovieTable, createMovieTable, deleteMovieTable };
<file_sep>const joi = require("joi");
const { errorFunction } = require("../../utils/errorFunction");
const currentYear = new Date().getFullYear();
const validation = joi.object({
year: joi.number().max(currentYear).required(),
title: joi.string().trim(true).required(),
info: joi.object({
directors: joi.array().items(joi.string().trim(true)),
release_date: joi.date(),
rating: joi.number().min(0).max(10),
genres: joi.array().items(joi.string().trim(true)),
image_url: joi.string().trim(true),
plot: joi.string().trim(true),
rank: joi.number().min(1),
running_time_secs: joi.number(),
actors: joi.array().items(joi.string().trim(true)),
}),
});
const movieValidation = (req, res, next) => {
const incomingData = {
year: req.body.year,
title: req.body.title,
info: req.body.info,
};
const { error } = validation.validate(incomingData);
if (error) {
res.status(400);
return res.json(errorFunction(true, error.message));
} else {
next();
}
};
module.exports = {
movieValidation,
};
<file_sep>const request = require("supertest");
const app = require("./../../app");
const { errorFunction } = require("./../../utils/errorFunction");
const { createMovieTable, deleteMovieTable } = require("./../../models/movie");
describe('Testing Movie Controller', () => {
beforeAll(() => {
createMovieTable();
})
afterAll(() => {
deleteMovieTable();
})
test("should Throw an Error Adding a Movie - Data Required", async () => {
const payload = {
title: "<NAME>"
};
const body = errorFunction(true, '"year" is required');
const response = await request(app)
.post("/addMovie")
.send(payload);
expect(response.statusCode).toBe(400);
expect(response.body).toStrictEqual(body);
});
test("should Throw an Error Adding a Movie - Data Required", async () => {
const payload = {
year: 2011
};
const body = errorFunction(true, '"title" is required');
const response = await request(app)
.post("/addMovie")
.send(payload);
expect(response.statusCode).toBe(400);
expect(response.body).toStrictEqual(body);
});
test("should Add a Non-existing Movie", async () => {
const payload = {
title: "<NAME>",
year: 2011,
info: {
directors: ["<NAME>"],
rating: 7.8,
actors: ["<NAME>", "<NAME>"],
},
};
const body = errorFunction(false, "Movie Added", payload)
const response = await request(app)
.post("/addMovie")
.send(payload);
expect(response.statusCode).toBe(201);
expect(response.body).toStrictEqual(body);
});
test("should Throw an Error Adding an Existing Movie", async () => {
const payload = {
title: "<NAME>",
year: 2011,
info: {
directors: ["<NAME>"],
rating: 7.8,
actors: ["<NAME>", "<NAME>"],
},
};
const body = errorFunction(true, "Movie Already Exists", {});
const response = await request(app)
.post("/addMovie")
.send(payload);
expect(response.statusCode).toBe(302);
expect(response.body).toStrictEqual(body);
});
test("should Get an Existing Movie", async () => {
const payload = {
title: "<NAME>",
year: 2011,
};
const body = errorFunction(false, "Movie Details", {
title: "<NAME>",
year: 2011,
info: {
directors: ["<NAME>"],
rating: 7.8,
actors: ["<NAME>", "<NAME>"],
},
})
const response = await request(app)
.post("/getMovie")
.send(payload);
expect(response.statusCode).toBe(200);
expect(response.body).toStrictEqual(body);
});
test("should Throw an Error Getting a Movie - Data Required", async () => {
const payload = {
year: 2011
};
const body = errorFunction(true, "Data required to Get Movie")
const response = await request(app)
.post("/getMovie")
.send(payload);
expect(response.statusCode).toBe(406);
expect(response.body).toStrictEqual(body);
});
test("should Throw an Error Getting a Movie - Data Required", async () => {
const payload = {
title: "<NAME>"
};
const body = errorFunction(true, "Data required to Get Movie")
const response = await request(app)
.post("/getMovie")
.send(payload);
expect(response.statusCode).toBe(406);
expect(response.body).toStrictEqual(body);
});
test("should Update an Existing Movie", async () => {
const payload = {
title: "<NAME>",
year: 2011,
info: {
directors: ["<NAME>", "<NAME>"],
rating: 8.2,
actors: ["<NAME>", "<NAME>", "<NAME>"],
},
};
const body = errorFunction(false, "Movie Updated", payload);
const response = await request(app)
.post("/updateMovie")
.send(payload);
expect(response.statusCode).toBe(200);
expect(response.body).toStrictEqual(body);
});
test("should Throw an Error Updating a Movie - Data Required", async () => {
const payload = {
title: "<NAME>"
};
const body = errorFunction(true, '"year" is required');
const response = await request(app)
.post("/updateMovie")
.send(payload);
expect(response.statusCode).toBe(400);
expect(response.body).toStrictEqual(body);
});
test("should Throw an Error Updating a Movie - Data Required", async () => {
const payload = {
year: 2011
};
const body = errorFunction(true, '"title" is required');
const response = await request(app)
.post("/updateMovie")
.send(payload);
expect(response.statusCode).toBe(400);
expect(response.body).toStrictEqual(body);
});
test("should Throw an Error Updating a Movie - Data Required", async () => {
const payload = {
title: "<NAME>",
year: 2011
};
const body = errorFunction(true, "Error Updating Movie")
const response = await request(app)
.post("/updateMovie")
.send(payload);
expect(response.statusCode).toBe(400);
expect(response.body).toStrictEqual(body);
});
test("should Delete an Existing Movie", async () => {
const payload = {
title: "<NAME>",
year: 2011,
};
const body = errorFunction(
false,
"Movie Deleted",
{
title: "<NAME>",
year: 2011,
info: {
directors: ["<NAME>", "<NAME>"],
rating: 8.2,
actors: ["<NAME>", "<NAME>", "<NAME>"],
},
}
)
const response = await request(app)
.post("/deleteMovie")
.send(payload);
expect(response.statusCode).toBe(200);
expect(response.body).toStrictEqual(body);
});
test("should Throw an Error Deleting a Movie - Data Required", async () => {
const payload = {
title: "<NAME>",
};
const body = errorFunction(true, "Data required to Delete Movie")
const response = await request(app)
.post("/deleteMovie")
.send(payload);
expect(response.statusCode).toBe(406);
expect(response.body).toStrictEqual(body);
});
test("should Throw an Error Deleting a Movie - Data Required", async () => {
const payload = {
year: 2011
};
const body = errorFunction(true, "Data required to Delete Movie")
const response = await request(app)
.post("/deleteMovie")
.send(payload);
expect(response.statusCode).toBe(406);
expect(response.body).toStrictEqual(body);
});
test("should Throw an Error Getting a Non-existing Movie", async () => {
const payload = {
title: "<NAME>",
year: 2011,
};
const body = errorFunction(true, "Movie Not Found")
const response = await request(app)
.post("/getMovie")
.send(payload);
expect(response.statusCode).toBe(404);
expect(response.body).toStrictEqual(body);
});
test("should Throw an Error Updating a Non-Existing Movie", async () => {
const payload = {
title: "<NAME>",
year: 2011,
info: {
directors: ["<NAME>", "<NAME>"],
rating: 8.2,
actors: ["<NAME>", "<NAME>", "<NAME>"],
},
};
const body = errorFunction(true, "Movie Not Found")
const response = await request(app)
.post("/updateMovie")
.send(payload);
expect(response.statusCode).toBe(404);
expect(response.body).toStrictEqual(body);
});
test("should Throw an Error Deleting a Non-existing Movie", async () => {
const payload = {
title: "<NAME>",
year: 2011,
};
const body = errorFunction(true, "Movie Not Found")
const response = await request(app)
.post("/deleteMovie")
.send(payload);
expect(response.statusCode).toBe(404);
expect(response.body).toStrictEqual(body);
});
test("should Get all Movies from a Given Year - Zero Movie", async () => {
const payload = {
year: 2020
};
const body = errorFunction(false, "Movie Details", []);
const response = await request(app)
.post("/getAllMoviesInYear")
.send(payload);
expect(response.statusCode).toBe(200);
expect(response.body).toStrictEqual(body);
});
test("should Get all Movies from a Given Year - Single Movie", async () => {
const payload = {
year: 2011
};
const response = await request(app)
.post("/getAllMoviesInYear")
.send(payload);
expect(response.statusCode).toBe(200);
expect(response.body.data[0].title).toBe("Bridesmaids");
});
test("should Get all Movies from a Given Year - N Movies", async () => {
const payload = {
year: 2013
};
const response = await request(app)
.post("/getAllMoviesInYear")
.send(payload);
expect(response.statusCode).toBe(200);
expect(response.body.data.length).toBe(57);
});
test("should Throw an Error Getting all Movies from a Given Year - Data Required", async () => {
const body = errorFunction(true, "Data required to Get All the Movies")
const response = await request(app)
.post("/getAllMoviesInYear");
expect(response.statusCode).toBe(406);
expect(response.body).toStrictEqual(body);
});
test("should Get all Movies Starting with a Letter - Zero Movie", async () => {
const payload = {
year: 2013,
startsWith: "K"
};
const body = errorFunction(false, "Movie Details", []);
const response = await request(app)
.post("/getAllMoviesStartsWith")
.send(payload);
expect(response.statusCode).toBe(200);
expect(response.body).toStrictEqual(body);
});
test("should Get all Movies Starting with a Letter - Single Movie", async () => {
const payload = {
year: 2013,
startsWith: "j"
};
const response = await request(app)
.post("/getAllMoviesStartsWith")
.send(payload);
expect(response.statusCode).toBe(200);
expect(response.body.data[0].title).toBe("jOBS");
});
test("should Get all Movies Starting with a Letter - N Movies", async () => {
const payload = {
year: 2013,
startsWith: "E"
};
const response = await request(app)
.post("/getAllMoviesStartsWith")
.send(payload);
expect(response.statusCode).toBe(200);
expect(response.body.data.length).toBe(4);
});
test("should Throw an Error Getting all Movies Starting with a Letter - Data Required", async () => {
const payload = {
year: 2013,
};
const body = errorFunction(true, "Data required to Get All the Movies")
const response = await request(app)
.post("/getAllMoviesStartsWith")
.send(payload);
expect(response.statusCode).toBe(406);
expect(response.body).toStrictEqual(body);
});
test("should Throw an Error Getting all Movies Starting with a Letter - Data Required", async () => {
const payload = {
startsWith: "E"
};
const body = errorFunction(true, "Data required to Get All the Movies")
const response = await request(app)
.post("/getAllMoviesStartsWith")
.send(payload);
expect(response.statusCode).toBe(406);
expect(response.body).toStrictEqual(body);
});
test("should Get all Movies from a given Year Range - Zero Movie", async () => {
const payload = {
startingYear: 2020,
endingYear: 2021
};
const body = errorFunction(false, "Movie Details", []);
const response = await request(app)
.post("/getAllMoviesInRange")
.send(payload);
expect(response.statusCode).toBe(200);
expect(response.body).toStrictEqual(body);
});
test("should Get all Movies from a given Year Range - Single Movie", async () => {
const payload = {
startingYear: 2009,
endingYear: 2010
};
const response = await request(app)
.post("/getAllMoviesInRange")
.send(payload);
expect(response.statusCode).toBe(200);
expect(response.body.data[0].title).toBe("Insidious");
});
test("should Get all Movies from a given Year Range - N Movies", async () => {
const payload = {
startingYear: 2011,
endingYear: 2013
};
const response = await request(app)
.post("/getAllMoviesInRange")
.send(payload);
expect(response.statusCode).toBe(200);
expect(response.body.data.length).toBe(68);
});
test("should Throw an Error Getting all movies from a given Year Range - Data Required", async () => {
const payload = {
startingYear: 2011
};
const body = errorFunction(true, "Data required to Get All the Movies");
const response = await request(app)
.post("/getAllMoviesInRange")
.send(payload);
expect(response.statusCode).toBe(406);
expect(response.body).toStrictEqual(body);
});
test("should Throw an Error Getting all movies from a given Year Range - Data Required", async () => {
const payload = {
endingYear: 2011
};
const body = errorFunction(true, "Data required to Get All the Movies");
const response = await request(app)
.post("/getAllMoviesInRange")
.send(payload);
expect(response.statusCode).toBe(406);
expect(response.body).toStrictEqual(body);
});
});
<file_sep>require("dotenv").config();
const AWS = require("aws-sdk");
AWS.config.update({
region: process.env.REGION,
endpoint: process.env.ENDPOINT,
});
module.exports = {
AWS,
};
<file_sep><h1 align="center"> <b> CRUD Operations with NodeJS + DynamoDB </b> </h1>






<hr>
## **Functionalities**
✅ Add Movie
✅ Update Movie
✅ Get Movie
✅ Get All Movies in a Given Year
✅ Get All Movies in a Given Year Starting With a Given Letter
✅ Get All Movies in a Given Range of Year
✅ Delete Movie
<file_sep>const { errorFunction } = require("../utils/errorFunction");
const defaultController = async (req, res, next) => {
res.status(200);
return res.json(errorFunction(false, "Welcome to AWS DynamoDB", "DynamoDB"));
};
module.exports = { defaultController };
|
2ae6a2ddea8e3dcaa66e8ad385b6286b1f15adee
|
[
"JavaScript",
"Markdown"
] | 11 |
JavaScript
|
NisargChokshi45/Task4NodeDynamoDB
|
d53caeb45f2a902638e1d3f5d480273f6ac97a89
|
02d22b95acaf21bc3e24b3aca3fda1fd437f17ed
|
refs/heads/master
|
<file_sep>package hh.reporting;
import com.codeborne.selenide.Screenshots;
import com.google.common.io.Files;
import ru.yandex.qatools.allure.annotations.Attachment;
import org.testng.*;
import java.io.File;
public class TestRunListenerTestNG implements ITestListener, ISuiteListener, IInvokedMethodListener {
/**
* This belongs to IInvokedMethodListener and will execute before every method including @Before @After @Test
*
* @param iInvokedMethod
* @param iTestResult
*/
@Override
public void beforeInvocation( IInvokedMethod iInvokedMethod, ITestResult iTestResult ) {
String textMsg = "About to begin executing following method : " + returnMethodName( iInvokedMethod.getTestMethod() );
Reporter.log(textMsg, true);
}
/**
* This belongs to IInvokedMethodListener and will execute after every method including @Before @After @Test
*
* @param iInvokedMethod
* @param iTestResult
*/
@Override
public void afterInvocation( IInvokedMethod iInvokedMethod, ITestResult iTestResult ) {
String textMsg = "Completed executing following method : " + returnMethodName( iInvokedMethod.getTestMethod() );
Reporter.log( textMsg, true );
}
/**
* This belongs to ISuiteListener and will execute before the Suite start.
*
* @param iSuite
*/
@Override
public void onStart( ISuite iSuite ) {
Reporter.log( "About to begin executing Suite " + iSuite.getName(), true );
}
/**
* This belongs to ISuiteListener and will execute, once the Suite is finished.
*
* @param iSuite
*/
@Override
public void onFinish( ISuite iSuite ) {
Reporter.log( "About to end executing Suite " + iSuite.getName(), true );
}
/**
* This belongs to ITestListener and will execute before the main test start (@Test).
*
* @param iTestResult
*/
@Override
public void onTestStart( ITestResult iTestResult ) {
System.out.println("The execution of the main test starts now");
}
/**
* This belongs to ITestListener and will execute only when the test is pass.
*
* @param iTestResult
*/
@Override
public void onTestSuccess( ITestResult iTestResult ) {
printTestResults(iTestResult);
}
/**
* This belongs to ITestListener and will execute only on the event of fail test.
*
* @param iTestResult
*/
@Override
public void onTestFailure( ITestResult iTestResult ) {
printTestResults( iTestResult );
makeScreenshot();
}
/**
* This belongs to ITestListener and will execute only if any of the main test(@Test) get skipped.
*
* @param iTestResult
*/
@Override
public void onTestSkipped( ITestResult iTestResult ) {
printTestResults(iTestResult);
}
/**
* No any actions for this.
*
* @param iTestResult
*/
@Override
public void onTestFailedButWithinSuccessPercentage( ITestResult iTestResult ) {
}
/**
* This belongs to ITestListener and will execute before starting of Test set/batch.
*
* @param iTestContext
*/
@Override
public void onStart( ITestContext iTestContext ) {
Reporter.log( "About to begin executing Test " + iTestContext.getName(), true );
}
/**
* This belongs to ITestListener and will execute, once the Test set/batch is finished.
*
* @param iTestContext
*/
@Override
public void onFinish( ITestContext iTestContext ) {
Reporter.log( "Completed executing test " + iTestContext.getName(), true );
}
/**
* This will return method names to the calling function
*
* @param testMethod - Test method.
* @return
*/
private String returnMethodName( ITestNGMethod testMethod ) {
return testMethod.getRealClass().getSimpleName() + "." + testMethod.getMethodName();
}
/**
* This is the method which will be executed in case of test pass or fail
* This will provide the information on the test
*
* @param result
*/
private void printTestResults( ITestResult result ) {
Reporter.log( "Test Method resides in " + result.getTestClass().getName(), true );
if (result.getParameters().length != 0) {
String params = null;
for (Object parameter : result.getParameters()) {
params += parameter.toString() + ",";
}
Reporter.log( "Test Method had the following parameters : " + params, true );
}
String status = null;
switch (result.getStatus()) {
case ITestResult.SUCCESS:
status = "Pass";
break;
case ITestResult.FAILURE:
status = "Failed";
break;
case ITestResult.SKIP:
status = "Skipped";
break;
}
Reporter.log( "Test Status: " + status, true );
}
/**
* Attaches screenshot to the Allure report.
*
* @return Byte array of the made screenshot.
* @throws Exception
*/
@Attachment( value = "Screenshot Attachment", type = "image/png" )
public byte[] makeScreenshot() {
File screenshot = Screenshots.takeScreenShotAsFile();
/* Unable to take a screenshot when browser is not started. */
if (screenshot == null)
return (new byte[]{});
try {
return Files.toByteArray( screenshot );
} catch (Exception e) {
System.out.println( "[CUSTOM FAILURE]: Attempt to transform a screenshot into byte[] for Yandex.Allure report." );
e.printStackTrace();
return (new byte[]{});
}
}
}
<file_sep># HH
To run project use clean-test-site maven goal.
Use maven 3.3.9 or higher<file_sep>package hh;
import static com.codeborne.selenide.Selenide.open;
import static java.util.Arrays.asList;
import hh.Steps.EmployerPage;
import hh.Steps.SearchPage;
import org.testng.annotations.*;
import ru.yandex.qatools.allure.annotations.Description;
import ru.yandex.qatools.allure.annotations.Features;
import ru.yandex.qatools.allure.annotations.Stories;
import ru.yandex.qatools.allure.annotations.Title;
import hh.Steps.HomePage;
/**
* Created by KKornilov on 13.01.2017.
*/
@Title("backend auth")
@Description("features")
public class TestHh extends Base {
@Features("My Feature")
@Stories({"Story1", "Story2"})
@Test
public void CheckCompanyExist() throws Exception {
HomePage mainPage = open("https://spb.hh.ru", HomePage.class);
checkLayout("specs/HomePage.gspec", asList("desktop"));
SearchPage search = mainPage.CompanySearch("новые облачные");
search.CheckCompanyName("Новые Облачные Технологии");
checkLayout("specs/SearchPage.gspec", asList("desktop"));
}
@Features("My Feature")
@Stories({"Story1", "Story2"})
@Test(dependsOnMethods = { "CheckCompanyExist" })
public void CheckVacansyCount() throws Exception {
/* SearchPage search= open("https://spb.hh.ru/employers_list?query=новые облачные&areaId=113", SearchPage.class);
search.CheckCompanyName("Новые Облачные Технологии");
EmployerPage employer = search.ToCompany();
employer.CheckCount(0);*/
EmployerPage employer= open("https://spb.hh.ru/employer/213397", EmployerPage.class);
employer.CheckCompanyName("Новые Облачные Технологии ");
employer.CheckCount(0);
checkLayout("specs/EmployerPage.gspec", asList("section"));
}
@Features("My Feature")
@Stories({"Story1", "Story2"})
@Test(dependsOnMethods = { "CheckVacansyCount" })
public void CheckQaVacansy() throws Exception {
EmployerPage employer= open("https://spb.hh.ru/employer/213397", EmployerPage.class);
employer.CheckVacansy("Qa");
checkLayout("specs/EmployerPage.gspec", asList("Content"));
}
@AfterTest
public void close_driver() throws Exception {
driver.quit();
}
}
<file_sep><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>common</groupId>
<artifactId>QA</artifactId>
<version>1.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>${project.build.sourceEncoding}</project.reporting.outputEncoding>
<allure.version>1.4.23</allure.version>
<compiler.version>1.8</compiler.version>
<java.version>1.8</java.version>
<selenide.version>4.2</selenide.version>
<aspectj.version>1.8.9</aspectj.version>
<testng.version>6.8.8</testng.version>
</properties>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
</dependency>
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>${selenide.version}</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-testng-adaptor</artifactId>
<version>${allure.version}</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-model</artifactId>
<version>${allure.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.21</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.7</version>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>1.5.0</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.galenframework</groupId>
<artifactId>galen-java-support</artifactId>
<version>2.3.2</version>
</dependency>
</dependencies>
<reporting>
<excludeDefaults>true</excludeDefaults>
<plugins>
<plugin>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-maven-plugin</artifactId>
<version>2.5</version>
<configuration>
<reportDirectory>${project.build.directory}/allure-report</reportDirectory>
</configuration>
</plugin>
</plugins>
</reporting>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>artifactory-maven-plugin</artifactId>
<version>2.6.1</version>
<inherited>false</inherited>
<executions>
<execution>
<id>build-info</id>
<goals>
<goal>publish</goal>
</goals>
<configuration>
<deployProperties>
<gradle>awesome</gradle>
<review.team>qa</review.team>
</deployProperties>
<publisher>
<contextUrl>https://oss.jfrog.org</contextUrl>
<username>deployer</username>
<password>{<PASSWORD>}...</password>
<repoKey>libs-release-local</repoKey>
<snapshotRepoKey>libs-snapshot-local</snapshotRepoKey>
</publisher>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
<argLine>
-Xmx1024m -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.10.v20150310</version>
<configuration>
<webAppSourceDirectory>${project.build.directory}/allure-report</webAppSourceDirectory>
<stopKey>stop</stopKey>
<stopPort>1234</stopPort>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project><file_sep>package hh.Steps;
import com.codeborne.selenide.Condition;
import com.codeborne.selenide.SelenideElement;
import org.openqa.selenium.By;
import ru.yandex.qatools.allure.annotations.Step;
import static com.codeborne.selenide.Selenide.$;
import static com.codeborne.selenide.Selenide.page;
/**
* Created by KKornilov on 15.01.2017.
*/
public class SearchPage {
SearchPageElements searchpage = new SearchPageElements();
@Step("Проверка наличия компании")
public SearchPageElements CheckCompanyName(String SearchCompanyName) {
searchpage.SearchCompanyName()
.should(Condition.visible)
.should(Condition.appear)
.should(Condition.text(SearchCompanyName));
return page(SearchPageElements.class);
}
@Step("Проверка наличия компании")
public EmployerPage ToCompany() {
searchpage.SearchCompanyName()
.should(Condition.visible)
.should(Condition.appear)
.click();
return page(EmployerPage.class);
}
}
class SearchPageElements {
public SelenideElement SearchCompanyName() {
return $(By.cssSelector("div.l-nopaddings > table > tbody > tr > td > div > a"));
}
}
<file_sep>package hh.Steps;
import com.codeborne.selenide.CollectionCondition;
import com.codeborne.selenide.ElementsCollection;
import com.codeborne.selenide.SelenideElement;
import org.apache.commons.lang3.StringUtils;
import org.openqa.selenium.By;
import ru.yandex.qatools.allure.annotations.Step;
import java.util.Iterator;
import static com.codeborne.selenide.Selenide.$;
import static com.codeborne.selenide.Selenide.$$;
import static com.codeborne.selenide.Selenide.page;
/**
* Created by KKornilov on 15.01.2017.
*/
public class EmployerPage {
EmployerPageElements employerpage = new EmployerPageElements();
@Step("Проверка количества вакансий в текущем регионе")
public EmployerPageElements CheckCount(Integer count) {
Integer employercount = Integer.valueOf(employerpage.CountInMainRegion().getText());
assert(employercount >= count) : "Количество вакансий в текущем регионе меньше ожидаемого";
return page(EmployerPageElements.class);
}
@Step("В текущем регионе есть вакансия \"QA Automation Engineer\"")
public EmployerPageElements CheckVacansy(String VacansyName) {
Integer count = 0;
employerpage.IT().click();
employerpage.Vacansys().shouldBe(CollectionCondition.sizeGreaterThan(0));
Iterator element = employerpage.Vacansys().iterator();
while (element.hasNext()) {
SelenideElement elem = (SelenideElement) element.next();
String name = elem.getText();
boolean match = StringUtils.containsIgnoreCase(name, VacansyName);
if (match){
count = count + 1;
}
}
assert(count > 0) : "В текущем регионе отсутвуют ожидаемые вакансии";
return page(EmployerPageElements.class);
}
@Step("Проверка названия компании")
public EmployerPageElements CheckCompanyName(String CompanyName) {
String name = employerpage.CompanyName().getText();
assert(name.equals(CompanyName)) : "Название компании " + name + "не соотвествует ожидаемому " + CompanyName;
return page(EmployerPageElements.class);
}
}
class EmployerPageElements {
public SelenideElement CompanyName() {
return $(By.cssSelector("div > div.bloko-gap.bloko-gap_bottom > div > h1"));
}
public SelenideElement CountInMainRegion() {
return $(By.cssSelector("div.b-employerpage-vacancies.g-expand > h4 > span.b-employerpage-vacancies-hint"));
}
public SelenideElement IT() {
return $(By.cssSelector("div > div:nth-child(1) > div.b-emppage-vacancies-group-title > a"));
}
public ElementsCollection Vacansys() {
return $$(By.cssSelector("div.b-vacancy-list-name > a"));
}
}
|
d7a1fbded7b7c4270e7df2c1f03a18dc1f96b3cb
|
[
"Markdown",
"Java",
"Maven POM"
] | 6 |
Java
|
kornilovk/HH
|
aa92dfed63a68e97192dc656deb945b2927d3480
|
0389b07e01370c434b2b0dff38959b4e93d70bce
|
refs/heads/master
|
<repo_name>mgwithey/githublab<file_sep>/sumsubset.c
//Recitaiton quiz 2
//<NAME>
//some of the code is from slides
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
int combinations(int n,int k) {
int long factN = 1;
int long factK = 1;
int long factNK = 1;
int long total = 0;
for (int i = 1; i <= n; i++) {
factN *= i;
}
for (int i = 1; i <= k; i++) {
factK *= i;
}
for (int i = 1; i <= (n-k); i++) {
factNK *= i;
}
total = (factN) / ((factNK)*(factK));
return total;
}
int sumsTo(int x[], int n, int k, int v) {
if (v==0 && k==0) {return 1;}
if (v!=0 && k==0) {return 0;}
if (n==0) {return 0;}
int res1 = 0;
if (v >= x[0]) {
res1 = sumsTo(x+1, n-1, k-1, v - x[0]);
}
int res2 = sumsTo(x+1, n-1, k, v);
return res1 + res2 > 0;
}
int main (void) {
int x[] = {1,2,3,4,5}; //can change array here
int n = sizeof(x)/sizeof(int);
printf("\nGiven array\n{ ");
for (int i = 0; i < n; i++) {
printf("%d ", x[i]);
}
printf("}\nThere are %d numbers in the array\n", n);
int k = 3; //number of allowed terms
printf("There are %d allowed terms\n", k);
int v = 10; //desired number
printf("%d is the desired number\n", v);
int total = combinations(n,k);
printf("There are %d total combinations \n", total);
if (sumsTo(x, n, k, v) == 1) {
printf ("Subset exists\n\n");
} else {
printf ("Impossible combination\n\n");
}
return 0;
}
|
fc97d42aea7ff9f25587cd234a693c9a53a62c91
|
[
"C"
] | 1 |
C
|
mgwithey/githublab
|
e3741484a763b82027799e01e23dde78dc02dbfb
|
a5916937dfe7583a47f34f3281702097e2a70f9a
|
refs/heads/master
|
<file_sep>#Thu Jul 08 18:05:48 KST 2021
org.eclipse.core.runtime=2
org.eclipse.platform=4.16.0.v20200604-0540
<file_sep>package com.kh.product.service;
import static com.kh.common.JDBCTemplate.*;
import java.sql.Connection;
import java.util.ArrayList;
import com.kh.product.model.dao.ProductDAO;
import com.kh.product.model.exception.ProductException;
import com.kh.product.model.vo.ProductIO;
public class ProductService {
public ArrayList<ProductIO> selectAll() throws ProductException {
Connection conn = getConnection();
ArrayList<ProductIO> list = new ProductDAO().selectAll(conn);
return list;
}
public int insertProduct(ProductIO p) throws ProductException {
Connection conn = getConnection();
int result = new ProductDAO().insertProduct(conn,p);
if(result >0)
{
commit(conn);
}
else
rollback(conn);
return result;
}
public int updateProduct(ProductIO p,String id) throws ProductException {
Connection conn = getConnection();
int result = new ProductDAO().updateProduct(conn,p,id);
if(result >0)
{
commit(conn);
}
else
rollback(conn);
return result;
}
public int deleteProduct(String id) throws ProductException {
Connection conn = getConnection();
int result = new ProductDAO().deleteProduct(conn,id);
if(result >0)
{
commit(conn);
}
else
rollback(conn);
return result;
}
public ProductIO searchProduct(String pName) throws ProductException {
Connection conn = getConnection();
ProductIO p = new ProductDAO().searchProduct(conn,pName);
return p;
}
public ArrayList<ProductIO> IOselectAll() throws ProductException {
Connection conn = getConnection();
ArrayList<ProductIO> list = new ProductDAO().IOselectAll(conn);
return list;
}
public ArrayList<ProductIO> IOselectInput() throws ProductException {
Connection conn = getConnection();
ArrayList<ProductIO> list = new ProductDAO().IOselectInput(conn);
return list;
}
public ArrayList<ProductIO> IOselectOutput() throws ProductException {
Connection conn = getConnection();
ArrayList<ProductIO> list = new ProductDAO().IOselectOutput(conn);
return list;
}
public int IOinsertProduct(ProductIO p) throws ProductException {
Connection conn = getConnection();
int result = new ProductDAO().IOinsertProduct(conn,p);
if(result >0)
{
commit(conn);
}
else
rollback(conn);
return result;
}
public int IOdeleteProduct(ProductIO p) throws ProductException {
Connection conn = getConnection();
int result = new ProductDAO().IOdeleteProduct(conn,p);
if(result >0)
{
commit(conn);
}
else
rollback(conn);
return result;
}
}
|
7f2e4720d0c0df21c2e14422a4662be9e04800fc
|
[
"Java",
"INI"
] | 2 |
INI
|
kmk9259/KH_Study_JDBC
|
e0d8b29f10feed67834e5dd1bf063cfe2537dc75
|
fcfa383b17650350d68d48f221c6e69121f8d831
|
refs/heads/master
|
<repo_name>michelvermeulen/covid-attestation-generateur<file_sep>/routes/index.js
var express = require("express");
var router = express.Router();
const bodyParser = require("body-parser");
const fs = require("fs");
const path = require("path");
const pdflib = require("pdf-lib");
const { drawLinesOfText, drawSvgPath } = require("pdf-lib");
const QRCode = require("qrcode");
const { default: Stream } = require("pdf-lib/cjs/core/streams/Stream");
const moment = require("moment-timezone");
var mysql = require("mysql");
const useragent = require("express-useragent");
require("dotenv").config();
var connection = mysql.createConnection({
host: process.env.DB_HOST,
user: process.env.DB_USER,
password: <PASSWORD>,
});
router.get("/", function (req, res, next) {
res.redirect("/app/");
});
/* GET home page. */
router.get("/app/", function (req, res, next) {
let cookie = req.cookies.covidgendata;
let data;
if (typeof cookie != "undefined") {
data = JSON.parse(cookie);
} else {
data = null;
}
if (typeof req.query.clear !== "undefined" || !data) {
// res.cookie("covidgendata", null, {
// maxAge: new Date(0),
// });
res.render("index", { data, showForm: true });
} else {
res.render("index", { data });
}
});
router.get("/pdf/", async function (req, res, next) {
if (typeof req.cookies.covidgendata == "undefined" || JSON.parse(req.cookies.covidgendata).nom.length == 0 || typeof req.query.raison == "undefined") {
res.redirect("/app/");
} else {
data = JSON.parse(req.cookies.covidgendata);
data.raison = req.query.raison;
const pdf = await editPdf(data);
var source = req.headers["user-agent"],
ua = useragent.parse(source);
connection.query("INSERT INTO webflandre.covid_hits (user_agent, time) VALUES(?,?)", [req.headers["user-agent"], moment().tz("Europe/Paris").format("YYYY-M-DD HH:mm:ss")], function (err, rows, fields) {
if (err) throw err;
});
res.setHeader("Content-Type", "application/pdf");
res.setHeader("Content-Length", Buffer.byteLength(Buffer.from(pdf.buffer), "utf-8"));
// res.setHeader("Content-Disposition", "attachment; filename=attestation.pdf");
res.setHeader("Content-Disposition", "inline; filename=attestation" + new Date().getTime() + ".pdf");
res.send(Buffer.from(pdf.buffer));
}
});
router.post("/app/generate", async function (req, res, next) {
let data;
if (req.body && typeof req.body.nom !== "undefined") {
let now = new Date();
now.setMonth(now.getMonth() + 6);
res.cookie("covidgendata", JSON.stringify(req.body), {
maxAge: 15552000000,
});
data = req.body;
res.redirect("/");
}
});
async function editPdf(data) {
const existingPdfBytes = fs.readFileSync(path.resolve(__dirname, "../public/layout_new_2.pdf"));
const pdfDoc = await pdflib.PDFDocument.load(existingPdfBytes);
const page1 = pdfDoc.getPages()[0];
const font = await pdfDoc.embedFont(pdflib.StandardFonts.Helvetica);
const drawText = (text, x, y, size = 11) => {
page1.drawText(text, { x, y, size, font });
};
const { nom, prenom, datenaissance, lieunaissance, adresse, codepostal, ville, raison } = data;
Date.prototype.getFrenchFormat = function () {
var mm = this.getMonth() + 1; // getMonth() is zero-based
var dd = this.getDate();
return [(dd > 9 ? "" : "0") + dd, (mm > 9 ? "" : "0") + mm, this.getFullYear()].join("/");
};
//const date = new Date(datenaissance);
const now = new Date();
const localTime = moment().tz("Europe/Paris").format("H:m");
const localTimeElms = localTime.split(":", 2);
const localHour = localTimeElms[0].toString().padStart(2, 0) + ":" + localTimeElms[1].toString().padStart(2, 0);
drawText(prenom + " " + nom, 150, 595);
drawText(datenaissance, 140, 582);
drawText(lieunaissance, 240, 582);
drawText(`${adresse} ${codepostal} ${ville}`, 140, 568);
drawText(ville, 100, 161);
drawText(now.getFrenchFormat(), 80, 148);
drawText(localHour, 180, 148);
let motifs = ["Travail", "Courses", "Consultation médicale", "Motif familial impérieux, personnes vulnérables ou précaires ou gardes d’enfants", "Assistance handicap", "Sortie & Sport", "Justice", "Intérêt général", "Enfants", "Déplacements de transit et longue distance", "Achats professionnels et livraisons à domicile", "Déménagement", "Démarches administratives ou juridiques", "Culte", "Participation à des rassemblements autorisés"];
let reasons = [
"Déplacements entre le domicile et le lieu d’exercice de l’activité professionnelle ou le lieu d’enseignement et de formation, déplacements professionnels ne pouvant être différés",
"Déplacements pour effectuer des achats de première nécessité ou des retraits de commandes",
"Déplacements pour des consultations, examens, actes de prévention (dont vaccination) et soins ne pouvant être assurés à distance ou pour l’achat de produits de santé",
"Motif familial impérieux, personnes vulnérables ou précaires ou gardes d’enfant",
"Déplacements pour motif familial impérieux, pour l’assistance aux personnes vulnérables ou précaires ou pour la garde d’enfants",
"Déplacements des personnes en situation de handicap et de leur accompagnant",
"Déplacements dans un rayon maximal de dix kilomètres autour du domicile, liés soit à l'activité physique individuelle des personnes, à l'exclusion de toute pratique sportive collective, soit à la promenade avec les seules personnes regroupées dans un même domicile",
"Déplacements pour répondre à une convocation judiciaire ou administrative, déplacements pour se rendre chez un professionnel du droit, pour un acte ou une démarche qui ne peuvent être réalisés à distance",
"Déplacements pour participer à des missions d’intérêt général sur demande de l’autorité administrative",
"Déplacement pour chercher les enfants à l’école et à l’occasion de leurs activités périscolaires",
"Déplacements pour effectuer des achats de fournitures nécessaires à l'activité professionnelle, ou pour des livraisons à domicile",
"Déplacements liés à un déménagement résultant d'un changement de domicile et déplacements indispensables à l'acquisition ou à la location d’une résidence principale, insusceptibles d'être différés",
"Déplacements pour se rendre dans un service public pour un acte ou une démarche qui ne peuvent être réalisés à distance",
"Déplacements à destination ou en provenance d'un lieu de culte",
"Participation à des rassemblements, réunions ou activités sur la voie publique ou dans un lieu ouvert au public qui ne sont pas interdits en application de l'article 3"
];
let text = reasons[raison - 1];
let words = text.split(' ');
let y = 400;
while (words.length > 0) {
let portion = '';
while (portion.length < 70) {
portion += words.splice(0, 1) + ' ';
}
// let portion = text.slice(0, 100);
// text = text.slice(100);
drawText(portion, 55, y, 14);
y -= 20;
}
// drawText(reasons[raison - 1], 50, 300);
const url = await QRCode.toString(
`
Crée le : ${now.getFrenchFormat()} à ${localHour}
Nom: ${nom}
Prénom: ${prenom}
Naissance: ${datenaissance} à ${lieunaissance}
Adresse: ${adresse} ${codepostal} ${ville}
Sortie: ${now.getFrenchFormat()} à ${localHour}
Motifs: ${motifs[raison - 1]}
`,
{ type: "svg" }
);
const regexp = new RegExp(/<path stroke="#000000" d="(.*?)"/);
const svgPath = url.match(regexp);
page1.moveTo(430, 205);
page1.drawSvgPath(svgPath[1], { scale: 1.5 });
pdfDoc.addPage();
const page2 = pdfDoc.getPages()[1];
page2.moveTo(10, page2.getHeight() - 10);
page2.drawSvgPath(svgPath[1], { scale: 5 });
// drawSvgPath(url, {
// x: 580,
// y: 153,
// });
const pdfBytes = await pdfDoc.save();
return pdfBytes;
}
module.exports = router;
|
395beba94df4c45c7a785545436b63c06214e808
|
[
"JavaScript"
] | 1 |
JavaScript
|
michelvermeulen/covid-attestation-generateur
|
5e971d3bfd35d3c40d4ff1e464b7f60c067a4223
|
12c8d5749188f2b9174184b05a31941742be83a7
|
refs/heads/master
|
<repo_name>flipse/XoopsCore<file_sep>/htdocs/modules/logger/language/english/modinfo.php
<?php
/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
which is considered copyrighted (c) material of the original comment or credit authors.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
* @author trabis <<EMAIL>>
* @version $Id$
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
define('_MI_LOGGER_NAME', 'Logger');
define('_MI_LOGGER_DSC', 'Error reporting and performance analysis');
define('_MI_LOGGER_DEBUGMODE' , "Debug Mode");
define('_MI_LOGGER_DEBUGMODE0', "Off");
define('_MI_LOGGER_DEBUGMODE1', "Enable debug (inline mode)");
define('_MI_LOGGER_DEBUGMODE2', "Enable debug (popup mode)");
define('_MI_LOGGER_DEBUGMODE3', "Smarty Templates Debug");
define('_MI_LOGGER_DEBUGLEVEL' , "Debug Level");
define('_MI_LOGGER_DEBUGLEVEL0', "Anonymous");
define('_MI_LOGGER_DEBUGLEVEL1', "Registered Users");
define('_MI_LOGGER_DEBUGLEVEL2', "Administrators");
define('_MI_LOGGER_DEBUGPLUGIN' , "Debug Plugin");
define('_MI_LOGGER_DEBUGPLUGIN_LEGACY' , "Legacy");
define('_MI_LOGGER_DEBUGPLUGIN_PQP', "PHP Quick Profiler");
define('_MI_LOGGER_DEBUGPLUGIN_FIREPHP', "FirePHP");
|
f4fa976c6a4bb24fba9e1de8ec7770b774edd3db
|
[
"PHP"
] | 1 |
PHP
|
flipse/XoopsCore
|
b7625e2f549a9e3c58229a3024d289abc6bf9bd8
|
0df3d31e47dbbf17823fb0ed8906f03cbfaeebfc
|
refs/heads/master
|
<repo_name>songecko/lan-friends-day<file_sep>/src/Odiseo/LanBundle/Entity/User.php
<?php
namespace Odiseo\LanBundle\Entity;
use DateTime;
use FOS\UserBundle\Entity\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
/**
* User
*/
class User extends BaseUser
{
protected $id;
protected $twitter_id;
protected $twitter_access_token;
protected $twitter_profile_image_url;
protected $createdAt;
protected $updatedAt;
protected $twitters;
protected $fullName;
protected $dni;
protected $edad;
protected $telefono;
protected $provincia;
protected $mail;
protected $acceptNewsletter;
protected $profilePicture;
public function __construct()
{
parent::__construct();
$this->createdAt = new DateTime('now');
}
public function setTwitterId($twitterId)
{
$this->twitter_id = $twitterId;
return $this;
}
public function getTwitterId()
{
return $this->twitter_id;
}
public function setTwitterAccessToken($twitterAccessToken)
{
$this->twitter_access_token = $twitterAccessToken;
return $this;
}
public function getTwitterAccessToken()
{
return $this->twitter_access_token;
}
public function setTwitterProfileImageUrl($twitterProfileImageUrl)
{
$this->twitter_profile_image_url = $twitterProfileImageUrl;
return $this;
}
public function getTwitterProfileImageUrl()
{
return $this->twitter_profile_image_url;
}
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
public function getCreatedAt()
{
return $this->createdAt;
}
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function addTwitter(\Odiseo\LanBundle\Entity\TwitterUser $twitters)
{
$this->twitters[] = $twitters;
return $this;
}
public function removeTwitter(\Odiseo\LanBundle\Entity\TwitterUser $twitters)
{
$this->twitters->removeElement($twitters);
}
public function getTwitters()
{
return $this->twitters;
}
public function __toString()
{
return $this->getUsername();
}
public function getCanonicalName()
{
return $this->getFullName()?$this->getFullName():$this->getUsername();
}
public function isRegistered()
{
return $this->getDni()?true:false;
}
public function getFullName() {
return $this->fullName;
}
public function setFullName($fullName) {
$this->fullName = $fullName;
return $this;
}
public function getDni() {
return $this->dni;
}
public function setDni($dni) {
$this->dni = $dni;
return $this;
}
public function getEdad() {
return $this->edad;
}
public function setEdad($edad) {
$this->edad = $edad;
return $this;
}
public function getTelefono() {
return $this->telefono;
}
public function setTelefono($telefono) {
$this->telefono = $telefono;
return $this;
}
public function getProvincia() {
return $this->provincia;
}
public function setProvincia($provincia) {
$this->provincia = $provincia;
return $this;
}
public function getMail() {
return $this->mail;
}
public function setMail($mail) {
$this->mail = $mail;
return $this;
}
public function getAcceptNewsletter() {
return $this->acceptNewsletter;
}
public function setAcceptNewsletter($acceptNewsletter) {
$this->acceptNewsletter = $acceptNewsletter;
return $this;
}
}<file_sep>/src/Odiseo/LanBundle/Services/Frontend/TwitterCallsManager.php
<?php
namespace Odiseo\LanBundle\Services\Frontend;
use TwitterAPIExchange;
class TwitterCallsManager {
private $_consumer_key;
private $_consumer_key_secret;
public function __construct($consumer_key , $consumer_key_secret)
{
$this->_consumer_key = $consumer_key;
$this->_consumer_key_secret = $consumer_key_secret;
}
/**
* Updates the status in twitter of the user whose $oauth_access_token and $oauth_access_token_secret
* are passed as parameters.
*
* @param unknown $oauth_access_token
* @param unknown $oauth_access_token_secret
* @return unknown
*/
public function updateUserStatus($sToTweet , $oauth_access_token , $oauth_access_token_secret ){
$settings = array(
'oauth_access_token' => $oauth_access_token ,
'oauth_access_token_secret' => $oauth_access_token_secret,
'consumer_key' => $this->_consumer_key,
'consumer_secret' => $this->_consumer_key_secret
);
$url = 'https://api.twitter.com/1.1/statuses/update.json';
$requestMethod = 'POST';
$twitter = new TwitterAPIExchange($settings);
$res = $twitter->setPostfields(array('status' => $sToTweet))->buildOauth($url, $requestMethod) ->performRequest();
return $res;
}
/**
* Validate if the screen names are following to the user whose $oauth_access_token and $oauth_access_token_secret
* are passed as parameters.
* @param unknown $screen_name_users
* @return boolean true: valid , false: invalida
*/
public function isFollowingBy($aScreen_name_users, $oauth_access_token , $oauth_access_token_secret){
$sScreen_name_users = implode(",", $aScreen_name_users);
$settings = array(
'oauth_access_token' => $oauth_access_token ,
'oauth_access_token_secret' => $oauth_access_token_secret,
'consumer_key' => $this->_consumer_key,
'consumer_secret' => $this->_consumer_key_secret
);
$url = 'https://api.twitter.com/1.1/friendships/lookup.json';
$requestMethod = 'GET';
$twitter = new TwitterAPIExchange($settings);
$response = $twitter->setGetfield('?screen_name='.$sScreen_name_users)->buildOauth($url, $requestMethod)->performRequest();
$res = json_decode( $response );
foreach ( $res as $value ){
if ( !($value->connections[0] == 'followed_by') && !( isset( $value->connections[1] ) && $value->connections[1] == 'followed_by') ){
return false;
}
}
return true;
}
}
<file_sep>/src/Odiseo/LanBundle/Entity/Configuration.php
<?php
namespace Odiseo\LanBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Configuration
*/
class Configuration
{
private $id;
private $dateBegin;
private $dateEnd;
private $beginMailSended;
private $endMailSended;
public function getId()
{
return $this->id;
}
public function setDateBegin($dateBegin)
{
$this->dateBegin = $dateBegin;
return $this;
}
public function getDateBegin()
{
return $this->dateBegin;
}
public function setDateEnd($dateEnd)
{
$this->dateEnd = $dateEnd;
return $this;
}
public function getDateEnd()
{
return $this->dateEnd;
}
public function setBeginMailSended($beginMailSended)
{
$this->beginMailSended = $beginMailSended;
return $this;
}
public function getBeginMailSended()
{
return $this->beginMailSended;
}
public function setEndMailSended($endMailSended)
{
$this->endMailSended = $endMailSended;
return $this;
}
public function getEndMailSended()
{
return $this->endMailSended;
}
public function isCampaignActive()
{
return (
(strtotime("now") > $this->getDateBegin()->format('U')) &&
(strtotime("now") < $this->getDateEnd()->format('U'))
);
}
public function isCampaignFinished()
{
return (strtotime("now") > $this->getDateEnd()->format('U'));
}
}
<file_sep>/src/Odiseo/LanBundle/Menu/BackendMenuBuilder.php
<?php
namespace Odiseo\LanBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\SecurityContextInterface;
class BackendMenuBuilder
{
private $factory;
protected $securityContext;
/**
* @param FactoryInterface $factory
*/
public function __construct(FactoryInterface $factory, SecurityContextInterface $securityContext)
{
$this->factory = $factory;
$this->securityContext = $securityContext;
}
public function createMainMenu(Request $request)
{
$menu = $this->factory->createItem('root', array(
'childrenAttributes' => array(
'class' => 'sidebar-menu'
)
));
$menu->addChild('dashboard', array(
'route' => 'odiseo_lan_backend_dashboard',
'labelAttributes' => array('icon' => 'fa-dashboard'),
))->setLabel("Dashboard");
$menu->addChild('user', array(
'route' => 'odiseo_lan_user_index',
'labelAttributes' => array('icon' => 'fa-user'),
))->setLabel("Usuarios");
$menu->addChild('twitteruser', array(
'route' => 'odiseo_lan_twitteruser_index',
'labelAttributes' => array('icon' => 'fa-twitter'),
))->setLabel("Tweets");
$menu->addChild('configuration', array(
'route' => 'odiseo_lan_configuration_index',
'labelAttributes' => array('icon' => 'fa-wrench'),
))->setLabel("Configuracion");
return $menu;
}
}<file_sep>/src/Odiseo/LanBundle/DataFixtures/ORM/LoadConfigurationData.php
<?php
namespace Odiseo\LanBundle\DataFixtures\ORM;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\Finder\Finder;
use Odiseo\LanBundle\Entity\Configuration;
class LoadConfigurationData extends DataFixture
{
public function load(ObjectManager $manager)
{
/** CONFIGURATION **/
$configuration = new Configuration();
$configuration->setDateBegin(new \DateTime('now + 3 days'));
$configuration->setDateEnd(new \DateTime('now + 5 days'));
$configuration->setBeginMailSended(false);
$configuration->setEndMailSended(false);
$manager->persist($configuration);
$manager->flush();
}
public function getOrder()
{
return 3;
}
}
<file_sep>/src/Odiseo/LanBundle/Mailer/SendMailer.php
<?php
namespace Odiseo\LanBundle\Mailer;
use Symfony\Component\DependencyInjection\ContainerInterface as Container;
use Odiseo\LanBundle\Entity\User as User;
class SendMailer
{
private $message;
private $container;
public function __construct(Container $container){
$this->message = \Swift_Message::newInstance();
$this->container = $container;
}
public function sendRegisterMail(User $user)
{
$fullname = $user->getFullName();
$email = $user->getMail();
$view = 'OdiseoLanBundle:Frontend/Mailer:registerEmail.html.twig';
$message = $this->getMessage($view, $email)
->setSubject($fullname.', ya estás registrado en la app del Mes del Amigo LAN!');
$failures = $this->send($message);
return $failures;
}
public function sendBeginMail(User $user)
{
$fullname = $user->getFullName();
$email = $user->getMail();
$view = 'OdiseoLanBundle:Frontend/Mailer:beginEmail.html.twig';
$message = $this->getMessage($view, $email)
->setSubject($fullname.', ya ha comenzado la promoción!');
$failures = $this->send($message);
return $failures;
}
public function sendEndMail(User $user)
{
$fullname = $user->getFullName();
$email = $user->getMail();
$view = 'OdiseoLanBundle:Frontend/Mailer:endEmail.html.twig';
$message = $this->getMessage($view, $email)
->setSubject($fullname.', ya ha finalizado la promoción!');
$failures = $this->send($message);
return $failures;
}
public function sendRemainderMail(User $user)
{
$fullname = $user->getFullName();
$email = $user->getMail();
$view = 'OdiseoLanBundle:Frontend/Mailer:remainderEmail.html.twig';
$message = $this->getMessage($view, $email)
->setSubject('¡A las 16hs finaliza! Queda poco tiempo para subirte al avión.');
$failures = $this->send($message);
return $failures;
}
protected function send($message)
{
$failures = array();
$mailer = $this->container->get('mailer');
$mailer->send($message, $failures);
// manually flush the queue (because using spool)
$spool = $mailer->getTransport()->getSpool();
$transport = $this->container->get('swiftmailer.transport.real');
$spool->flushQueue($transport);
return $failures;
}
private function getMessage($view, $emailTo)
{
return $this->message
->setSubject('Amigos Lan')
->setFrom(array('<EMAIL>' => 'Amigos Lan'))
->setTo($emailTo)
->setBody(
$this->container->get('templating')->render($view),
'text/html'
);
}
}<file_sep>/src/Odiseo/LanBundle/Form/Type/UserType.php
<?php
namespace Odiseo\LanBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class UserType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('username', 'text', array(
'required' => true,
'label' => 'Nombre Usuario'
))
->add('email', 'text', array(
'required' => true,
'label' => 'Email'
))
->add('plainPassword', 'password', array(
'required' => true,
'label' => 'Password'
))
->add('firstName', 'text', array(
'required' => true,
'label' => 'Nombre'
))
->add('lastName', 'text', array(
'required' => true,
'label' => 'Apellido'
));
}
public function getName()
{
return 'lan_user';
}
}
<file_sep>/src/Odiseo/LanBundle/Repository/UserRepository.php
<?php
namespace Odiseo\LanBundle\Repository;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
class UserRepository extends EntityRepository
{
public function createPaginator(array $criteria = null, array $orderBy = null)
{
$queryBuilder = $this->getCollectionQueryBuilder();
$queryBuilder->leftJoin($this->getAlias().'.twitters', 't');
$queryBuilder->orderBy('t.createdAt','DESC');
$this->applyCriteria($queryBuilder, $criteria);
$this->applySorting($queryBuilder, $orderBy);
return $this->getPaginator($queryBuilder);
}
public function lastUserWhoTweets(){
$queryBuilder = $this->createQueryBuilder($this->getAlias());
$queryBuilder->select($this->getAlias().', MAX(t.createdAt) AS max_date');
$queryBuilder->leftJoin($this->getAlias().'.twitters', 't');
$queryBuilder->andWhere($this->getAlias().'.dni IS NOT NULL');
$queryBuilder->groupBy('t.user');
$queryBuilder->orderBy('max_date','DESC');
$queryBuilder->setMaxResults(19);
return $queryBuilder->getQuery()->getResult();
}
public function getRegisteredUsers()
{
$queryBuilder = $this->getCollectionQueryBuilder();
$queryBuilder->where($this->getAlias().'.dni IS NOT NULl');
return $queryBuilder->getQuery()->getResult();
}
}<file_sep>/src/Odiseo/LanBundle/DataFixtures/ORM/DataFixture.php
<?php
namespace Odiseo\LanBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Faker\Factory as FakerFactory;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Base data fixture.
*/
abstract class DataFixture extends AbstractFixture implements ContainerAwareInterface, OrderedFixtureInterface
{
/**
* Container.
*
* @var ContainerInterface
*/
protected $container;
/**
* Faker.
*
* @var Generator
*/
protected $faker;
/**
* Constructor.
*/
public function __construct()
{
$this->faker = FakerFactory::create();
}
/**
* {@inheritdoc}
*/
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
public function __call($method, $arguments)
{
$matches = array();
if (preg_match('/^get(.*)Repository$/', $method, $matches)) {
return $this->get('sylius.repository.'.$matches[1]);
}
return call_user_func_array(array($this, $method), $arguments);
}
/**
* Get service by id.
*
* @param string $id
*
* @return object
*/
protected function get($id)
{
return $this->container->get($id);
}
}
<file_sep>/src/Odiseo/LanBundle/Controller/Frontend/FlightController.php
<?php
namespace Odiseo\LanBundle\Controller\Frontend;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Odiseo\LanBundle\Entity\User;
use Symfony\Component\HttpFoundation\JsonResponse;
use Odiseo\LanBundle\Utils\TweetParser;
use Odiseo\LanBundle\Entity\TwitterUser;
class FlightController extends Controller
{
public function showPassengersAction(Request $request)
{
//Get seats
$repository = $this->get('lan.repository.user');
$userRecords = $repository->lastUserWhoTweets();
$seats = array();
foreach ($userRecords as $record)
{
if(is_array($record) && isset($record[0]))
$record = $record[0];
if($record instanceof User)
{
$seatData = array('urlImage' => $record->getTwitterProfileImageUrl(), 'twitterName' => $record->getUsername() );
$seats[] = $seatData;
}
}
//Get tweets list
$repository = $this->get('lan.repository.twitteruser');
$max_size_result = $this->container->getParameter('max_size_result_twitter');
$userTwitterRecords = $repository->findLastTweets($max_size_result);
$listTweets = array();
foreach ($userTwitterRecords as &$record) {
$tweets = array('imageUrl' => $record->getUser()->getTwitterProfileImageUrl(),
'tweet' => $record->getTwitter() ,
'screenName' => $record->getUser()->getUsername(),
'timeAgo' => $record->getCreatedAt());
$listTweets[] = $tweets;
}
$data = array('seats' => $seats, 'tweets' => $listTweets);
return new JsonResponse($data);
}
}
<file_sep>/src/Gecko/BackendBundle/Resources/assets/js/backend.js
/*
* This file is part of the Sylius package.
*
* (c) <NAME>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
(function ( $ ) {
'use strict';
$(document).ready(function() {
$('.variant-table-toggle .icon').toggle(function() {
$(this).removeClass('icon-chevron-down').addClass('icon-chevron-up');
$(this).parent().parent().find('.table tbody').show();
}, function() {
$(this).addClass('icon-chevron-down').removeClass('icon-chevron-up');
$(this).parent().parent().find('.table tbody').hide();
});
//$('select').select2();
});
})( jQuery );
<file_sep>/src/Odiseo/LanBundle/Controller/Backend/MainController.php
<?php
namespace Odiseo\LanBundle\Controller\Backend;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class MainController extends Controller
{
public function dashboardAction()
{
return $this->render('OdiseoLanBundle:Backend/Main:dashboard.html.twig');
}
}
<file_sep>/src/Odiseo/LanBundle/Form/Type/ConfigurationType.php
<?php
namespace Odiseo\LanBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class ConfigurationType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('dateBegin', 'datetime', array(
'label' => 'Fecha Inicio',
'required' => false
))
->add('dateEnd', 'datetime', array(
'label' => 'Fecha Fin',
'required' => false
))
->add('beginMailSended', 'checkbox', array(
'label' => 'Inició envio de mail?',
'required' => false
))
->add('endMailSended', 'checkbox', array(
'label' => 'Finalizó envio de mail?',
'required' => false
));
}
public function getName()
{
return 'lan_configuration';
}
}
<file_sep>/src/Odiseo/LanBundle/DataFixtures/ORM/LoadTwittersData.php
<?php
namespace Odiseo\LanBundle\DataFixtures\ORM;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Odiseo\LanBundle\Entity\User;
use Odiseo\LanBundle\Entity\TwitterUser;
class LoadTwittersData extends DataFixture
{
public function load(ObjectManager $manager)
{
/** USERS **/
/*$user = $manager->getRepository('OdiseoLanBundle:User')->findOneByUsername('user');
/** TWITTERS **/
/*$twitter = new TwitterUser();
$twitter->setUser($user);
$twitter->setTwitter($this->faker->text);
$manager->persist($twitter);
$manager->flush();*/
}
public function getOrder()
{
return 2;
}
}
<file_sep>/src/Odiseo/LanBundle/Command/MailCommand.php
<?php
namespace Odiseo\LanBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class MailCommand extends ContainerAwareCommand
{
protected function configure()
{
$this
->setName('send:mail')
->setDescription('Send Mail')
->addOption('remainder', null, InputOption::VALUE_NONE, 'If set, only will send the remainder email to all users.')
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$configuration = null;
$dm = $this->getContainer()->get('doctrine')->getManager();
//get the current configuration
$configurations = $this->getContainer()->get('lan.repository.configuration')->findAll();
if(isset($configurations[0]))
$configuration = $configurations[0];
if(!$configuration)
{
$output->writeln($this->getFormatedMessage("Unable to get the configuration object"));
return;
}
$beginMailSended = $configuration->getBeginMailSended();
$endMailSended = $configuration->getEndMailSended();
if ($input->getOption('remainder')) {
$output->writeln($this->getFormatedMessage("Send REMAINDER email to all users."));
$output->writeln($this->sendRemainderEmail());
}else
{
//If the campaign is active and the begin email never sended
if($configuration->isCampaignActive() && $beginMailSended == false)
{
//Send the begin email to all users
$output->writeln($this->getFormatedMessage("Send BEGIN email to all users."));
$output->writeln($this->sendEmail(true));
//Save the configuration
$configuration->setBeginMailSended(true);
$configuration->setEndMailSended(false);
$dm->flush();
}
//If the campaign is finished and the end email never sended
else if ($configuration->isCampaignFinished() && $endMailSended == false)
{
//Send the end email to all users
$output->writeln($this->getFormatedMessage("Send END email to all users."));
$output->writeln($this->sendEmail(false));
//Save the configuration
$configuration->setEndMailSended(true);
$configuration->setBeginMailSended(false);
$dm->flush();
}else {
//Nothing to do
$output->writeln($this->getFormatedMessage("Nothing to do"));
}
}
}
public function sendRemainderEmail()
{
$sendMailer = $this->getContainer()->get('lan.send.mailer');
$userRepository = $this->getContainer()->get('lan.repository.user');
$registeredUsers = $userRepository->getRegisteredUsers();
$total = count($registeredUsers);
$sended = 0;
$returnString = "";
foreach ($registeredUsers as $user)
{
$failures = $sendMailer->sendRemainderMail($user);
if(count($failures) > 0)
{
foreach ($failures as $failureEmail)
{
$returnString .= "- failed to -> ".$failureEmail."\n";
}
}else
{
$sended++;
}
}
$returnString .= "Sended ".$sended."/".$total." emails.";
return $returnString;
}
public function sendEmail($isBeginEmail)
{
$sendMailer = $this->getContainer()->get('lan.send.mailer');
$userRepository = $this->getContainer()->get('lan.repository.user');
$registeredUsers = $userRepository->getRegisteredUsers();
$total = count($registeredUsers);
$sended = 0;
$returnString = "";
foreach ($registeredUsers as $user)
{
$failures = array();
if($isBeginEmail)
{
$failures = $sendMailer->sendBeginMail($user);
}else
{
$failures = $sendMailer->sendEndMail($user);
}
if(count($failures) > 0)
{
foreach ($failures as $failureEmail)
{
$returnString .= "- failed to -> ".$failureEmail."\n";
}
}else
{
$sended++;
}
}
$returnString .= "Sended ".$sended."/".$total." emails.";
return $returnString;
}
protected function getFormatedMessage($message)
{
$currentDate = date('d/m/Y H:i:s', time());
return "[".$currentDate."]> ".$message;
}
}<file_sep>/src/Odiseo/LanBundle/Utils/TweetParser.php
<?php
namespace Odiseo\LanBundle\Utils;
class TweetParser {
private static $initialized = false;
private function __construct() {}
private static function initialize()
{
if (self::$initialized)
return;
self::$initialized = true;
}
/**
* @param string $sTweet -> phrase to tweet.
* @return array of mentioned friend -> prefixed with @ in function parameter
*/
public static function getMentionedFriends($sTweet){
self::initialize();
$matches = array();
preg_match_all("/@([a-z0-9_]+)/i",$sTweet,$matches);
return $matches[1];
}
/**
* @param string $sTweet
* @return array of mentiones hastags -> prefixed by # in function parameter
*/
public static function getMentionedHashTags($sTweet)
{
self::initialize();
$matches = array();
preg_match_all("/#([a-z0-9_]+)/i",$sTweet,$matches);
return $matches[1];
}
/**
* Tell you if $sHashTag is in $sTweet post.
* @param unknown $sTweet
* @param unknown $sHashTag
* @return boolean
*/
public static function existHashTag($sTweet , $sHashTag){
self::initialize();
$hashTags = self::getMentionedHashTags($sTweet);
foreach ($hashTags as &$value) {
if ($value == $sHashTag)
return true;
}
return false;
}
/**
* Tell you if the number of mentioned friends in $sTweet is equal to $quantity.
* @param unknown $sTweet
* @param unknown $quantity
* @return boolean
*/
public static function mentionedFriendsEqualTo($sTweet , $quantity){
self::initialize();
$mentionatedFriends = self::getMentionedFriends($sTweet);
return (count($mentionatedFriends) == $quantity);
}
}
<file_sep>/src/Odiseo/LanBundle/Repository/TwitterUserRepository.php
<?php
namespace Odiseo\LanBundle\Repository;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
class TwitterUserRepository extends EntityRepository
{
/**
* return an array with a number of 'max_size_Result' TwitterUser records.
* @param unknown $maxSizeResult
* @return array
*/
public function findLastTweets( $maxSizeResult ){
$queryBuilder = $this->getCollectionQueryBuilder();
$queryBuilder->leftJoin($this->getAlias().'.user', 'u');
$queryBuilder->orderBy($this->getAlias().'.createdAt','DESC');
$queryBuilder->setMaxResults($maxSizeResult);
return $queryBuilder->getQuery()->getResult();
}
}<file_sep>/README.md
lan-friends-day
===============
<file_sep>/src/Odiseo/LanBundle/Form/Type/TwitterUserType.php
<?php
namespace Odiseo\LanBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class TwitterUserType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('user', 'entity', array(
'class' => 'OdiseoLanBundle:User',
'label' => 'Usuario'
))
->add('twitter', 'textarea', array(
'required' => true,
'label' => 'Twitter'
));
}
public function getName()
{
return 'lan_twitteruser';
}
}
<file_sep>/src/Odiseo/LanBundle/Controller/Frontend/MainController.php
<?php
namespace Odiseo\LanBundle\Controller\Frontend;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Odiseo\LanBundle\Entity\User;
use Symfony\Component\HttpFoundation\JsonResponse;
use Odiseo\LanBundle\Utils\TweetParser;
use Odiseo\LanBundle\Entity\TwitterUser;
use Symfony\Component\HttpFoundation\Response;
class MainController extends Controller
{
protected $configuration = null;
public function indexAction(Request $request)
{
$configuration = $this->getConfiguration();
//Go to end of campaign?
if($configuration->isCampaignFinished())
{
return $this->redirect($this->generateUrl('lan_thanks'));
}else //else
{
if($this->_haveToGoToIndex())
{
return $this->render('OdiseoLanBundle:Frontend/Main:index.html.twig');
}else
{
return $this->redirect($this->generateUrl('lan_plane'));
}
}
}
public function thanksAction()
{
$configuration = $this->getConfiguration();
if(!$configuration->isCampaignFinished())
{
return $this->redirect($this->generateUrl('odiseo_lan_frontend_homepage'));
}
return $this->render('OdiseoLanBundle:Frontend/Main:thanks.html.twig');
}
public function internoAction()
{
return $this->render('OdiseoLanBundle:Frontend/Main:interno.html.twig');
}
public function countdownAction()
{
$configuration = $this->getConfiguration();
$user = $this->getUser();
if( $configuration->isCampaignFinished() || ( $configuration->isCampaignActive() && (!$user || !$user->isRegistered())))
{
return new Response();
}else
{
return $this->render('OdiseoLanBundle:Frontend/Main:countdown.html.twig', array('configuration' => $configuration));
}
}
public function avionAction()
{
return $this->_haveToGoToIndex() ? $this->redirect($this->generateUrl('odiseo_lan_frontend_homepage')) : $this->render('OdiseoLanBundle:Frontend/Main:avion.html.twig') ;
}
protected function getConfiguration()
{
if(!$this->configuration)
{
$configurations = $this->get('lan.repository.configuration')->findAll();
if(isset($configurations[0]))
$this->configuration = $configurations[0];
}
return $this->configuration;
}
private function _haveToGoToIndex()
{
$configuration = $this->getConfiguration();
$user = $this->getUser();
if ( $user == null || !$user->isRegistered() || !$configuration || !$configuration->isCampaignActive()){
return true;
}
return false;
}
public function renderContentAction(Request $request) {
$user = $this->getUser();
if ($user == null)
{
return $this->render('OdiseoLanBundle:Frontend/Main:participate.html.twig');
} else
{
$userRecord = $this->retrieveUserFromDb($user->getTwitterId());
if ($userRecord->getDni() == null)
{
return $this->render ( 'OdiseoLanBundle:Frontend/Main:registerForm.html.twig',
array ( 'fullName' => $userRecord->getFullName(),
'dni' => $userRecord->getDni(),
'edad' => $userRecord->getEdad(),
'telefono' => $userRecord->getTelefono(),
'nacionalidad' =>$userRecord->getNacionalidad(),
'email' => $userRecord->getMail() ) );
}
else
{
return $this->render ( 'OdiseoLanBundle:Frontend/Main:registerForm.html.twig');
}
}
}
public function registerAction(Request $request)
{
$register = $request->get('register');
$user = $this->getUser();
$this->setUserProperties($user, $register);
$validator = $this->get('validator');
$errors = $validator->validate($user);
if (count($errors) > 0)
{
$errorsMessages = array();
foreach ($errors as $error)
{
array_push($errorsMessages, $error->getMessage());
}
//$data = ['onError' => 'true', 'errors' => $errorsMessages];
//return new JsonResponse($data);
return $this->redirect($this->generateUrl('odiseo_lan_frontend_homepage'));
}
$this->getDoctrine()->getManager()->flush();
$this->get('lan.send.mailer')->sendRegisterMail($user);
//$data = ['onError' => 'false', 'message' => 'Gracias por participar!!'];
//return new JsonResponse($data);
return $this->redirect($this->generateUrl('odiseo_lan_frontend_homepage'));
}
public function sendTweetAction(Request $request)
{
if ( $this->_haveToGoToIndex() ){
$data = array('onError' => 'true', 'errors' => 'Ocurrió un error, intenta luego.');
return new JsonResponse($data);
}
$callsManager = $this->get('lan.services.twittercallsmanager');
$formData = $request->get ( 'form_data' );
if ($formData != null ){
$sToTweet = $formData['tweet'];
if ($sToTweet != null)
{
$error = $this->_validateRulesForTweet($sToTweet);
if ( $error == null)
{
$this->_saveTwitterUser( $sToTweet);
$tweets = json_decode($callsManager->updateUserStatus($sToTweet, $_SESSION['twitter_access_token'], $_SESSION['twitter_token_secret']));
if ( isset($tweets->errors))
{
$data = array('onError' => 'true', 'errors' => '¡Tenés que hacer mensajes distintos!');
return new JsonResponse($data);
}
//grabar tweet en la base de datos.
$data = array('onError' => 'false', 'message' => 'Gracias por participar!');
return new JsonResponse($data);
}
else{
$data = array('onError' => 'true', 'errors' => $error);
return new JsonResponse($data);
}
}
else
{
$data = array('onError' => 'true', 'errors' => 'Tu tweet no puede estar vacio.');
return new JsonResponse($data);
}
}
else
{
return $this->render('OdiseoLanBundle:Frontend/Main:send_tweet.html.twig');
}
}
/**
* to be valid: 3 friends mentioned and existing, and "AmigosLan" as hashTag
* @param unknown $sToTweet
* @return boolean
*/
private function _validateRulesForTweet($sToTweet)
{
if( strlen($sToTweet) <= 140 )
{
if (TweetParser::existHashTag($sToTweet, "AmigosLan"))
{
$friends = TweetParser::getMentionedFriends($sToTweet);
if (count($friends) == 3 )
{
if ( $this->_areDifferents($friends) ){
return null;
}
else{
return 'Debes citar 3 amigos diferentes.';
}
}
else return 'Debes citar 3 amigos diferentes.';
}
else return 'Debe citar el hashtag "#AmigosLan". ';
}
else return 'El tweet no puede superar los 140 caracteres. ';
}
private function _areDifferents($friends){
return ( ($friends[0] != $friends[1] ) && ($friends[0] != $friends[2] ) &&
($friends[1] != $friends[2] ) );
}
private function retrieveUserFromDb($twitterId)
{
$em = $this->getDoctrine()->getManager ();
$repository = $em->getRepository('OdiseoLanBundle:User');
$userRecord = $repository->findOneBy(array('twitter_id' => $twitterId));
return $userRecord;
}
private function setUserProperties($userRecord , $register)
{
$userRecord->setFullName($register['fullname']);
$userRecord->setDni($register['dni']);
$userRecord->setEdad($register['edad']);
$userRecord->setTelefono($register['telefono']);
$userRecord->setProvincia($register['provincia']);
$userRecord->setMail($register['mail']);
$userRecord->setAcceptNewsletter(isset($register['accept_newsletter'])?true:false);
}
private function _saveTwitterUser( $sToTweet){
$user = $this->getUser();
$em = $this->getDoctrine()->getManager ();
$twitterUser = new TwitterUser();
$twitterUser->setUser($user);
$twitterUser->setTwitter($sToTweet);
$em->persist($twitterUser);
$em->flush();
}
}
<file_sep>/src/Odiseo/LanBundle/DataFixtures/ORM/LoadUserData.php
<?php
namespace Odiseo\LanBundle\DataFixtures\ORM;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\Finder\Finder;
use Odiseo\LanBundle\Entity\User;
class LoadUserData extends DataFixture
{
public function load(ObjectManager $manager)
{
/** USERS **/
$userAdmin = new User();
$userAdmin->setUsername('admin');
$userAdmin->setEmail('<EMAIL>');
$userAdmin->setPlainPassword('<PASSWORD>');
$userAdmin->setEnabled(true);
$userAdmin->setRoles(array('ROLE_ADMIN'));
$manager->persist($userAdmin);
/*$userTwitter = new User();
$userTwitter->setUsername('user');
$userTwitter->setEmail('<EMAIL>');
$userTwitter->setPlainPassword('<PASSWORD>');
$userTwitter->setEnabled(true);
$userTwitter->setRoles(array('ROLE_USER'));
$manager->persist($userTwitter);*/
$manager->flush();
}
public function getOrder()
{
return 1;
}
}
<file_sep>/src/Odiseo/LanBundle/Entity/TwitterUser.php
<?php
namespace Odiseo\LanBundle\Entity;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
/**
* TwitterUser
*/
class TwitterUser
{
private $id;
private $twitter;
private $createdAt;
private $updatedAt;
private $user;
public function __construct()
{
$this->createdAt = new DateTime('now');
}
public function getId()
{
return $this->id;
}
public function setTwitter($twitter)
{
$this->twitter = $twitter;
return $this;
}
public function getTwitter()
{
return $this->twitter;
}
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
public function getCreatedAt()
{
return $this->createdAt;
}
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function setUser(\Odiseo\LanBundle\Entity\User $user = null)
{
$this->user = $user;
return $this;
}
public function getUser()
{
return $this->user;
}
}
|
2da0c8b77181dedea4fa61a99ac3c153c31e8236
|
[
"JavaScript",
"Markdown",
"PHP"
] | 22 |
PHP
|
songecko/lan-friends-day
|
0d3900123b36fd4d05cdf7623d1e9174d5e753f4
|
5a24af750709907aef922aaf26741876672c5abe
|
refs/heads/master
|
<repo_name>Den4i/CryptoExchanger<file_sep>/src/components/Partners/Partners.js
import React from 'react';
import {Link} from 'react-router-dom';
const Partners = () => {
return (
<div><h3>Партнерам</h3>
<p>Системы сотрудничества прозрачны и понятны. Если возникнут какие-то вопросы, то напишите нам в чат или на электронную почту.</p>
<h5>Система вознаграждения:</h5>
<p>Совершили обменную операцию на сайте www.CryptoExchanger.cc? Получите вознаграждение! Хотите получить скидку в 5% прямо сейчас? Просто
зарегистрируйтесь на нашем сайте www.CryptoExchanger.cc.</p>
Система скидок:
<ul>
<li>5% - за обмен от 0 до 1000 $ </li>
<li> 10% - от 1000 до 10 000 $ </li>
<li>15% - от 10 000 и выше </li>
</ul>
<p>Процент Вы получаете от прибыли сервиса с каждого Вашего обмена. Пожалуйста, примите во внимание и понимание. Процент вознаграждения
рассчитывается от прибыли сервиса по каждому доступному направлению обмена, по некоторым направлениям обмена комиссия сервиса может быть 0%,
может быть меньше 0% (то есть комиссия отсутствует) или сервис не получает выгоду от обмена, значит сервис с этого обмена не имеет прибыли,
в этих ситуациях вознаграждение не начисляется.</p>
<h5>Реферальная система</h5>
<p>Зарабатывать с www.CryptoExchanger.cc – просто:) Схема элементарная. Вы пригласили человека по своей реферальной ссылке на наш сайт. Он
произвел обмен. Вы получили прибыль. Итог: И он заработал и Вы заработали.</p>
Первая часть - это начисления реферальных за обмен Ваших рефералов по следующей системе:
<ul>
<li> 0,5 % от суммы обмена – после регистрации на сайте </li>
<li> 0,8 % от суммы обмена+ подарок - за 10 приглашенных рефералов </li>
<li> 0,9 % от суммы обмена+ подарок - за 100 рефералов </li>
<li> 1 % от суммы обмена+ подарок - за 300 рефералов </li>
</ul>
Вторая часть - это чудесные, царские подарки, которыми мы порадуем Вас. Нужно всего лишь пригласить парочку рефералов. Реферал - человек,
который зарегистрировался по специальной ссылке и совершил обмены на сумму более 100 долларов.
<ul>
<li> За 10 приглашенных - фирменный подарок </li>
<li> За 30 - переносной жесткий диск </li>
<li> За 50 - Ipod </li>
<li> За 100 - Go Pro </li>
<li> За 250 - Ipnone 5s </li>
<li> За 500 - Macbook Air </li>
</ul>
Если Вас не устраивает подарок по тем или иным причинам, напишите нам - обсудим;)
<p>Пожалуйста примите во внимание и понимание. Процент начисления реферальных рассчитывается от прибыли сервиса по каждому конкретному
направлению обмена, по некотором направлениям обмена комиссия сервиса может быть 0%, меньше 0 (то есть комиссия отсутствует) или сервис не
получает выгоду от обмена, значит сервис с этого обмена не имеет прибыли, в этих ситуациях реферальные пригласителю не начисляются.</p>
<h5>Мониторингам</h5>
<p>Будем искреннее рады сотрудничеству с мониторингами обменников. Для всех мониторингов единая реферальная система в 0.5%! от суммы обмена
Ваших рефералов. Минимальных ограничений на вывод реферальных нет! Реферальные можно вывести на любую из представленных нашим сервисом ПС.
Все заявки обрабатываются в течении 5- 10минут. Вам нужно лишь зарегистрироваться на нашем сайте. Пароль для входа в ЛК придет на Вашу
электронную почту. Успехов! <br/>
Экспорт курсов находится <a href={'http://www.CryptoExchanger.cc/poloniex'}>здесь</a></p>
<button className={"btn btn-info"}><Link to={'/registration'} className={'btn btn-link'}>Зарегистрироваться как партнер</Link></button>
</div>
)
};
export default Partners;<file_sep>/package.json
{
"name": "cryptoexchanger",
"version": "1.0.1",
"main": "index.js",
"scripts": {
"build": "set NODE_ENV='production' && webpack -p",
"dev": "webpack-dev-server --debug --hot --devtool eval-source-map --output-pathinfo --watch --colors --inline --content-base public --port 8050 --host 0.0.0.0",
"test": "nodemon --exec \"mocha --require babel-core/register --require ./test/test_helper.js --require isomorphic-fetch --recursive ./test\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/Den4i/CryptoExchanger.git"
},
"author": "<NAME>",
"license": "ISC",
"bugs": {
"url": "https://github.com/Den4i/CryptoExchanger/issues"
},
"homepage": "https://github.com/Den4i/CryptoExchanger#readme",
"devDependencies": {
"babel-loader": "^7.1.2",
"babel-plugin-transform-runtime": "^6.23.0",
"chai": "^4.1.2",
"chai-enzyme": "^1.0.0-beta.0",
"clean-webpack-plugin": "^0.1.17",
"css-loader": "^0.28.9",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"eslint": "^4.17.0",
"eslint-config-google": "^0.9.1",
"eslint-plugin-react": "^7.6.1",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^1.1.6",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^2.28.0",
"json-loader": "^0.5.7",
"less": "^2.7.3",
"less-loader": "^4.0.5",
"mocha": "^5.0.2",
"react-hot-loader": "^3.1.3",
"style-loader": "^0.19.1",
"url-loader": "^0.6.2",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.11.2"
},
"dependencies": {
"babel-core": "^6.26.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"bluebird": "^3.5.1",
"history": "^4.7.2",
"prop-types": "^15.6.0",
"react": "^16.2.0",
"react-bootstrap": "^0.32.1",
"react-dom": "^16.2.0",
"react-redux": "^5.0.7",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-router-redux": "^5.0.0-alpha.9",
"react-scripts": "1.0.17",
"redux": "^3.0.4"
},
"babel": {
"plugins": [
[
"transform-runtime",
{
"polyfill": false,
"regenerator": true
}
]
],
"presets": [
"env",
"react",
"stage-0"
]
},
"directories": {
"test": "test"
},
"description": "CryptoExchanger using Flask, React, Redux and Poloniex Api"
}
<file_sep>/test/components/contacts_test.js
import { React, expect, shallow } from '../test_helper';
import Contacts from '../../src/components/Contacts/Contacts';
describe ('Contacts', () => {
let component;
beforeEach(() => {
component = shallow(<Contacts />);
});
it ('renders Contacts', () => {
expect(component).to.exist;
});
it('has contactsInfo div ', () => {
expect(component.find('.contactsInfo').length).to.equal(1);
});
it('has 2 columns ', () => {
expect(component.find('.contactsInfo_columns').length).to.equal(2);
});
});<file_sep>/test/components/app_test.js
import { React, expect, shallow } from '../test_helper';
import { App, LeftInput, ResultInput, PoloniexTicket, Course } from '../../src/components/App/App';
describe('App' , () => {
let component;
beforeEach(() => {
component = shallow(<App />);
});
it('renders Application', () => {
expect(component).to.exist;
});
it('has a LeftInput', () => {
expect(component.find(LeftInput)).to.have.length(1);
});
it('has ResultInput', () => {
expect(component.find(ResultInput)).to.have.length(1);
});
it('has two PoloniexTicket', () => {
expect(component.find(PoloniexTicket)).to.have.length(2);
});
it('has Course', () => {
expect(component.find(Course)).to.have.length(1);
});
});
<file_sep>/test/test_helper.js
import React from 'react';
import chai, { expect } from 'chai';
import chaiEnzyme from 'chai-enzyme';
import { shallow, configure } from 'enzyme';
chai.use(chaiEnzyme());
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter() });
export {React, expect, shallow};
<file_sep>/src/client.js
import React from 'react';
import ReactDOM from 'react-dom';
import Navigation from './components/Navigation/Navigation';
import {Provider} from 'react-redux';
import {createStore, applyMiddleware} from 'redux';
import thunk from 'redux-thunk';
import reduce from './store/reducer';
import './bootstrap.css';
import './styles.css';
const store = createStore(reduce, applyMiddleware(thunk));
ReactDOM.render(
<Provider store={store}>
<Navigation />
</Provider>,
document.getElementById('root')
);
<file_sep>/src/components/Registration/Registration.js
import React from 'react';
const Registration = () => {
return (
<div className={"form-group col-4"}>
<div><input id={'name'} placeholder={'<NAME>'} className={"form-control"}/></div>
<div><input id={'email'} placeholder={'<NAME>'} type="email" className={"form-control"} /></div>
<div><button className="btn btn-success">Регистрация</button></div>
</div>
)
};
export default Registration;<file_sep>/src/store/actionTypes.js
export const DATA_FETCHED = 'DATA_FETCHED';
export const GET_CURRENT_LEFT = 'GET_CURRENT_LEFT';
export const GET_CURRENT_RIGHT = 'GET_CURRENT_RIGHT';
export const GET_LAST_CURRENCY = 'GET_LAST_CURRENCY';
export const SET_COUNT = 'SET_COUNT';
export const GET_TOTAL_COST = 'GET_TOTAL_COST';
<file_sep>/src/components/Navigation/Navigation.js
import React from 'react';
import {Route, Switch, BrowserRouter} from 'react-router-dom';
import App from '../App/App';
import ExchangeRules from '../ExchangeRules/ExchangeRules';
import NotFound from '../NotFound/NotFound';
import Partners from '../Partners/Partners';
import News from '../News/News';
import NewsList from '../NewsList/NewsList';
import Contacts from '../Contacts/Contacts';
import FAQ from '../FAQ/FAQ';
import Question from '../Question/Question';
import Registration from '../Registration/Registration';
import Nav from '../Nav/Nav';
const Navigation = () => {
return (
<BrowserRouter>
<div>
<Nav/>
<Switch>
<Route exact path={'/'} component={App}/>
<Route path={'/rules'} component={ExchangeRules}/>
<Route path={'/partners'} component={Partners}/>
<Route exact path={'/news'} component={NewsList}/>
<Route path={'/news/:id'} component={News}/>
<Route path={'/contacts'} component={Contacts}/>
<Route exact path={'/faq'} component={FAQ}/>
<Route path={'/faq/:id'} component={Question}/>
<Route path={'/registration'} component={Registration}/>
<Route component={NotFound}/>
</Switch>
</div>
</BrowserRouter>
);
};
export default Navigation;
<file_sep>/src/store/reducer.js
/* eslint-disable require-jsdoc */
import * as types from './actionTypes';
import Immutable from 'seamless-immutable';
const initialState = Immutable({
data: [],
currentLeft: '',
currentRight: '',
lastCurrency: '',
count: '',
location: '',
});
export default function reduce(state = initialState, action = {}) {
switch (action.type) {
case types.DATA_FETCHED:
return state.merge({
data: action.data,
});
case types.GET_CURRENT_LEFT:
return state.merge({
currentLeft: action.currentLeft,
});
case types.GET_CURRENT_RIGHT:
return state.merge({
currentRight: action.currentRight,
});
case types.GET_LAST_CURRENCY:
return state.merge({
lastCurrency: action.lastCurrency,
});
case types.SET_COUNT:
return state.merge({
count: action.count,
});
default:
return state;
}
}
// selectors
export function getData(state) {
return state.data;
}
export function getLeft(state) {
return state.currentLeft;
}
export function getRight(state) {
return state.currentRight;
}
export function getLast(state) {
return state.lastCurrency;
}
export function getCount(state) {
return state.count;
}
<file_sep>/src/components/App/App.js
/* eslint-disable max-len,require-jsdoc,no-invalid-this */
import React from 'react';
import PoloniexTicket from '../PoloniexTicket/PoloniexTicket';
import PropTypes from 'prop-types';
import DataEntry from '../DataEntry/DataEntry';
import {connect} from 'react-redux';
import {getData, getLeft, getRight, getLast, getCount} from '../../store/reducer';
import {fetchData, getlastCurrency} from '../../store/action';
class App extends React.Component {
componentDidMount() {
this.props.dispatch(fetchData());
}
getCurrencyLeft = (e) => {
this.props.dispatch({
type: 'GET_CURRENT_LEFT',
currentLeft: e,
});
};
getCurrencyRight = (e) => {
this.props.dispatch({
type: 'GET_CURRENT_RIGHT',
currentRight: e,
});
};
setCount = (e) => {
let count = e.target.value;
this.props.dispatch({
type: 'SET_COUNT',
count: count,
});
};
componentWillReceiveProps(nextProps) {
let {currentLeft, currentRight, count} = this.props;
if (currentLeft !== nextProps.currentLeft || currentRight !== nextProps.currentRight ||
count !== nextProps.count) {
this.props.dispatch(getlastCurrency());
}
}
render() {
let {count, lastCurrency} = this.props;
let result = count*lastCurrency !== 0 ? (count*lastCurrency).toString(): ' ';
return (
<div className={'calc'}>
<div className={'calc_columns'}>
<LeftInput onCount={this.setCount}/>
<PoloniexTicket say={this.getCurrencyLeft}/>
</div>
<div className={'calc_columns'}>
<ResultInput result={result}/>
<PoloniexTicket say={this.getCurrencyRight}/>
</div>
<div className={'calc_columns'}><DataEntry lastCurrency = {lastCurrency} /></div>
</div>
);
}
}
function mapStateToProps(state) {
return {
data: getData(state),
currentLeft: getLeft(state),
currentRight: getRight(state),
lastCurrency: getLast(state),
count: getCount(state),
};
}
const LeftInput = function(props) {
return <input type="number" name={props.currentLeft} onChange={props.onCount} min={'1'} className={'form-control'}/>;
};
const ResultInput = function(props) {
return <input type="text" value={props.result} className={'form-control'} readOnly/>;
};
LeftInput.propTypes = {
currentLeft: PropTypes.string,
onCount: PropTypes.func,
result: PropTypes.string,
};
ResultInput.propTypes = {
result: PropTypes.string,
};
App.propTypes = {
currentLeft: PropTypes.string,
currentRight: PropTypes.string,
count: PropTypes.string,
lastCurrency: PropTypes.string,
};
export default connect(mapStateToProps)(App);
<file_sep>/test/components/registration_test.js
import { React, expect, shallow } from '../test_helper';
import Registration from '../../src/components/Registration/Registration';
describe('Registration' , () => {
let component;
beforeEach(() => {
component = shallow(<Registration />);
});
it('renders Registration', () => {
expect(component).to.exist;
});
it('has name input ', () => {
expect(component.find('#name').length).to.equal(1);
});
it('has email input ', () => {
expect(component.find('#email').length).to.equal(1);
});
});<file_sep>/src/components/Question/Question.js
import React from 'react';
import {faqList} from '../../tmpDefines';
import PropTypes from 'prop-types';
const Question = (props) => {
const faqId = props.match.params.id;
let content;
for (let i of faqList) {
if (''+i.id === faqId) {
content = i.content;
}
}
return <div>{content}</div>;
};
Question.propTypes = {
match: PropTypes.shape({
params: PropTypes.shape({
id: PropTypes.string.isRequired,
}),
}),
};
export default Question;
<file_sep>/test/components/partners_test.js
import { React, expect, shallow } from '../test_helper';
import Partners from '../../src/components/Partners/Partners';
describe('Partners' , () => {
let component;
beforeEach(() => {
component = shallow(<Partners />);
});
it('renders Partners', () => {
expect(component).to.exist;
});
it('has 3 headers of size 5 ', () => {
expect(component.find('h5').length).to.equal(3);
});
});<file_sep>/src/services/poloniexService.js
/* eslint-disable require-jsdoc */
class PoloniexService {
async fetchData() {
const response = await fetch('http://127.0.0.1:5000/poloniex');
let data = await response.json();
return data;
}
}
export default new PoloniexService();
<file_sep>/src/components/FAQ/FAQ.js
/* eslint-disable max-len */
import React from 'react';
import {faqList} from '../../tmpDefines';
const FAQ = () => {
let faq = faqList.map((item) => (
<div key={item.id}>
<a className={'btn btn-primary btn-md'} href={'/faq/'+item.id} role="button" >{item.title}</a>
</div>
)
);
return (
<div>{faq}</div>
);
};
export default FAQ;
<file_sep>/src/components/Nav/Nav.js
import React from 'react';
import Navbar from 'react-bootstrap/lib/Navbar';
import {Link} from 'react-router-dom';
import {menu} from '../../tmpDefines';
const Nav = () => {
let menuList = menu.map((nav) =>
<Navbar.Brand key={nav.id} className={'menu btn btn-primary'}>
<Link to={nav.path} className={'btn btn-link'}>{nav.name}</Link>
</Navbar.Brand>
);
return (
<div>
<Navbar>
<Navbar.Header>{menuList}</Navbar.Header>
</Navbar>
</div>
);
};
export default Nav;
<file_sep>/src/components/PoloniexTicket/PoloniexTicket.js
/* eslint-disable require-jsdoc,no-invalid-this */
import React from 'react';
import PropTypes from 'prop-types';
import CryptList from '../CryptList/CryptList';
export default class PoloniexTicket extends React.Component {
constructor(props) {
super(props);
this.state = {current: ''};
}
handleChange = (e) => {
this.setState({current: e});
};
shouldComponentUpdate(nextProps, nextState) {
if (this.state.current !== nextState.current) {
this.sayCurrent(nextState.current);
return true;
}
return false;
}
sayCurrent = (e) => {
this.props.say(e);
};
render() {
const handleChange = this.handleChange;
const current = this.state.current;
return <CryptList handleChange={handleChange} current={current}/>;
}
}
PoloniexTicket.propTypes = {
say: PropTypes.func,
leftIn: PropTypes.func,
result: PropTypes.string,
};
<file_sep>/project/app.py
from flask import Flask, send_from_directory, jsonify
from os import path
import sys
path1 = path.dirname(path.dirname(path.abspath(__file__)))
if path1 not in sys.path:
sys.path.append(path1)
from project.poloniex_api import Poloniex
from flask_cors import cross_origin
assetsPath = path.join(path.abspath(path.dirname("../public/assets/")))
app = Flask(__name__, static_folder=assetsPath)
@app.route('/')
def index():
return send_from_directory(assetsPath, "index.html")
@app.route('/poloniex')
@cross_origin()
def poloniex():
my_polo = Poloniex(
API_KEY='',
API_SECRET=''
)
ticker = my_polo.returnTicker()
return jsonify(ticker)
@app.errorhandler(404)
def page_not_found(e):
return send_from_directory(assetsPath, "index.html")
if __name__ == '__main__':
app.run(debug=True)
<file_sep>/src/store/action.js
/* eslint-disable require-jsdoc */
import {DATA_FETCHED} from './actionTypes';
import PoloniexService from '../services/poloniexService';
export function fetchData() {
return async (dispatch, getState) => {
try {
const data = await PoloniexService.fetchData();
dispatch({type: DATA_FETCHED, data});
console.log(getState());
} catch (error) {
console.error(error);
}
};
}
export function getlastCurrency() {
return (dispatch, getState) => {
try {
let state = getState();
let left = state.currentLeft;
let right = state.currentRight;
let data = state.data;
let lastCurrency = '';
if (left !== '' && right !== '') {
if (!data[left + '_' + right]) {
if (data[right + '_' + left]) {
lastCurrency = data[right + '_' + left].last;
} else {
lastCurrency = 'Нет курса обмена';
}
} else {
lastCurrency = 1 / data[left + '_' + right].last;
}
}
console.log(getState());
dispatch({
type: 'GET_LAST_CURRENCY',
lastCurrency: lastCurrency.toString(),
});
} catch (error) {
console.error(error);
}
};
}
<file_sep>/src/components/Course/Course.js
import React from 'react';
import PropTypes from 'prop-types';
const Course = (props) => {
return <div>Курс обмена: 1 = {props.lastCurrency}</div>;
};
Course.propTypes = {
lastCurrency: PropTypes.string,
};
export default Course;
|
bbf2ebaee56172187e69108f59243d304453fb8b
|
[
"JavaScript",
"JSON",
"Python"
] | 21 |
JavaScript
|
Den4i/CryptoExchanger
|
db8df225c74f1ded0daa378ff91502b182d5cd6b
|
5ad2528728a68ef2eb6117c4b88d9abddaac0492
|
refs/heads/master
|
<repo_name>EsbaideHdez/UNEDL2019B<file_sep>/Console/PV2doParcial/PV2doParcial/Program.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PV2doParcial
{
class Program
{
static void Main(string[] args)
{
Stack p = new Stack();
Console.WriteLine("Ingresa los signos parentesis, llaves y corchtes ");
string n = Console.ReadLine();
for (int i = 0; i < n.Length; i++)
{
if ((n[i] == '(') || (n[i] == '{') || (n[i] == '['))
{
p.Push(n[i]);
}
else if (p.Count > 0)
{
switch (n[i])
{
case ']'://caso ]
p.Pop();
break;
case '}'://caso}
p.Pop();
break;
case ')'://caso )
p.Pop();
break;
}
}
}
if (p.Count == 0)
{
Console.WriteLine("LA ECUACION ESTA CORRECTAMENTE EQUILIBRADA");//imprime es correcta
}
else
{
Console.WriteLine("LA ECUACION NO ECUACION NO ESTA EQUILIBRADA");//imprime no esta equilibrada
}
}
}
}
<file_sep>/Console/Programacion_lll_Visual/src/Herencias_Ejercicio/Padres.java
package Herencias_Ejercicio;
public class Padres {
protected String cPiel;//c=color de piel
protected String cOjos;
protected String cCabello;
protected float estatura;
public Padres(){
cPiel= "<NAME>";
cOjos="<NAME>";
cCabello="<NAME>";
estatura= 1.56f;
}
protected String bailarTaitiano(){
return "<NAME>";
}
protected String bailar(){
return "Bailar";
}
protected String ordenado(){
return "Matener todo ordenado o acomodado";
}
public String getcPiel(){
return cPiel;
}
public String getcOjos(){
return cOjos;
}
public String getcCabello(){
return cCabello;
}
public float getEstatura(){
return estatura;
}
}
<file_sep>/Console/Delegados/Delegados/Program.cs
using System;
public delegate int Numeros(int n1, int n2, int n3, int n4, int n5);
namespace Delegados
{
class Program
{
static int n1 = 0, n2 = 0, n3 = 0, n4 = 0, n5 = 0;
static int suma = 0, promedio = 0, mayor = 0;
public static int ObtenerSuma(int n1, int n2, int n3, int n4, int n5)
{
suma = n1 + n2 + n3 + n4 + n5;
return suma;
}
public static int ObtenerPomedio(int n1, int n2, int n3, int n4, int n5)
{
promedio =((n1 + n2 + n3 + n4 + n5 )/ 5);
return promedio;
}
public static int ObtenerMayor(int n1, int n2, int n3, int n4 , int n5)
{
if(n1>n2 && n1>n3 && n1>n4 && n1 > n5)
{
mayor = n1;
}
else if(n2>n1 && n2>n3 && n2>n4 && n2 > n5)
{
mayor = n2;
}
else if(n3>n1 && n3>n2 && n3>n4 && n3 > n5)
{
mayor = n3;
}
else if(n4>n1 && n4>n2 && n4>n3 && n4 > n5)
{
mayor = n5;
}
else if(n5>n1 && n5>n2 && n5>n3 && n5 > n4)
{
mayor = n5;
}
return mayor;
}
static void Main(string[] args)
{
Console.WriteLine("Ingrese el primer numero");
n1 = int.Parse(Console.ReadLine());
Console.WriteLine("Ingrese el segundo numero");
n2 = int.Parse(Console.ReadLine());
Console.WriteLine("Ingrese el tercer numero");
n3 = int.Parse(Console.ReadLine());
Console.WriteLine("Ingrese el cuarto numero");
n4 = int.Parse(Console.ReadLine());
Console.WriteLine("Ingrese el quinto numero");
n5 = int.Parse(Console.ReadLine());
Numeros N1 = new Numeros(ObtenerSuma);
Numeros N2 = new Numeros(ObtenerPomedio);
Numeros N3 = new Numeros(ObtenerMayor);
N1 (n1, n2, n3, n4, n5);
N2 (n1, n2, n3, n4, n5);
N3 (n1, n2, n3, n4, n5);
Console.WriteLine("La suma de los 5 numero es : {0}", suma);
Console.WriteLine("El promedio de los 5 numero es : {0}", promedio);
Console.WriteLine("El mayor de los 5 numero es : {0}", mayor);
Console.ReadKey();
}
}
}
<file_sep>/Windows/UsingPrintHelper/UsingPrintHelper/Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace UsingPrintHelper
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
About about = new About();
about.MdiParent = this; //indica que es la clase padre y solo esta dentro del frame
about.Show();
}
private void printHelperToolStripMenuItem_Click(object sender, EventArgs e)
{
PrintHelper ph = new PrintHelper();
ph.MdiParent = this;
ph.Show();
}
private void registroToolStripMenuItem_Click(object sender, EventArgs e)
{
Registro r = new Registro();
r.MdiParent = this;
r.Show();
}
}
}
<file_sep>/Console/bin/Collections/Collections/Program.cs
using System;
using System.Collections;
namespace Collections
{
class Program
{
static void Main(string[] args)
{
Arrays test = new Arrays();
//test.Arreglo1();
MasArrays test2 = new MasArrays();
ttest2.Sorted();
ArrayList al = new ArrayList();
al.Add(null);
al.Add("string");
al.Add(1);
al.Add()
foreach (var i in al)
{
Console.WriteLine(i);
}
}
}
}
<file_sep>/Console/Palindromo/src/palindromo/Palindromo.java
package palindromo;
import java.util.Scanner;
public class Palindromo {
Scanner teclado = new Scanner(System.in);
private String palabra, reves = "";
public void Cargar() {
System.out.println("Un palindromo es una Palabra o expresión que es igual si se lee de izquierda a derecha "
+ "que de derecha a izquierda.");
System.out.println("------------------------------------------------------------------------------------");
System.out.println("Ingrese una palabra para determinar si en un palindromo o no");
palabra = teclado.nextLine();
palabra = palabra.replace(" ", "");
palabra = palabra.replace("á", "a");
palabra = palabra.replace("é", "e");
palabra = palabra.replace("í", "i");
palabra = palabra.replace("ó", "o");
palabra = palabra.replace("ú", "u");
palabra = palabra.replace(".", "");
for (int x = palabra.length() - 1; x >= 0; x--) {
reves += palabra.charAt(x);
}
if (palabra.equals(reves)) {
System.out.println("-------------------------------------------------------");
System.out.println("Tu palabra es un polindromo");
} else {
System.out.println("-------------------------------------------------------");
System.out.println("Tu palabra no es polindromo");
}
}
public static void main(String[] args) {
Palindromo mi = new Palindromo();
mi.Cargar();
}
}
<file_sep>/Console/Generics/Generics/Program.cs
using System;
using System.Collections.Generic;
namespace Generics
{
public class Student
{
int nolista;
String nombre;
String apellido;
public Student()
{
}
public Student(String nombre, String apellido)
{
this.nolista = 0;
this.nombre = nombre;
this.apellido = apellido;
}
public Student(int nolista, String nombre, String apellido)
{
this.nolista=nolista;
this.nombre = nombre;
this.apellido = apellido;
}
public int getNolista()
{
return nolista;
}
public String getNombre()
{
return nombre;
}
public String getApellido()
{
return apellido;
}
public void setNolista(int nolista)
{
this.nolista = nolista;
}
public void setNombre(String nombre)
{
this.nombre = nombre;
}
public void setApellido(String apellido)
{
this.apellido = apellido;
}
}
class Program
{
static void Main(string[] args)
{
IList<Student> studentlist = new List<Student>();
Student unedl1 = new Student(2, "Alejandro", "Ramirez");
//Console.WriteLine("No lista: " + unedl1.getNolista());
Student unedl2 = new Student();
unedl2.setNolista(1);
unedl2.setNombre("Daniel");
unedl2.setApellido("Nuno");
//Console.WriteLine("No lista: " + unedl2.setNolista());
Student unedl3 = new Student("<NAME>", "Garcia ");
studentlist.Add(new Student(3, "David", "Nuno"));
studentlist.Add(unedl2);
studentlist.Add(unedl1);
studentlist.Add(unedl3);
foreach(var elemento in studentlist)
{
Console.WriteLine(elemento.getNolista());
Console.WriteLine(elemento.getNombre());
Console.WriteLine(elemento.getApellido());
}
}
}
}
<file_sep>/Console/Examen_final_taller/Examen_taller_esbaide/Examen_taller_esbaide/Servicios Financieros Sa de Cv.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Examen_taller_esbaide
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void groupBox3_Enter(object sender, EventArgs e)
{
}
private void cancelar_Click(object sender, EventArgs e)
{
nombre.Text = "";
apellido.Text = "";
direccion.Text = "";
masculino.Checked = true;
personales.Enabled = false;
cantidad.Text = "";
consulta.Checked = true;
bancarios.Enabled = false;
}
private void femenino_CheckedChanged(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void edicion_Click(object sender, EventArgs e)
{
personales.Enabled = true;
bancarios.Enabled = true;
saldo.Enabled = false;
}
private void ejecutar_Click(object sender, EventArgs e)
{
String[] lineas = { nombre.Text, apellido.Text, Nacimiento.CustomFormat, sexo.Text, cantidad.Text, dateTimePickerEjecucion.CustomFormat, operacion.Text };
//System.IO.File.WriteAllLines(@"C:\RutaArchivos\EscribeLineas.txt", lineas);
string path = @"c:\temp\datos.txt";
}
private void limpiar_Click(object sender, EventArgs e)
{
nombre.Text = "";
apellido.Text = "";
direccion.Text = "";
masculino.Checked = true;
cantidad.Text = "";
consulta.Checked = true;
}
}
}
<file_sep>/Console/Programacion_lll_Visual/src/Examen_1_parcial/Tapiz.java
package Examen_1_parcial;
public class Tapiz {
float CostoXmetro=8;
public void Tapiz (float costoXmetro){
this.CostoXmetro = costoXmetro;
}
public void setCostoXmetro(float costoXmetro){
this.CostoXmetro = costoXmetro;
}
public float getCostoXmetro(){
return CostoXmetro;
}
}
<file_sep>/Console/Semestres_Unedl/Semestres_Unedl/Program.cs
using System;
namespace Semestres_Unedl
{
class Program
{
static void Main(string[] args)
{
int[][] arr = new int[8][];
arr[0] = new int[30];
arr[1] = new int[24];
arr[2] = new int[20];
arr[3] = new int[15];
arr[4] = new int[13];
arr[5] = new int[13];
arr[6] = new int[9];
arr[7] = new int[8];
System.Console.WriteLine("UNIVERSIDAD <NAME> ");
System.Console.WriteLine("8 semetres con las calificaciones de cada alumno ");
arr[0] = new int[] { 89, 90, 99, 78, 25, 59, 74, 67, 88, 100, 100, 57, 30, 99, 95, 90, 34, 65, 69, 77, 63, 86, 88, 17, 40, 50, 51, 69, 70, 99 };
arr[1] = new int[] { 100,95,49,75,78,100,99,94,92,84,69,70,70,87,59,68,88,77,35,56,76,64,89,96};
arr[2] = new int[] { 89,69,79,47,79,99,79,89,29,59,19,39,56,78,46,67,89,99,100,100};
arr[3] = new int[] { 67,34,99,69,15,98,99,100,100,100,67,89,94,20,50,};
arr[4] = new int[] { 99, 69, 15, 98, 99, 100, 100, 100, 67, 89, 94, 20, 50, };
arr[5] = new int[] { 89, 34, 99, 69, 15, 67, 99, 100, 90, 100, 67, 39, 94 };
arr[6] = new int[] { 100, 89, 99, 96, 51, 89, 45, 67, 54};
arr[7] = new int[] { 89, 75, 96, 51, 38, 45, 74, 29 };
for (int i=0 ; i < arr.Length; i++)
{
System.Console.Write("Semestre {0} : ", i);
for (int j = 0; j < arr[i].Length; j++)
{
System.Console.Write("{0}{1}", arr[i][j] , "," ,j == (arr[i].Length - 1) ? "" : " ");
}
Console.WriteLine();
}
System.Console.WriteLine("Press any key to exit.");
Console.ReadKey();
}
}
}
<file_sep>/Console/Collections/Collections/MasArrays.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
namespace Collections
{
class MasArrays
{
public void Sorted()
{
SortedList sl = new SortedList();
sl.Add(1, "Valor 1");
sl.Add(2, "Valor 2");
sl.Add(3, "Valor 3");
ICollection llaves = sl.Keys;
foreach(var k in llaves)
{
Console.WriteLine("llaves:" + k + "valor " + sl[k]);
}
}
}
}
<file_sep>/Windows/UsingPrintHelper/UsingPrintHelper/Registro.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace UsingPrintHelper
{
public partial class Registro : Form
{
public Registro(string nombre, string matricula, string grado, string grupo, string taller)
{
InitializeComponent();
}
public Registro()
{
}
private void groupBox1_Enter(object sender, EventArgs e)
{
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void Registro_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
String nombre = txtNombre.Text;
String matricula = txtMatricula.Text;
String grado = cbxGrado.Text;
String grupo = txtGrupo.Text;
String taller = listTaller.Text;
Registro rt = new Registro(nombre, matricula, grado,grupo,taller);
rt.Show();
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void txtGrupo_TextChanged(object sender, EventArgs e)
{
}
}
}
<file_sep>/Console/bin/Test_Operaciones/nbproject/private/private.properties
compile.on.save=true
user.properties.file=C:\\Users\\<NAME>\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties
<file_sep>/Console/Ejercicio_2.java
package Primer_Parcial;
import java.util.Scanner;
public class Ejercicio_2 {
private Scanner teclado;
private int [][] matriz;
private int fila, columna;
int suma=0 , suma1=0;
int resta =0;
public void cargar() {
teclado = new Scanner(System.in);
System.out.println(" MATRIZ ");
System.out.print("Ingrese las filas de la matriz: ");
fila=teclado.nextInt();
System.out.print("Ingresr las columnas de la matriz: ");
columna=teclado.nextInt();
matriz= new int [fila][columna];
System.out.println("Ingresa los valores de la matriz");
for(int f=0; f<matriz.length;f++) {
for(int c=0; c<matriz[f].length;c++) {
System.out.print("Valores "+ "["+f+"]"+"["+c+"]"+": ");
matriz[f][c]= teclado.nextInt();
}
}
for(int f=0; f<matriz.length;f++) {
System.out.print("[ ");
for(int c=0; c<matriz[f].length;c++) {
System.out.print(matriz[f][c] + " ");
}
System.out.print("]");//se imprime en pantalla solo para hacer el acomodo
System.out.print("\n");
}
}
public void suma() {
System.out.println("\n SUMA PRIMARIA ");
for(int f=0; f<matriz.length;f++) {
for(int c=0; c<matriz[f].length;c++) {
if(f==c) {
System.out.println("\t" + matriz[f][c] + "+");
suma= suma + matriz[f][c] ;
}
}
}
System.out.println(" = " + suma);
System.out.println("\n SUMA SECUNDARIA ");
for(int f=0; f<matriz.length;f++) {
for(int c=0; c<matriz[f].length;c++) {
if(f+c == matriz.length-1){
System.out.println("\t" + matriz[f][c] + "+");
suma1 = suma1 + matriz[f][c] ;
}
}
}
System.out.println(" = " + suma1);
}
public void resta() {
System.out.println("El resultado final es " );
resta =suma - suma1;
System.out.println(resta * -1);
}
public static void main(String[] args) {
Ejercicio_2 mi = new Ejercicio_2();
mi.cargar();
mi.suma();
mi.resta();
}
}
<file_sep>/Console/DiagonalDifference.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package diagonaldifference;
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
/**
*
* @author <NAME>
*/
class Result {
/*
* Complete the 'diagonalDifference' function below.
*
* The function is expected to return an INTEGER.
* The function accepts 2D_INTEGER_ARRAY arr as parameter.
*/
public static int diagonalDifference(List<List<Integer>> arr) {
// Write your code here
int suma1=0;
int suma2=0;
int resta=0;
int x= arr.size();
for(int f=0; f<arr.size();f++) {
for(int c=0; c< arr.size();c++) {
if(f==c) {
suma1= suma1 + arr.get(c).get(f);
}
if(f+ c == (x-1)){
// x--;
suma2 = suma2 + arr.get(f).get(c) ;
}
}
resta=suma1-suma2;
}
if(resta < 0){
resta=resta*-1;
System.out.println(resta );
}
return resta;
}
}
public class DiagonalDifference {
public static void main(String[] args) throws IOException {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(("C:\\Users\\<NAME>\\diaginal.txt")));
int n = Integer.parseInt(bufferedReader.readLine().trim());
List<List<Integer>> arr = new ArrayList<>();
for (int i = 0; i < n; i++) {
String[] arrRowTempItems = bufferedReader.readLine().replaceAll("\\s+$", "").split(" ");
List<Integer> arrRowItems = new ArrayList<>();
for (int j = 0; j < n; j++) {
int arrItem = Integer.parseInt(arrRowTempItems[j]);
arrRowItems.add(arrItem);
}
arr.add(arrRowItems);
}
int result = Result.diagonalDifference(arr);
bufferedWriter.write(String.valueOf(result));
bufferedWriter.newLine();
bufferedReader.close();
bufferedWriter.close();
}
}
<file_sep>/Windows/UsingPrintHelper/UsingPrintHelper/Credencial.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace UsingPrintHelper
{
public partial class Credencial : Form
{
public Credencial()
{
InitializeComponent();
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void Credencial_Load(object sender, EventArgs e)
{
}
public Credencial(string nombre, String matricula,String grado,String grupo ,String taller)
{
InitializeComponent();
lblCredencial.Text = "Tu credencial es : \n\n\t" + nombre;
lblCredencial.Text = "\n\n\t" + matricula;
lblCredencial.Text = "\n\n\t" + grado;
lblCredencial.Text = "\n\n\t" + grupo;
lblCredencial.Text = "\n\n\t" + taller;
}
private void regresar_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
<file_sep>/Console/Test_Operaciones/src/test_operaciones/Operacion.java
package test_operaciones;
import javax.swing.JOptionPane;
public class Operacion {
private float N1 = 0;
private float N2 = 0;
private String Operaciones;
private float op;
private boolean op2;
public void Operacion(String n1, String n2, String operaciones) {
// public void setOperadorAritmticos(String n1 , String n2 , String operaciones){
this.N1 = Float.parseFloat(n1);
this.N2 = Float.parseFloat(n2);
this.Operaciones = operaciones;
switch (Operaciones) {
case "+":
op = this.N1 + this.N2;
JOptionPane.showMessageDialog(null, "Es un operador aritmetico y es una suma +");
JOptionPane.showMessageDialog(null, "La suma es : " + op);
break;
case "-":
op = this.N1 - this.N2;
JOptionPane.showMessageDialog(null, "Es un operador aritmetico y es una resta -");
JOptionPane.showMessageDialog(null, "La resta es : " + op);
break;
case "*":
op = this.N1 * this.N2;
JOptionPane.showMessageDialog(null, "Es un operador aritmetico y es una multiplicacion *");
JOptionPane.showMessageDialog(null, "La multiplicacion es : " + op);
break;
case "/":
op = this.N1 / this.N2;
JOptionPane.showMessageDialog(null, "Es un operador aritmetico y es una division /");
JOptionPane.showMessageDialog(null, "La division es : " + op);
break;
case "%":
op = this.N1 % this.N2;
JOptionPane.showMessageDialog(null, "Es un operador aritmetico y es uu residuo %");
JOptionPane.showMessageDialog(null, "El residuo es : " + op);
break;
}
}
public boolean setOperacion2(String n1, String n2, String operaciones) {
op2 = false;
this.N1 = Float.parseFloat(n1);
this.N2 = Float.parseFloat(n2);
this.Operaciones = operaciones;
switch (operaciones) {
case "<":
if (this.N1 < this.N2) {
op2 = true;
JOptionPane.showMessageDialog(null, "El primer valor es menor que el segundo valor");
}else {
JOptionPane.showMessageDialog(null, "El primer valor es mayor que el segundo valor");
}
break;
case "<=":
if (this.N1 <= this.N2) {
op2 = true;
JOptionPane.showMessageDialog(null, "El primer valor es menor igual que el segundo valor");
}else{
JOptionPane.showMessageDialog(null, "El primer valor es mayor igual que el segundo valor");
}
break;
case ">":
if (this.N1 > this.N2) {
op2 = true;
JOptionPane.showMessageDialog(null, "El primer valor es mayor que el segundo valor");
}else{
JOptionPane.showMessageDialog(null, "El primer valor es menor que el segundo valor");
}
break;
case ">=":
if (this.N1 >= this.N2) {
op2 = true;
JOptionPane.showMessageDialog(null, "El primer valor es mayor igual que el segundo valor");
}else{
JOptionPane.showMessageDialog(null, "El primer valor es menor igual que el segundo valor");
}
break;
case "!=":
if (this.N1 != this.N2) {
op2 = true;
JOptionPane.showMessageDialog(null, "El primer valor es diferente igual que el segundo valor");
}else{
JOptionPane.showMessageDialog(null, "El segundo valor es diferente igual que el primer valor");
}
break;
case "==":
if (this.N1 == this.N2) {
op2 = true;
JOptionPane.showMessageDialog(null, "Los dos valores son iguales");
}else{
JOptionPane.showMessageDialog(null, "Los valores no son iguales");
}
break;
case "&&":
JOptionPane.showMessageDialog(null, "La condicion se cumple si ambos son mayores a 5");
if (this.N1 > 5&& this.N2 > 5) {
op2 = true;
JOptionPane.showMessageDialog(null, "Ambos valores son mayores a 5");
}else{
JOptionPane.showMessageDialog(null, "Ambos valores deben ser mayores a 5");
}
break;
case "||":
JOptionPane.showMessageDialog(null, "La condicion se cumple si uno de los valores es mayor a 10");
if (this.N1 > 10 || this.N2 < 10) {
op2 = true;
JOptionPane.showMessageDialog(null, "Al menos uno de los dos valores es mayor a 10");
}else {
JOptionPane.showMessageDialog(null, "Ningunio de los valores es mayor a 10");
}
break;
}
return op2;
}
}
<file_sep>/Windows/Examen_TPV2doParcial/Examen_TPV2doParcial/Form1.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Examen_TPV2doParcial
{
public partial class Form1 : Form
{
ArrayList palabra = new ArrayList();
public Form1()
{
InitializeComponent();
}
private void read_button1_Click(object sender, EventArgs e)
{
palabra.Add(entrada.Text);
MessageBox.Show("Se ha agregado una palabra");
}
private void button2_Click(object sender, EventArgs e)
{
for (int i = 0; i < palabra.Count; i++)
{
int contador = 0;
for (int j = 0; j < palabra.Count; j++)
{
if (i != j)
{
if (palabra[i].ToString() == palabra[i].ToString())
{
palabra[j] = "0";
contador++;
}
}
}
if (contador > 0)
{
if (palabra[i].ToString() != "0")
{
Contenido.Items.Add(palabra[i].ToString() + " las veces que se repiten son" + contador);
}
}
}
}
private void ver_lista_Click(object sender, EventArgs e)
{
}
}
}
/*<NAME> 27-Noviembre-2019
* 1. Describa en sus propias palabras el concepto de colecciones (collections) y cuales tipos existen.
* R=son las clases que se utilizan para el manejo de varios valores de diferentes seriesy existen 2 tipos las
* non-generic collections y las generic collections.
*
2.Defina a que se refiere el concepto de código no seguro y que se necesita para implementarlo.
R=el codigo no seguro es el que usa los apuntadores y se le llama contexto inseguro y para implementarlo es utilizando
el modificador unsafe para un metodo o constructor, tambien se deve utilizar la palabra unsafe para definir el grupo de
codigo y se debe habilitar en el compilador el uso del unsafe ya que si este no se habilita se genera un error a la hora de compilar.
3.Mencione al menos tres clases que se utilizan en I/O y proporcione brevemente la idea central de las mismas.
FileStream:lee y escribe bytes desde y hacia un archivo
BufferedStream: lee y escribe bytes desde y hacia otros Streams para mejorar el rendimiento de las operaciones de entrada y salia
PipeStream: lee y escribe bytes desde y hacia diferentes procesos.
4. Explique la diferencia entre los siguientes códigos en csharp
a. Console. Writeline ("resultado: (*ptr) ").
b. Console.WriteLine("resultado: ((int)ptr)")
5.Mencione al menos tres caracteristicas de las excepciones (Exceptions).
R=las excepciones son eventos inesperados que aparecen durante la ejecucion de agun programa,
puede ser al tratar de acceder a un elemento fuera del limite.
6.En Java, mencione y describa los tres tipos de excepciones.
R=
7. Explique brevemente a que se refiere con directivas para preprocesador y que se necesita para
usarlas.
R=son las que dan las instrucciones al compilador para que procese la informacion antes de iniciar con
la propia compilacion y para usarlas es que las directivas inician con # y no termina con , las directivas deben ser las unicas
instrucciones de la linea y el compilador no contiene un prepocesador
8. Explique las diferencias entre ArrayList, SortedList y HashTable.
R=el ArrayList es el que Almacena objetos de cualquier tipo a manera de arreglo. No se necesita especificar el tamaño del arreglo, ya que se
incrementa automáticamente, el SortedList es el que acomoda automaticamente los elemtos deascendente y el HashTable es el que recupera los valores
utilizando la llave dada.
9. Describa las para que sirven StreamReader y StreamWriter
R=son las clases de apoyp que permiten la lectura y la escritura convirtiendo los bytes en caracteres y viceversa.
10. Explique el funcionamiento del algoritmo Quicksort
R=es un algoritmo que inicia partiendo de un pivote partiendo la lista de los elementos en 2, los elemntos de la seccion demla derecha so mayores
y los del lado izquierdo menores y se hace el mismo procediemto en la parte derecha y en la parte izquierda y se puede utilizar la recursividad.
11. En Java, explique cuál es la diferencia entre System.out, System.in y System.err
R=system.out es la salida de normas. el system.in es la entradda de normas y el system.err es el error de las normas.
12. Explique cuáles son las ventajas de utilizar "generic collections"
R=pueden almacenar cualquier tipo de elementos, la limitantes es quue debe usar casting para poder recorrer el contenido ya que si no se hace se genera una
excepcion
13 Desarrolle en C#, un programa en Windows Forms llamado TPV2doParcial que permita crear un
archivo, lo lea y permita escribir en el. El programa debe permitir la captura de una lista de palabras
y al finalizar la captura, debe reportar la cantidad total de palabras, las palabras repetidas y la
cantidad de ocurrencias. Capture las excepciones necesarias. Al terminar, suba su codigo a su
repositorio y escriba el SHA correspondiente en el examen*/
|
58ad396f1d39330fcf4d218ba5b690634cde2239
|
[
"Java",
"C#",
"INI"
] | 18 |
C#
|
EsbaideHdez/UNEDL2019B
|
46c3c2cd1249c50b3b581deef6bbcf1c8e2d071d
|
a0e2ff145a528028942c445725a8788a9e8b6710
|
refs/heads/master
|
<repo_name>SinaiNIN/SpringDemo<file_sep>/src/main/java/com/neusoft/controller/RestfulDemoController.java
package com.neusoft.controller;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by 姜涛 on 2016/11/1.
*/
@RestController(value = "/restfulDemo")
public class RestfulDemoController {
}
|
38dbbdc7b6a843e2bb08bf475c3a312bce9b8e5b
|
[
"Java"
] | 1 |
Java
|
SinaiNIN/SpringDemo
|
9031ad5d4d66a97f9c2103ac7e05397d612de560
|
bbda24ad98bbffe862fb622b82ac3b70713a2c99
|
refs/heads/master
|
<repo_name>vishnutejar/pronobrokerhood<file_sep>/ProNobrokerHood/ProNobrokerHood/views/LoginPage.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace ProNobrokerHood.views
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class LoginPage : ContentPage
{
public LoginPage()
{
InitializeComponent();
}
private void VaidateMobileNumber(object sender, EventArgs e)
{
var mobilenumber = ety_mobile.Text;
if (string.IsNullOrEmpty(mobilenumber))
{
DisplayAlert("Error Title", "Enter Your userName or Mobile Number", "ok");
}
else {
// check entried value is mobile or not
//then we need to procced wit Mobile Number and save it.
}
}
}
}
|
9926cda88de550394cd717e337a1d8d3032a28e5
|
[
"C#"
] | 1 |
C#
|
vishnutejar/pronobrokerhood
|
d6e618bec4476530bd80bf9fd2fb2801fe7e29da
|
383bd9111b71679f252e1b6216b543a559abad45
|
refs/heads/master
|
<repo_name>ewanaszydlowska/school-management-web-app<file_sep>/README.md
# Warsztaty_03
This repo is my third workshop of a Java bootcamp I took part in. This is my first Java web app, that develops my previous, console app. It also let user perform all the CRUD operations, but from now on it's taking place in a browser. It involves management of users, groups, exercises and solution. <br/>
Technology stack: <br/>
Java SE 8<br/>
Java EE 8<br/>
JavaServlet<br/>
MySQL
<file_sep>/src/pl/coderslab/warsztat3/controller/DeleteGroup.java
package pl.coderslab.warsztat3.controller;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import pl.coderslab.warsztat3.db.DBUtil;
import pl.coderslab.warsztat3.model.Group;
import pl.coderslab.warsztat3.model.GroupDAO;
/**
* Servlet implementation class DeleteGroup
*/
@WebServlet("/Deletegroup")
public class DeleteGroup extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public DeleteGroup() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int groupId = Integer.parseInt(request.getParameter("id"));
Connection conn;
try {
conn = DBUtil.getConn();
GroupDAO.deleteGroup(conn, groupId);
Group[] groups = GroupDAO.loadAllGroups(conn);
conn.close();
request.setAttribute("groups", groups);
getServletContext().getRequestDispatcher("/WEB-INF/groupspanel.jsp").forward(request, response);
} catch (SQLException e) {
e.printStackTrace();
}
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
<file_sep>/src/pl/coderslab/warsztat3/controller/GroupUsers.java
package pl.coderslab.warsztat3.controller;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import pl.coderslab.warsztat3.db.DBUtil;
import pl.coderslab.warsztat3.model.User;
import pl.coderslab.warsztat3.model.UserDAO;
/**
* Servlet implementation class GroupUsers
*/
@WebServlet("/GroupUsers")
public class GroupUsers extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public GroupUsers() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int groupId = Integer.parseInt(request.getParameter("id"));
Connection conn;
try {
conn = DBUtil.getConn();
List<User> users = UserDAO.loadAllByGroupId(conn, groupId);
request.setAttribute("groupId", groupId);
request.setAttribute("users", users);
getServletContext().getRequestDispatcher("/WEB-INF/users.jsp").forward(request, response);
} catch (SQLException e) {
e.printStackTrace();
}
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
<file_sep>/src/pl/coderslab/warsztat3/model/UserDAO.java
package pl.coderslab.warsztat3.model;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
public class UserDAO {
public static void saveToDB(Connection conn, User u) throws SQLException {
if(u.getId() == 0l) {
String sql = "INSERT INTO users(username, email, password, user_group_id) VALUES (?, ?, ?, ?);";
String[] generatedColumns = {"ID"}; //jaka kolumna z bazy danych jest automatycznie generowana -> jest auto_increment
PreparedStatement ps = conn.prepareStatement(sql, generatedColumns);
ps.setString(1, u.getUsername());
ps.setString(2, u.getEmail());
ps.setString(3, u.getPassword());
ps.setInt(4, u.getUserGroupId());
ps.executeUpdate(); //prepared statement trzyma w sobie dane ktore pobiera z bazy danych
ResultSet gk = ps.getGeneratedKeys(); //baza zwraca wyniki w postaci resultset (wskazuje na przed pierwszą daną) rekordy zwrocone przez baze
if (gk.next()) { //przestawia na właściwe id
u.setId(gk.getLong(1)); //kolumna 1 tabeli users
}
ps.close();
gk.close();
} else {
String sql = "UPDATE users SET username=?, email=?, password=?, user_group_id=? WHERE id=?;"; //moze nowe preparedstatement?
PreparedStatement ps = conn.prepareStatement(sql);
ps.setString(1, u.getUsername());
ps.setString(2, u.getEmail());
ps.setString(3, u.getPassword());
ps.setInt(4, u.getUserGroupId());
ps.setLong(5, u.getId());
ps.executeUpdate();
ps.close();
}
}
static public User loadUserById(Connection conn, int id) throws SQLException {
String sql = "SELECT * FROM users WHERE id=?;";
PreparedStatement ps = conn.prepareStatement(sql);
ps.setInt(1, id);
ResultSet rs = ps.executeQuery();
if (rs.next()) {
User loadedUser = new User();
loadedUser.setId(rs.getLong("id"));
loadedUser.setUsername(rs.getString("username"));
loadedUser.setEmail(rs.getString("email"));
loadedUser.setPassword(rs.getString("password"));
loadedUser.setUserGroupId(rs.getInt("user_group_id"));
ps.close();
rs.close();
return loadedUser;
}
ps.close();
return null;
}
static public User[] loadAllUsers(Connection conn) throws SQLException {
ArrayList<User> users = new ArrayList<User>();
String sql = "SELECT * FROM users;";
PreparedStatement ps = conn.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
while(rs.next()) {
User loadedUser = new User();
loadedUser.setId(rs.getLong("id"));
loadedUser.setUsername(rs.getString("username"));
loadedUser.setEmail(rs.getString("email"));
loadedUser.setPassword(<PASSWORD>("<PASSWORD>"));
loadedUser.setUserGroupId(rs.getInt("user_group_id"));
users.add(loadedUser);
}
User[] uArray = new User[users.size()];
uArray = users.toArray(uArray);
ps.close();
rs.close();
return uArray;
}
public static void deleteUser(Connection conn, int id) throws SQLException {
String sql = "DELETE FROM users WHERE id=?;";
PreparedStatement ps = conn.prepareStatement(sql);
ps.setLong(1, id);
ps.executeUpdate();
ps.close();
}
public static List<User> loadAllByGroupId(Connection conn, int id) throws SQLException {
List<User> members = new ArrayList<>();
String sql = "SELECT * FROM users WHERE user_group_id = ?";
PreparedStatement ps = conn.prepareStatement(sql);
ps.setInt(1, id);
ResultSet rs = ps.executeQuery();
while(rs.next()) {
User u = new User();
u.setId(rs.getLong("id"));
u.setUsername(rs.getString("username"));
u.setEmail(rs.getString("email"));
u.setPassword(rs.getString("<PASSWORD>"));
u.setUserGroupId(rs.getInt("user_group_id"));
members.add(u);
}
ps.close();
rs.close();
return members;
}
}
<file_sep>/src/pl/coderslab/warsztat3/controller/PanelUser.java
package pl.coderslab.warsztat3.controller;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import pl.coderslab.warsztat3.db.DBUtil;
import pl.coderslab.warsztat3.model.User;
import pl.coderslab.warsztat3.model.UserDAO;
/**
* Servlet implementation class PanelUser
*/
@WebServlet("/users")
public class PanelUser extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public PanelUser() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
Connection conn = DBUtil.getConn();
User[] users = UserDAO.loadAllUsers(conn);
request.setAttribute("users", users);
getServletContext().getRequestDispatcher("/WEB-INF/userspanel.jsp").forward(request, response);
} catch (SQLException e) {
e.printStackTrace();
}
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
<file_sep>/src/pl/coderslab/warsztat3/controller/UserDetails.java
package pl.coderslab.warsztat3.controller;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import pl.coderslab.warsztat3.db.DBUtil;
import pl.coderslab.warsztat3.model.ExerciseDAO;
import pl.coderslab.warsztat3.model.Solution;
import pl.coderslab.warsztat3.model.User;
import pl.coderslab.warsztat3.model.UserDAO;
/**
* Servlet implementation class UserDetails
*/
@WebServlet("/UserDetails")
public class UserDetails extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public UserDetails() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int userId = Integer.parseInt(request.getParameter("id"));
try {
Connection conn = DBUtil.getConn();
User u = UserDAO.loadUserById(conn, userId);
request.setAttribute("user", u);
List<Solution> solutions = ExerciseDAO.loadAllByUserId(conn, userId);
request.setAttribute("sols", solutions);
getServletContext().getRequestDispatcher("/WEB-INF/userdetails.jsp").forward(request, response);
} catch (SQLException e) {
e.printStackTrace();
}
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
<file_sep>/src/pl/coderslab/warsztat3/controller/EditUser.java
package pl.coderslab.warsztat3.controller;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import pl.coderslab.warsztat3.db.DBUtil;
import pl.coderslab.warsztat3.model.User;
import pl.coderslab.warsztat3.model.UserDAO;
/**
* Servlet implementation class EditUser
*/
@WebServlet("/Edituser")
public class EditUser extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public EditUser() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int groupId = Integer.parseInt(request.getParameter("id"));
request.setAttribute("id", groupId);
getServletContext().getRequestDispatcher("/WEB-INF/edituser.jsp").forward(request, response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int userId = Integer.parseInt(request.getParameter("id"));
String userName = request.getParameter("user-name");
String userEmail = request.getParameter("user-email");
String userPasswd = request.getParameter("user-passwd");
int userGroupId = Integer.parseInt("user-groupid");
try {
Connection conn = DBUtil.getConn();
User u = new User(userName, userEmail, userPasswd);
u.setId(userId);
u.setUserGroupId(userGroupId);
UserDAO.saveToDB(conn, u);
conn.close();
response.sendRedirect("users");
} catch (SQLException e) {
e.printStackTrace();
}
}
}
<file_sep>/src/pl/coderslab/warsztat3/controller/Addexercise.java
package pl.coderslab.warsztat3.controller;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import pl.coderslab.warsztat3.db.DBUtil;
import pl.coderslab.warsztat3.model.Exercise;
import pl.coderslab.warsztat3.model.ExerciseDAO;
/**
* Servlet implementation class Addexercise
*/
@WebServlet("/Addexercise")
public class Addexercise extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public Addexercise() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.getServletContext().getRequestDispatcher("/WEB-INF/addexercise.jsp").forward(request, response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String exeName = request.getParameter("exe-name");
String exeDesc = request.getParameter("exe-desc");
try {
Connection conn = DBUtil.getConn();
Exercise exercise = new Exercise(exeName, exeDesc);
ExerciseDAO.saveToDB(conn, exercise);
conn.close();
response.sendRedirect("exercises");
} catch (SQLException e) {
e.printStackTrace();
}
}
}
<file_sep>/src/pl/coderslab/warsztat3/controller/SolutionsHome.java
package pl.coderslab.warsztat3.controller;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import pl.coderslab.warsztat3.db.DBUtil;
import pl.coderslab.warsztat3.model.Solution;
import pl.coderslab.warsztat3.model.SolutionDAO;
/**
* Servlet implementation class SolutionsHome
*/
@WebServlet("/Solution")
public class SolutionsHome extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public SolutionsHome() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int solutionId = Integer.parseInt(request.getParameter("id"));
try {
Connection conn = DBUtil.getConn();
Solution s = SolutionDAO.loadSolutionById(conn, solutionId);
request.setAttribute("solution", s);
getServletContext().getRequestDispatcher("/WEB-INF/solution.jsp").forward(request, response);
} catch (SQLException e) {
e.printStackTrace();
}
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
|
0d08f50e127800588584bae4f59d1b15831d9eae
|
[
"Markdown",
"Java"
] | 9 |
Markdown
|
ewanaszydlowska/school-management-web-app
|
e7205914ee1720ea4d8e5014fd97a6191d660e37
|
c6ad74432348fd5147e9e35d063b395bbe47764b
|
refs/heads/master
|
<repo_name>antonmedv/prettyjson<file_sep>/index.js
'use strict'
const chalk = require('chalk')
const indent = require('indent-string')
function print(v, space = 2) {
if (typeof v === 'undefined') {
return void 0
}
if (v === null) {
return chalk.grey.bold(v)
}
if (typeof v === 'number' && Number.isFinite(v)) {
return chalk.cyan.bold(v)
}
if (typeof v === 'boolean') {
return chalk.yellow.bold(v)
}
if (typeof v === 'string') {
return chalk.green.bold(JSON.stringify(v))
}
if (Array.isArray(v)) {
return gen(function* () {
yield '[\n'
const len = v.length
let i = 0
for (let item of v) {
if (typeof item === 'undefined') {
yield indent(print(null, space), space) // JSON.stringify compatibility
} else {
yield indent(print(item, space), space)
}
yield i++ < len - 1 ? ',\n' : '\n'
}
yield ']'
})
}
if (typeof v === 'object' && v.constructor === Object) {
return gen(function* () {
yield '{\n'
const entries = Object.entries(v)
.filter(([key, value]) => typeof value !== 'undefined') // JSON.stringify compatibility
const len = entries.length
let i = 0
for (let [key, value] of entries) {
yield indent(chalk.blue.bold(JSON.stringify(key)) + ': ' + print(value, space), space)
yield i++ < len - 1 ? ',\n' : '\n'
}
yield '}'
})
}
return JSON.stringify(v, null, 2)
}
function gen(fn) {
return [...fn()].join('')
}
module.exports = print
<file_sep>/README.md
# 🧢 PrettyJSON
[](https://travis-ci.org/antonmedv/prettyjson)
Pretty JSON printer for [fx](https://github.com/antonmedv/fx)
<img width="716" alt="2018-06-26 22 11 50" src="https://user-images.githubusercontent.com/141232/41921868-0b9ef744-798e-11e8-90f2-92e877441737.png">
## Install
```bash
npm install @medv/prettyjson
```
## Usage
```js
const print = require('@medv/prettyjson')
const value = {...}
console.log(print(value))
```
## License
MIT
|
febe0eb7aa9d278aaf67890638ca0b5478502b0f
|
[
"JavaScript",
"Markdown"
] | 2 |
JavaScript
|
antonmedv/prettyjson
|
47aea4b6508ffc33bd50999a853f2922fb7babb0
|
86fe1ac2a94f3b89280da1087a8582e2667b9e0b
|
refs/heads/master
|
<repo_name>ayser259/tasktrader<file_sep>/V.0.1/tasktrader02/tasktrader/urls.py
from django.conf.urls import url
from . import views
urlpatterns = [
# urls to access pages
url(r'^$', views.index, name='index'),
url(r'applied', views.applied, name='applied'),
url(r'create', views.create, name='create'),
url(r'dashboard', views.dashboard, name='dashboard'),
url(r'explore', views.explore, name='explore'),
url(r'insert_task', views.insert_task, name='insert_task'),
url(r'nav', views.nav, name='nav'),
url(r'profile', views.profile, name='profile'),
url(r'taskresult', views.taskresult, name='taskresult'),
url(r'task', views.tasks, name='tasks'),
url(r'onboarding', views.onboarding, name='onboarding'),
# urls to intereact with db
url(r'add_new_company', views.add_new_company, name='add_new_company'),
]
<file_sep>/V.0.0/static/tasktrader.js
//JavaScript for TaskTrader
$(document).ready(function() {
$('#tag').tagsInput();
$('#tags').tagsInput();
$('.profile_section').click(function() {
$('.profile_section').removeClass('active');
$(this).addClass('active');
var $id = $(this).attr('name');
$('.profile_info').each(function(){
if (!$(this).is($id)) {
$(this).removeClass('show_form');
}
});
if (!$('#' +$id).hasClass('show_form')){
$('#' +$id).addClass('show_form');
}
});
setTimeout(function(){
$('.update_message').fadeOut(300, function() { $(this).remove(); });
}, 3000);
});<file_sep>/V.0.1/tasktrader02/views/explore.php
<?php
// Enable error logging:
//error_reporting(E_ALL ^ E_NOTICE);
error_reporting(E_ALL);
ini_set('display_errors', 'on');
// mysqli connection via user-defined function
include ('../my_connect.php');
$mysqli = get_mysqli_conn();
?>
<!DOCTYPE html>
<head>
<title>Tasktrader | Dashboard</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="../static/main.css">
<link href="https://fonts.googleapis.com/css?family=Muli:200,300,300i,400,600,600i,700,800,900" rel="stylesheet">
</head>
<body>
<div class="wrapper">
<?php
require('nav.php');
?>
<section class="explore_page">
<div class="heading">
<h2>Explore</h2>
</div>
<div class="create_apply_wrapper">
<a href="create.php">
<div class="ca_wrapper">
<div class="ca_content">
<span>POST</span><br> a task
</div>
</div>
</a>
<a href="tasks.php">
<div class="ca_wrapper">
<div class="ca_content">
<span>Apply</span><br> to tasks
</div>
</div>
</a>
</div>
<div class="new_wrapper">
<h4>Closing Soon</h4>
<!-- Query to get the first four tasks that are closing soon -->
<div class="border"></div>
<div class="new_inner_wrapper" style="">
<?php
// SQL statement
$sql = "SELECT T.ID, T.task_title, DATE_ADD(T.start_date, INTERVAL -7 DAY) AS deadline, COUNT(A.employee_id) AS applications, T.start_date FROM Task T LEFT JOIN Applied_to_Task A ON T.ID = A.task_id WHERE T.status_id = 1 AND DATE_ADD(T.start_date, INTERVAL -7 DAY) > CURRENT_TIMESTAMP GROUP BY T.id ORDER BY T.start_date ASC LIMIT 4";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->execute();
// Bind result variables
$stmt->bind_result($t_id, $task_title, $deadline, $applications, $start_date);
/* fetch values */
while ($stmt->fetch())
{
print "<div class='new_box'>
<div class='box_icon' id='info'><a href='taskresult.php?id=$t_id' style='color: initial; text-decoration:none'><i class='fa fa-info' aria-hidden='true'></a></i></div>
<div class='box_icon' id='shortlist'><i class='fa fa-heart-o' aria-hidden='true'></i></div>
<div class='upper_box'>
<span class='box_text'><h4>$task_title</h4></span>
</div>
<div class='lower_box'>
<span class='box_desc'>Deadline: $deadline</br># of Applications: $applications</span>
</div>
</div>";
}
/* close statement and connection*/
$stmt->close();
?>
</div>
</div>
<div class="new_wrapper">
<h4>Recommended For You</h4>
<div class="border"></div>
<div class="new_inner_wrapper" style="">
<?php
// SQL statement
$sql = "SELECT M.task_title,
DATE_ADD(M.start_date, INTERVAL -7 DAY) AS deadline,
FLOOR((M.skill_match*100/R.required_skill_ct)) AS match_out,
COUNT(A.employee_id) AS applications
FROM (SELECT T.ID, T.task_title, T.start_date, T.status_id, COUNT(skill_id) AS skill_match FROM Task T LEFT JOIN Task_Skills TS on T.id = TS.task_id INNER JOIN Employee_Skills ES ON TS.skill_id = ES.skills_id WHERE ES.employee_id = 10 GROUP BY ID) M
LEFT JOIN (SELECT T.ID, COUNT(TS.skill_id) AS required_skill_ct FROM Task T LEFT JOIN Task_Skills TS on T.id = TS.task_id GROUP BY T.ID) R
ON M.ID = R.ID
LEFT JOIN Applied_to_Task A ON M.ID = A.task_id
WHERE M.status_id = 1 AND DATE_ADD(M.start_date, INTERVAL -7 DAY) > CURRENT_TIMESTAMP GROUP BY M.ID ORDER BY (M.skill_match/R.required_skill_ct) DESC, M.start_date ASC LIMIT 4";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->execute();
// Bind result variables
$stmt->bind_result($task_title, $deadline, $match, $applications);
/* fetch values */
while ($stmt->fetch())
{
print "<div class='new_box'>
<div class='box_icon' id='info'><a href='taskresult.php?id=$t_id' style='color: initial; text-decoration:none'><i class='fa fa-info' aria-hidden='true'></i></a></div>
<div class='box_icon' id='shortlist'><i class='fa fa-heart-o' aria-hidden='true'></i></div>
<div class='upper_box'>
<span class='box_text'><h4>$task_title</h4></span>
</div>
<div class='lower_box'>
<span class='box_desc'>Deadline: $deadline</br># of Applications: $applications</br>Skills Match: $match%</span>
</div>
</div>";
}
/* close statement and connection*/
$stmt->close();
?>
</div>
</div>
<div class="new_wrapper">
<h4>At Your Location</h4>
<div class="border"></div>
<div class="new_inner_wrapper" style="">
<?php
// SQL statement
$sql = "SELECT T.ID, T.task_title, DATE_ADD(T.start_date, INTERVAL -7 DAY) AS deadline, COUNT(A.employee_id) AS applications, T.start_date FROM Task T LEFT JOIN Applied_to_Task A ON T.ID = A.task_id WHERE T.status_id = 1 AND DATE_ADD(T.start_date, INTERVAL -7 DAY) > CURRENT_TIMESTAMP AND T.location_id = 1 GROUP BY T.id ORDER BY T.start_date ASC LIMIT 4";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->execute();
// Bind result variables
$stmt->bind_result($t_id, $task_title, $deadline, $applications, $start_date);
/* fetch values */
while ($stmt->fetch())
{
print "<div class='new_box'>
<div class='box_icon' id='info'><a href='taskresult.php?id=$t_id' style='color: initial; text-decoration:none'><i class='fa fa-info' aria-hidden='true'></a></i></div>
<div class='box_icon' id='shortlist'><i class='fa fa-heart-o' aria-hidden='true'></i></div>
<div class='upper_box'>
<span class='box_text'><h4>$task_title</h4></span>
</div>
<div class='lower_box'>
<span class='box_desc'>Deadline: $deadline</br># of Applications: $applications</span>
</div>
</div>";
}
/* close statement and connection*/
$stmt->close();
$mysqli->close();
?>
</div>
</div>
</section>
</div>
</body>
</html><file_sep>/V.0.1/tasktrader02/tasktrader/migrations/0015_auto_20171203_0319.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-03 03:19
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('tasktrader', '0014_location_company_id'),
]
operations = [
migrations.RemoveField(
model_name='account',
name='owner',
),
migrations.RemoveField(
model_name='applied_task',
name='employee_id',
),
migrations.RemoveField(
model_name='applied_task',
name='task_id',
),
migrations.RemoveField(
model_name='cv',
name='employee',
),
migrations.RemoveField(
model_name='department',
name='company_id',
),
migrations.RemoveField(
model_name='employee',
name='department',
),
migrations.RemoveField(
model_name='employee',
name='location',
),
migrations.RemoveField(
model_name='employee',
name='supervisor',
),
migrations.RemoveField(
model_name='employee_skills',
name='employee_id',
),
migrations.RemoveField(
model_name='employee_skills',
name='skill_id',
),
migrations.RemoveField(
model_name='filled_task',
name='employee_id',
),
migrations.RemoveField(
model_name='filled_task',
name='task_id',
),
migrations.RemoveField(
model_name='location',
name='company_id',
),
migrations.RemoveField(
model_name='picture',
name='employee',
),
migrations.RemoveField(
model_name='posted_task',
name='employee_id',
),
migrations.RemoveField(
model_name='posted_task',
name='task_id',
),
migrations.RemoveField(
model_name='random_task',
name='employee_id',
),
migrations.RemoveField(
model_name='random_task',
name='task_id',
),
migrations.RemoveField(
model_name='task',
name='department',
),
migrations.RemoveField(
model_name='task',
name='location',
),
migrations.RemoveField(
model_name='task',
name='status',
),
migrations.RemoveField(
model_name='task_skills',
name='skill_id',
),
migrations.RemoveField(
model_name='task_skills',
name='task_id',
),
migrations.DeleteModel(
name='Account',
),
migrations.DeleteModel(
name='Applied_Task',
),
migrations.DeleteModel(
name='Company',
),
migrations.DeleteModel(
name='CV',
),
migrations.DeleteModel(
name='Department',
),
migrations.DeleteModel(
name='Employee',
),
migrations.DeleteModel(
name='Employee_Skills',
),
migrations.DeleteModel(
name='Filled_Task',
),
migrations.DeleteModel(
name='Location',
),
migrations.DeleteModel(
name='Picture',
),
migrations.DeleteModel(
name='Posted_Task',
),
migrations.DeleteModel(
name='Random_Task',
),
migrations.DeleteModel(
name='Skill',
),
migrations.DeleteModel(
name='Status',
),
migrations.DeleteModel(
name='Task',
),
migrations.DeleteModel(
name='Task_Skills',
),
]
<file_sep>/V.0.1/tasktrader02/views/taskresult.php
<?php
// Enable error logging:
//error_reporting(E_ALL ^ E_NOTICE);
//error_reporting(E_ALL);
//ini_set('display_errors', 'on');
// mysqli connection via user-defined function
include ('../my_connect.php');
$mysqli = get_mysqli_conn();
//If there is a post request and there is Id of Task
if (!empty($_POST) && ($_POST['id'])){
$task_id = $_POST['id'];
$stmt2 = $mysqli-> prepare("INSERT INTO Applied_to_Task(task_id, employee_id) VALUES (?,10)");
$stmt2->bind_param('i', $task_id);
//if query executed, get the ID of the inserted row
if($stmt2->execute()) {
echo "<div class='update_message'>Congratz! you've applied to Task $task_id!</div>";
} else {
echo "error";
}
$stmt2->free_result();
}
$id = $_GET['id'];
$view = $_GET['view'];
//2 Select all the information about the specific task
$sql = "SELECT *"
. "FROM Task "
. "WHERE ID = ?";
$stmt = $mysqli->prepare($sql);
$stmt->bind_param('i', $id);
$stmt->execute();
// Bind result variables
$stmt->bind_result($t_id, $t_title, $t_description, $t_startdate, $t_enddate, $t_commitment, $location_id, $department_id, $status_id);
$stmt->fetch();
$stmt->free_result();
$mysqli->close();
?>
<!DOCTYPE html>
<head>
<title>Tasktrader | Dashboard</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="../static/main.css">
<link href="https://fonts.googleapis.com/css?family=Muli:200,300,300i,400,600,600i,700,800,900" rel="stylesheet">
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="<KEY>
crossorigin="anonymous"></script>
<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
</head>
<body>
<div class="wrapper">
<?php
require('nav.php');
?>
<section class="explore_page">
<div class="heading">
<h2>Task ID: <?php echo "$t_id"; ?> </h2>
</div>
<div>
<!-- <div class="thumbnail row"> -->
<label class="control-label col-sm-2" for="task_title">Task Title:</label>
<h5><?php echo "$t_title"; ?> </h5>
<!-- </div> -->
<div class="thumbnail row">
<label class="control-label col-sm-2" for="task_title">Task Description:</label>
<p class="col-sm-10"><?php echo "$t_description"; ?> </p>
</div>
<div class="thumbnail row">
<label class="control-label col-sm-2" for="task_title">Start Date</label>
<p class="col-sm-4"><?php echo "$t_startdate"; ?> </p>
<label class="control-label col-sm-2" for="task_title">End Date</label>
<p class="col-sm-4"><?php echo "$t_enddate"; ?> </p>
</div>
<div class="thumbnail row">
<label class="control-label col-sm-2" for="task_title">Location</label>
<p class="col-sm-4"><?php echo "$location_id"; ?> </p>
<label class="control-label col-sm-2" for="task_title">Department</label>
<p class="col-sm-4"><?php echo "$department_id"; ?> </p>
</div>
<div class="thumbnail row">
<label class="control-label col-sm-2" for="task_title">Weekly Time Commitment</label>
<p class="col-sm-4"><?php echo "$t_commitment"; ?> hrs/week</p>
<label class="control-label col-sm-2" for="task_title">Status Id</label>
<p class="col-sm-4"><?php echo "$status_id"; ?> </p>
</div>
<?php
if ($view == "applied") {
echo "<form action='applied.php' method='post'><input type='hidden' name='id' value='$t_id'><input type='submit' name='cancel' class='save_button' value='Cancel Application'></form>";
} else {
echo "<form action='taskresult.php?id=$id&view=applied' method='post'><input type='hidden' name='id' value='$t_id'><input type='submit' class='save_button' name='apply' value='Apply To Task'></form>";
}
?>
</div>
</section>
</div>
</body>
</html><file_sep>/V.0.0/views/tasks.php
<?php
// Enable error logging:
//error_reporting(E_ALL ^ E_NOTICE);
//error_reporting(E_ALL);
//ini_set('display_errors', 'on');
// mysqli connection via user-defined function
include ('../my_connect.php');
$mysqli = get_mysqli_conn();
//if there is no POST request, GET the default information (ALL TASKS)
if (empty($_POST)){
// SQL statement
$sql = "SELECT DISTINCT T.ID,`task_title`, `start_date`, D.department_name, L.campus_name , `weekly_time_commitment` FROM `Task` AS T INNER JOIN `Applied_to_Task` AS A ON T.ID = A.task_id INNER JOIN `Location` AS L ON T.location_id = L.ID INNER JOIN `Department` As D ON T.department_id = D.ID \n"
. "WHERE T.status_id = 1 \n"
. "ORDER BY T.ID ASC "
. "LIMIT 500";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->execute();
// Bind result variables
$stmt->bind_result($id, $task_title, $start_date, $department_name, $campus_name, $timecom_result);
/* fetch values */
while ($stmt->fetch()) {
$message .= "<tr><td><a class='td_link' href='taskresult.php?id=$id'>$task_title</a></td><td>$start_date</td><td>$department_name</td><td>$campus_name</td><td>$timecom_result</td></tr>";
}
/* close statement and connection*/
$stmt->close();
$mysqli->close();
} else {
$location = $_POST['location'];
$tcommitment = $_POST['tcommitment'];
$department = $_POST['department'];
//Selecting only Location
if ((!$_POST['search_keyword']) && ($_POST['location_checked']) && (!$_POST['department_checked']) && (!$_POST['tcommitment_checked'])){
//creating query
$sql = "SELECT DISTINCT T.ID,`task_title`, `start_date`, D.department_name, L.campus_name , `weekly_time_commitment` FROM `Task` AS T INNER JOIN `Applied_to_Task` AS A ON T.ID = A.task_id INNER JOIN `Location` AS L ON T.location_id = L.ID INNER JOIN `Department` As D ON T.department_id = D.ID \n"
. "WHERE T.status_id = 1 AND T.location_id = ? ORDER BY T.ID ASC";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->bind_param("i", $location);
if($stmt->execute()) {
$stmt->bind_result($id, $task_title, $start_date, $department_name, $campus_name, $timecom_result);
/* fetch values */
while ($stmt->fetch()) {
$message .= "<tr><td><a class='td_link' href='taskresult.php?id=$id'>$task_title</a></td><td>$start_date</td><td>$department_name</td><td>$campus_name</td><td>$timecom_result</td></tr>";
}
} else {
echo "<br>Error <br>";
};
$stmt->close();
$mysqli->close();
}
//if there is just department
if ((!$_POST['search_keyword']) && (!$_POST['location_checked']) && ($_POST['department_checked']) && (!$_POST['tcommitment_checked'])){
$sql = "SELECT DISTINCT T.ID,`task_title`, `start_date`, D.department_name, L.campus_name , `weekly_time_commitment` "
. "FROM `Task` AS T INNER JOIN `Applied_to_Task` AS A ON T.ID = A.task_id "
. "INNER JOIN `Location` AS L ON T.location_id = L.ID "
. "INNER JOIN `Department` As D ON T.department_id = D.ID \n"
. "WHERE T.status_id = 1 AND T.department_id = ? ORDER BY T.ID ASC";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->bind_param("i", $department);
if($stmt->execute()) {
$stmt->bind_result($id, $task_title, $start_date, $department_name, $campus_name, $timecom_result);
/* fetch values */
while ($stmt->fetch()) {
$message .= "<tr><td><a class='td_link' href='taskresult.php?id=$id'>$task_title</a></td><td>$start_date</td><td>$department_name</td><td>$campus_name</td><td>$timecom_result</td></tr>";
}
} else {
echo "<br>Error <br>";
};
$stmt->close();
$mysqli->close();
}
//if there is just tcommmitment
if ((!$_POST['search_keyword']) && (!$_POST['location_checked']) && (!$_POST['department_checked']) && ($_POST['tcommitment_checked'])){
$sql = "SELECT DISTINCT T.ID,`task_title`, `start_date`, D.department_name, L.campus_name , `weekly_time_commitment` "
. "FROM `Task` AS T INNER JOIN `Applied_to_Task` AS A ON T.ID = A.task_id "
. "INNER JOIN `Location` AS L ON T.location_id = L.ID "
. "INNER JOIN `Department` As D ON T.department_id = D.ID \n"
. "WHERE T.status_id = 1 AND T.weekly_time_commitment < ? ORDER BY T.ID ASC";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->bind_param("i", $tcommitment);
if($stmt->execute()) {
$stmt->bind_result($id, $task_title, $start_date, $department_name, $campus_name, $timecom_result);
/* fetch values */
while ($stmt->fetch()) {
$message .= "<tr><td><a class='td_link' href='taskresult.php?id=$id'>$task_title</a></td><td>$start_date</td><td>$department_name</td><td>$campus_name</td><td>$timecom_result</td></tr>";
}
} else {
echo "<br>Error <br>";
};
$stmt->close();
$mysqli->close();
}
//if there is just keywords location department
if ($_POST['search_keyword'] && ($_POST['location_checked']) && ($_POST['department_checked']) && (!$_POST['tcommitment_checked'])) {
$search = $_POST['search_keyword'];
//add in wildcard characters for query
$search = '%'.$search.'%';
echo $search;
//prepare select query
$sql = "SELCT DISTINCT t1.ID, t1.task_title, t1.start_date, t1.department_name, t1.campus_name, t1.weekly_time_commitment FROM ( SELECT DISTINCT T.ID,`task_title`, `start_date`, `weekly_time_commitment`, D.department_name, L.campus_name, `status_id` FROM `Task` AS T INNER JOIN `Applied_to_Task` AS A ON T.ID = A.task_id INNER JOIN `Location` AS L ON T.location_id = L.ID INNER JOIN `Department` As D ON T.department_id = D.ID WHERE T.status_id = 1 AND T.location_id = ? AND T.department_id = ?) AS t1 WHERE t1.task_title LIKE ? OR t1.campus_name LIKE ? OR t1.department_name LIKE ?";
echo $location;
echo $department;
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->bind_param("iisss", $location, $department, $search, $search, $search);
//if query is executed, bind results
if($stmt->execute()) {
$stmt->bind_result($id, $task_title, $start_date, $department_name, $campus_name, $timecom_result);
/* fetch values */
while ($stmt->fetch()) {
$message .= "<tr><td><a class='td_link' href='taskresult.php?id=$id'>$task_title</a></td><td>$start_date</td><td>$department_name</td><td>$campus_name</td><td>$timecom_result</td></tr>";
}
} else {
echo "<br>Error <br>";
};
$stmt->close();
$mysqli->close();
}
//if there is location and department
if ((!$_POST['search_keyword']) && ($_POST['location_checked']) && ($_POST['department_checked']) && (!$_POST['tcommitment_checked'])){
$sql = "SELECT DISTINCT T.ID,`task_title`, `start_date`, D.department_name, L.campus_name , `weekly_time_commitment` "
. "FROM `Task` AS T "
. "INNER JOIN `Location` AS L ON T.location_id = L.ID "
. "INNER JOIN `Department` As D ON T.department_id = D.ID \n"
. "WHERE T.status_id = 1 AND T.location_id = ? AND T.department_id = ? ORDER BY T.ID ASC";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->bind_param("ii", $location, $department);
if($stmt->execute()) {
$stmt->bind_result($id, $task_title, $start_date, $department_name, $campus_name, $timecom_result);
/* fetch values */
while ($stmt->fetch()) {
$message .= "<tr><td><a class='td_link' href='taskresult.php?id=$id'>$task_title</a></td><td>$start_date</td><td>$department_name</td><td>$campus_name</td><td>$timecom_result</td></tr>";
}
} else {
echo "<br>Error <br>";
};
$stmt->close();
$mysqli->close();
}
//if they're keywords and location & tcommitment
if ($_POST['search_keyword'] && ($_POST['location_checked']) && (!$_POST['department_checked']) && ($_POST['tcommitment_checked'])) {
$search = $_POST['search_keyword'];
//add in wildcard characters for query
$search = '%'.$search.'%';
//prepare select query
$sql = "SELECT DISTINCT t1.ID, t1.task_title, t1.start_date, t1.department_name, t1.campus_name, t1.weekly_time_commitment FROM ( SELECT DISTINCT T.ID,`task_title`, `start_date`, `weekly_time_commitment`, D.department_name, L.campus_name, `status_id` FROM `Task` AS T INNER JOIN `Applied_to_Task` AS A ON T.ID = A.task_id INNER JOIN `Location` AS L ON T.location_id = L.ID INNER JOIN `Department` As D ON T.department_id = D.ID WHERE T.status_id = 1 AND T.location_id = ? AND T.weekly_time_commitment < ?) AS t1 WHERE t1.task_title LIKE ? OR t1.campus_name LIKE ? OR t1.department_name LIKE ?";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->bind_param("iisss", $location, $tcommitment, $search,$search,$search);
//if query is executed, bind results
if($stmt->execute()) {
$stmt->bind_result($id, $task_title, $start_date, $department_name, $campus_name, $timecom_result);
/* fetch values */
while ($stmt->fetch()) {
$message .= "<tr><td><a class='td_link' href='taskresult.php?id=$id'>$task_title</a></td><td>$start_date</td><td>$department_name</td><td>$campus_name</td><td>$timecom_result</td></tr>";
}
} else {
echo "<br>Error <br>";
};
$stmt->close();
$mysqli->close();
}
//if they're keywords and department & tcommitment
if ($_POST['search_keyword'] && (!$_POST['location_checked']) && ($_POST['department_checked']) && ($_POST['tcommitment_checked'])) {
$search = $_POST['search_keyword'];
//add in wildcard characters for query
$search = '%'.$search.'%';
//prepare select query
$sql = "SELECT DISTINCT t1.ID, t1.task_title, t1.start_date, t1.department_name, t1.campus_name, t1.weekly_time_commitment FROM ( SELECT DISTINCT T.ID,`task_title`, `start_date`, `weekly_time_commitment`, D.department_name, L.campus_name, `status_id` FROM `Task` AS T INNER JOIN `Applied_to_Task` AS A ON T.ID = A.task_id INNER JOIN `Location` AS L ON T.location_id = L.ID INNER JOIN `Department` As D ON T.department_id = D.ID WHERE T.status_id = 1 AND T.department_id = ? AND T.weekly_time_commitment < ?) AS t1 WHERE t1.task_title LIKE ? OR t1.campus_name LIKE ? OR t1.department_name LIKE ?";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->bind_param("iisss", $department, $tcommitment, $search,$search,$search);
//if query is executed, bind results
if($stmt->execute()) {
$stmt->bind_result($id, $task_title, $start_date, $department_name, $campus_name, $timecom_result);
/* fetch values */
while ($stmt->fetch()) {
$message .= "<tr><td><a class='td_link' href='taskresult.php?id=$id'>$task_title</a></td><td>$start_date</td><td>$department_name</td><td>$campus_name</td><td>$timecom_result</td></tr>";
}
} else {
echo "<br>Error <br>";
};
$stmt->close();
$mysqli->close();
}
//if they're keywords and ALL FILTERS
if ($_POST['search_keyword'] && ($_POST['location_checked']) && ($_POST['department_checked']) && ($_POST['tcommitment_checked'])) {
$search = $_POST['search_keyword'];
//add in wildcard characters for query
$search = '%'.$search.'%';
//prepare select query
$sql = "SELECT DISTINCT t1.ID, t1.task_title, t1.start_date, t1.department_name, t1.campus_name, t1.weekly_time_commitment FROM ( SELECT DISTINCT T.ID,`task_title`, `start_date`, `weekly_time_commitment`, D.department_name, L.campus_name, `status_id` FROM `Task` AS T INNER JOIN `Location` AS L ON T.location_id = L.ID INNER JOIN `Department` As D ON T.department_id = D.ID WHERE T.status_id = 1 AND T.location_id = ? AND T.department_id = ? AND T.weekly_time_commitment < ?) AS t1 WHERE t1.task_title LIKE ? OR t1.campus_name LIKE ? OR t1.department_name LIKE ?";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->bind_param("iiisss", $location, $department, $tcommitment, $search,$search,$search);
//if query is executed, bind results
if($stmt->execute()) {
$stmt->bind_result($id, $task_title, $start_date, $department_name, $campus_name, $timecom_result);
/* fetch values */
while ($stmt->fetch()) {
$message .= "<tr><td><a class='td_link' href='taskresult.php?id=$id'>$task_title</a></td><td>$start_date</td><td>$department_name</td><td>$campus_name</td><td>$timecom_result</td></tr>";
}
} else {
echo "<br>Error <br>";
};
$stmt->close();
$mysqli->close();
}
//if they're keywords and NO FILTERS
if ($_POST['search_keyword'] && (!$_POST['location_checked']) && (!$_POST['department_checked']) && (!$_POST['tcommitment_checked'])) {
$search = $_POST['search_keyword'];
//add in wildcard characters for query
$search = '%'.$search.'%';
//prepare select query
$sql = "SELECT DISTINCT t1.ID, t1.task_title, t1.start_date, t1.department_name, t1.campus_name, t1.weekly_time_commitment FROM ( SELECT DISTINCT T.ID,`task_title`, `start_date`, `weekly_time_commitment`, D.department_name, L.campus_name, `status_id` FROM `Task` AS T INNER JOIN `Location` AS L ON T.location_id = L.ID INNER JOIN `Department` As D ON T.department_id = D.ID WHERE T.status_id = 1) AS t1 WHERE t1.task_title LIKE ? OR t1.campus_name LIKE ? OR t1.department_name LIKE ?";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->bind_param("sss", $search,$search,$search);
//if query is executed, bind results
if($stmt->execute()) {
$stmt->bind_result($id, $task_title, $start_date, $department_name, $campus_name, $timecom_result);
/* fetch values */
while ($stmt->fetch()) {
$message .= "<tr><td><a class='td_link' href='taskresult.php?id=$id'>$task_title</a></td><td>$start_date</td><td>$department_name</td><td>$campus_name</td><td>$timecom_result</td></tr>";
}
} else {
echo "<br>Error <br>";
};
$stmt->close();
$mysqli->close();
}
}
?>
<head>
<title>Tasktrader | Tasks</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="../static/main.css">
<link href="https://fonts.googleapis.com/css?family=Muli:200,300,300i,400,600,600i,700,800,900" rel="stylesheet">
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="<KEY>
crossorigin="anonymous"></script>
<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
</head>
<body>
<div class="wrapper">
<?php
require('nav.php');
?>
<section class="explore_page">
<div class="heading">
<h2>Search Tasks</h2>
</div>
<div class="search_wrapper">
<!-- Search Form Begins Here -->
<form class="" action="tasks.php" method="POST">
<div class="input-group col-xs-6">
<!--Keyword Search Input Form -->
<input type="text" name="search_keyword" class="form-control" id="search_task" placeholder="Search Keywords">
<span class="input-group-btn">
<!--Search Button to submit request -->
<button type="submit" class="btn btn-default btn-inverse">Search</button>
</span>
</div>
<br>
<!-- Filter Dropdowns -->
<label>Filter:</label>
<br><br>
<div class="row">
<div class="form-group col-xs-4">
<input type="checkbox" name="department_checked" class="department_checked" checked data-toggle="toggle" data-size="mini">
<label for="department" class="control-label">Department:</label>
<select class="form-control" name="department">
<option value="1" >Executive Board</option>
<option value="2" >Operations</option>
<option value="3" >Corporate Strategy</option>
<option value="4" >Research and Development</option>
<option value="5" >Human Resources</option>
<option value="6" >Marketing</option>
<option value="7" >Advertising</option>
<option value="8" >Product Development</option>
<option value="9" >Accounting</option>
<option value="10" >Business Intelligence</option>
<option value="11" >Information Technology</option>
<option value="12" >Information Solutions</option>
<option value="13" >Instagram</option>
<option value="14" >Oculus</option>
<option value="14" >WhatsApp</option>
</select>
</div>
<div class="form-group col-xs-4">
<input type="checkbox" name="location_checked" class="location_checked" checked data-toggle="toggle" data-size="mini">
<label for="location" class="control-label">Location:</label>
<select class="form-control filter_location" name="location">
<option value="1" >HeadQuarters</option>
<option value="2" >Mars Discovery District</option>
<option value="3" >Roths Child Boulevard</option>
<option value="4" >Internet City</option>
</select>
</div>
<div class="form-group col-xs-4">
<input type="checkbox" class="tcommitment_checked" name="tcommitment_checked" checked data-toggle="toggle" data-size="mini">
<label for="tcommitment" class="control-label filter_commitment">Time Commitment:</label>
<input class="form-control" name="tcommitment" type="number" min="1" max="20" step="1">
</div>
</div>
</form>
</div>
<div>
<!-- Search Table Results -->
<table class="table table-striped">
<thead>
<tr>
<th>Title</th>
<th>Deadline</th>
<th>Time Commitment</th>
</tr>
</thead>
<tbody>
<?php echo $message; ?>
</tbody>
</table>
</div>
</section>
</div>
</body>
</html><file_sep>/V.0.1/tasktrader02/tasktrader/admin.py
from django.contrib import admin
# Register your models here.
from .models import *
admin.site.register(Company)
admin.site.register(Location)
admin.site.register(Department)
admin.site.register(Employee)
admin.site.register(Account)
admin.site.register(Status)
admin.site.register(Task)
admin.site.register(CV)
admin.site.register(Picture)
admin.site.register(Skill)
admin.site.register(Task_Skills)
admin.site.register(Posted_Task)
admin.site.register(Applied_Task)
admin.site.register(Filled_Task)
admin.site.register(Random_Task)
<file_sep>/V.0.1/tasktrader02/views/profile.php
<?php
// Enable error logging:
//error_reporting(E_ALL ^ E_NOTICE);
//error_reporting(E_ALL);
//ini_set('display_errors', 'on');
// mysqli connection via user-defined function
include ('../my_connect.php');
header("Cache-Control: no-cache");
$mysqli = get_mysqli_conn();
$photo = "";
//Update Skills in Profile
if(isset($_POST['submit'])){
//split skill keywords into an array and capitalize them
$myArray = explode(',', strtoupper($_POST['tags']));
//prepare Select Query to verify if skills are in skills table
$verifySkill_sql = "SELECT Count(*)"
. "FROM Skill "
. "WHERE skill_name = ?";
$stmt = $mysqli->prepare($verifySkill_sql);
//iterate through each keyword to check if they are in skill table
foreach ($myArray as $value) {
if ($stmt) {
$stmt->bind_param('s', $value);
$stmt->execute();
$stmt->bind_result($result);
//if we do not have skills, add it to the insertSkill array
if($stmt->fetch()){
$allSkills[] = $value;
if ($result < 1){
$insertSkill[] = $value;
}
} else {
printf("Errormessage: %s\n", $mysqli->error);
}
}
}
$stmt->free_result();
//prepare insert query to skills table
$stmt2 = $mysqli->prepare("INSERT INTO Skill (skill_name) VALUES (?)");
if ($stmt2){
foreach ($insertSkill as $skill) {
$stmt2->bind_param('s', $skill);
if($stmt2->execute()){
} else {
}
}
} else {
}
//close connection
$stmt2->free_result();
//add skills to skills_employee table
$stmt4 = $mysqli->prepare("INSERT INTO Employee_Skills(employee_id, skills_id) SELECT 10, S.ID FROM Skill S WHERE S.skill_name = ? ");
if ($stmt4){
foreach ($allSkills as $added) {
$stmt4->bind_param('s', $added);
if($stmt4->execute()){
echo "<div class='update_message'>Skills Sucessfully Updated!</div>";
} else {
//echo "insert failed";
}
}
} else {
echo "Insert failed !";
}
$stmt2->free_result();
}
//prepare Select Query to show all skills of the user
$showSkills_sql = "SELECT DISTINCT S.skill_name FROM `Employee_Skills` E, `Skill` S WHERE E.skills_id = S.ID AND E.employee_id = 10";
$stmt3 = $mysqli->prepare($showSkills_sql);
if ($stmt3) {
$stmt3->execute();
$stmt3->bind_result($skill_result);
}
while ($stmt3->fetch())
{
$show_skills[] = $skill_result;
$outer_skills .= "<span class='show_result'>$skill_result, <br></span>";
}
$stmt3->free_result();
// check if a file was submitted
if(isset($_FILES['userfile']))
{
try {
$message= upload($mysqli); //this will upload your image
echo $message;
//header("Refresh:0");
}
catch(Exception $e) {
echo $e->getMessage();
echo 'Sorry, could not upload file';
}
}
// uploading photo
// Referenced from vikasmahajan - July 7, 2010
function upload($mysqli) {
$maxsize = 10000000; //set to approx 10 MB
//check associated error code
if($_FILES['userfile']['error']==UPLOAD_ERR_OK) {
//check whether file is uploaded with HTTP POST
if(is_uploaded_file($_FILES['userfile']['tmp_name'])) {
//checks size of uploaded image on server side
if( $_FILES['userfile']['size'] < $maxsize) {
//checks whether uploaded file is of image type
//if(strpos(mime_content_type($_FILES['userfile']['tmp_name']),"image")===0) {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
if(strpos(finfo_file($finfo, $_FILES['userfile']['tmp_name']),"image")===0) {
// prepare the image for insertion
$imgData =addslashes (file_get_contents($_FILES['userfile']['tmp_name']));
$picture_sql = "UPDATE Picture SET image = '{$imgData}', name = '{$_FILES['userfile']['name']}' WHERE account_id = 10";
$stmt5 = $mysqli->prepare($picture_sql);
$stmt5->execute();
$message="<div class='update_message'>Image Sucessfully Updated!</div>";
$stmt5->free_result();
}
else
$message="<p>Uploaded file is not an image.</p>";
}
else {
// if the file is not less than the maximum allowed, print an error
$message='<div>File exceeds the Maximum File limit</div>
<div>Maximum File limit is '.$maxsize.' bytes</div>
<div>File '.$_FILES['userfile']['name'].' is '.$_FILES['userfile']['size'].
' bytes</div><hr />';
}
}
else
$message="File not uploaded successfully.";
}
else {
$message= picture_error($_FILES['userfile']['error']);
}
return $message;
}
//Return Error if we get it
function picture_error($error_code) {
switch ($error_code) {
case UPLOAD_ERR_INI_SIZE:
return 'File exceeds the upload_max_filesize directive in php.ini';
case UPLOAD_ERR_FORM_SIZE:
return 'File exceeds the MAX_FILE_SIZE directive that was specified in the HTML form';
case UPLOAD_ERR_PARTIAL:
return 'File was only partially uploaded';
case UPLOAD_ERR_NO_FILE:
return 'No file was uploaded';
case UPLOAD_ERR_NO_TMP_DIR:
return 'Missing a temporary folder';
case UPLOAD_ERR_CANT_WRITE:
return 'Failed to write file to disk';
case UPLOAD_ERR_EXTENSION:
return 'File upload stopped by extension';
default:
return 'Unknown upload error';
}
}
function getPhoto($mysqli){
// get the image from the db
$get_picture_sql = "SELECT image FROM Picture WHERE account_id = 10";
$photo_stmt = $mysqli->prepare($get_picture_sql);
// the result of the query
$photo_stmt->execute();
$photo_stmt->bind_result($result);
if ($photo_stmt->fetch()){
//$photo = '<img src="data:image/jpeg;base64,'.base64_encode( $result ).'"/>';
$photo2 = 'background: url(data:image/jpeg;base64,'.base64_encode( $result ).') no-repeat center center/cover !important;';
return $photo2;
}
$photo_stmt->free_result();
}
$photo2 = getPhoto($mysqli);
$mysqli->close();
?>
<!DOCTYPE html>
<head>
<title>Tasktrader | Profile</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="../static/main.css">
<link href="https://fonts.googleapis.com/css?family=Muli:200,300,300i,400,600,600i,700,800,900" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-tagsinput/1.3.6/jquery.tagsinput.min.css">
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="<KEY>
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-tagsinput/1.3.6/jquery.tagsinput.min.js"></script>
<script src="../static/tasktrader.js"></script>
</head>
<body>
<div class="wrapper">
<?php
require('nav.php');
?>
<section class="explore_page">
<div class="heading">
<h2>Hi Cindy!</h2>
</div>
<div class="row" style="margin-top: 15px">
<div class="unedited_info thumbnail col-xs-6"><strong>Name:</strong> <NAME></div>
<div class="unedited_info thumbnail col-xs-6"><strong>Job Title: </strong> Programmer</div>
</div>
<div class="row">
<div class="unedited_info thumbnail col-xs-6"><strong>Department:</strong> Software</div>
<div class="unedited_info thumbnail col-xs-6"><strong>Location:</strong> San Franscisco</div>
</div>
<div class="profile_content">
<div class="profile_picture profile_section" name="profile_pic_form" style="<?php echo $photo2; ?>">
<i class="fa fa-cloud-upload" aria-hidden="true"></i>
</div>
<div class="profile_info">
<div class="profile_section" name="resume_form"><label>Resume:</label>resume.pdf</div>
<div class="profile_section" name="skills_form"><label> Skills: </label>
<p>
<?php echo $outer_skills; ?>
</p>
</div>
</div>
<div class="profile_info" id="skills_form">
<form class="form-horizontal" method="POST">
<h3>Update Skills</h3>
<br>
<div class="form-group">
<label class="control-label col-sm-2" for="task_skills">Skills:</label>
<div class="col-sm-10">
<input name="tags" id="tag" value="
<?php
foreach($show_skills as $res) {
echo "$res, ";
}?>
" />
</div>
</div>
<div class="form-group">
<button type="submit" class="save_button" name="submit">Update Skills</button>
</div>
</form>
</div>
<div class="profile_info" id="resume_form">
<form enctype="multipart/form-data" action="" method="post">
<h3>Update Resume</h3>
<br>
<input type="hidden" name="MAX_FILE_SIZE" value="10000000" >
<input name="userfile" type="file" >
<input type="submit" value="Submit" >
</form>
</div>
<!-- Update Profile Picture -->
<div class="profile_info" id="profile_pic_form">
<form enctype="multipart/form-data" action="profile.php" method="post">
<h3>Update Profile Picture</h3>
<br>
<input type="hidden" name="MAX_FILE_SIZE" value="10000000" >
<input name="userfile" type="file" >
<input type="submit" value="Submit" >
</form>
</div>
</div>
</div>
</section>
</div>
</body>
</html>
<file_sep>/V.0.1/tasktrader02/tasktrader/migrations/0004_location_company.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-03 02:29
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tasktrader', '0003_random_task'),
]
operations = [
migrations.AddField(
model_name='location',
name='company',
field=models.ForeignKey(default='none', on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Company'),
preserve_default=False,
),
]
<file_sep>/V.0.1/tasktrader02/views/applied.php
<?php
include ('../my_connect.php');
$mysqli = get_mysqli_conn();
//If there is a post request
if (!empty($_POST)){
//prepare query for deleting application
$id = $_POST['id'];
$delete_sql = "DELETE "
. "FROM Applied_to_Task "
. "WHERE employee_id = 10 AND task_id = ?";
$delete_stmt = $mysqli->prepare($delete_sql);
$delete_stmt->bind_param('i', $id);
//if query executed, return a success message
if($delete_stmt->execute()){
echo "<div class='update_message'>Application for Task $id has been deleted.</div>";
}
//free result
$delete_stmt->free_result();
}
//If it's just a get request, show all applied tasks
$sql = "SELECT T.ID,`task_title`, `start_date`, L.campus_name , `status_id`\n"
. "FROM `Task` AS T \n"
. "INNER JOIN `Applied_to_Task` AS A ON T.ID = A.task_id\n"
. "INNER JOIN `Location` AS L ON T.location_id = L.ID\n"
. "WHERE A.employee_id = 10";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->execute();
// Bind result variables
$stmt->bind_result($id, $task_title, $start_date, $location, $status_id);
/* fetch values */
while ($stmt->fetch()) {
$message .= "<tr><td><a class='td_link' href='taskresult.php?id=$id&view=applied'>$task_title</a></td><td>$start_date</td><td>$location</td><td>$status_id</td><td><form action='applied.php' method='post'><input type='hidden' name ='id' value='$id'><button type='submit'>cancel</button></form></td></tr>";
}
/* close statement and connection*/
$stmt->close();
$mysqli->close();
?>
<!DOCTYPE html>
<head>
<title>Tasktrader | Applied To</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="../static/main.css">
<link href="https://fonts.googleapis.com/css?family=Muli:200,300,300i,400,600,600i,700,800,900" rel="stylesheet">
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="<KEY>
crossorigin="anonymous"></script>
<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
<script src="../static/tasktrader.js"></script>
</head>
<body>
<div class="wrapper">
<?php
require('nav.php');
?>
<section class="explore_page">
<div class="heading">
<h2>Applied To</h2>
</div>
<div class="search_wrapper">
</div>
<div>
<!--applied_to table -->
<table class="table table-striped">
<thead>
<tr>
<th>Title</th>
<th>Deadline</th>
<th>Location</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php echo $message; ?>
</tbody>
</table>
</div>
</section>
</div>
</body>
</html><file_sep>/v.0.3/tasktrader03/tasktrader/views.py
from django.shortcuts import render, redirect
from django.template import loader
from . models import *
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
import requests
import datetime
import json
import requests
from django.core.exceptions import ObjectDoesNotExist
from . models import *
from django.views.decorators.csrf import csrf_exempt
from django.urls import reverse
from django.shortcuts import render, redirect
from django.template import loader
import random
from random import randint, choice
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
import sys
# Views to access webpages created
def index(request):
return render(request, 'tasktrader/login.html')
"""
This view is used to load the "applied.html" page
Return a JSON response for the edited form or load the edit form page
"""
return HttpResponse("Hello, world. You're at the tasktrader index.")
# method to log in users to the webpage
def login(request):
try:
print("Accessed login")
if request.method == 'POST':
print("")
post_dict = request.POST
print(post_dict)
if post_dict['username']!="" and post_dict['password']!= "":
employee_signing_in = Account(user)
Employee(first_name=post_dict['first_name'])
new_employee = Employee(username=post_dict['username'])
new_employee.password = post_dict['<PASSWORD>']
account_set = Account.objects.all()
proceed = False
for account in account_set:
if account.username == new_employee.username and account.password == <PASSWORD>:
proceed = True
if proceed:
currentuser = new_employee.owner
context = {'currentuser':currentuser}
return render(request, 'tasktrader/dashboard.html',context)
else:
return HttpResponse("Access Denied")
return HttpResponse("New Employee and Account Created")
else:
return HttpResponse("Something went wrong...(login)")
return HttpResponse("Something went wrong...(login)")
else:
print("Retreiving login page...")
return render(request, 'tasktrader/login.html')
except ObjectDoesNotExist as e:
print("There is no answer that exist the database: ", str(e))
return HttpResponse("Something went wrong...(add new employee)")
except ValueError:
print("Could not convert data to an integer.")
return HttpResponse("Something went wrong...(add new employee)")
except:
print("Unexpected error:", sys.exc_info()[0])
return HttpResponse("Something went wrong...(add new employee)")
else:
print('Something went wrong...')
return HttpResponse("Something went wrong... (add new employee)")
# method to onboard new entities onto the platform
def onboarding(request):
print("Accessing oboarding method...")
print(request)
try:
company_set = Company.objects.all()
location_set = Location.objects.all()
department_set = Department.objects.all()
context = {'company_set':company_set,'location_set':location_set,'department_set':department_set}
return render(request, 'tasktrader/onboarding.html', context)
except ObjectDoesNotExist as e:
print("There is no answer that exist the database: ", str(e))
return HttpResponse("Something went wrong...(onboarding)")
except ValueError:
print("Could not convert data to an integer.")
return HttpResponse("Something went wrong...(onboarding)")
except:
print("Unexpected error:", sys.exc_info()[0])
return HttpResponse("Something went wrong...(onboarding)")
else:
print('Something went wrong...(onboarding)')
# Method to create new companies through the onboarding page
def add_new_company(request):
try:
print("Accessed add_new_company..")
if request.method == 'POST':
print("Adding new company...")
post_dict = request.POST
print(post_dict)
if post_dict['company_name']!="" :
all_companies = Company.objects.all()
add_new = True
company_name_to_add = post_dict['company_name']
company_name_to_add = company_name_to_add.upper()
for company in all_companies:
if company.company_name == company_name_to_add:
print("Company Name already exists")
add_new = False
return HttpResponse("Company Name Already Exists")
if add_new:
new_company = Company(company_name=company_name_to_add)
new_company.save()
return HttpResponse("New Company Created")
return HttpResponse("Something went wrong...(add new comp)")
return HttpResponse("Something went wrong...")
except ObjectDoesNotExist as e:
print("There is no answer that exist the database: ", str(e))
return HttpResponse("Something went wrong...(add new comp)")
except ValueError:
print("Could not convert data to an integer.")
return HttpResponse("Something went wrong...(add new comp)")
except:
print("Unexpected error:", sys.exc_info()[0])
return HttpResponse("Something went wrong...(add new comp)")
else:
print('Something went wrong...')
return HttpResponse("Something went wrong...(add new comp)")
# method to create new locations for companies throught the onboarding page
def add_new_location(request):
try:
print("Accessed add_new_location..")
if request.method == 'POST':
print("Adding new location...")
post_dict = request.POST
print(post_dict)
if post_dict['campus_name']!="" and post_dict['new_location_company_id']!= "" and post_dict['city']!="" and post_dict['country']!="" and post_dict['street_address']!="" and post_dict['postal_code']!="" :
all_locations = Location.objects.all()
add_new= True
campus_name = post_dict['campus_name']
campus_name= campus_name.upper()
location_company_id = int(post_dict['new_location_company_id'])
for location in all_locations:
if location.campus_name == campus_name and location.company_id.id == location_company_id:
add_new = False
return HttpResponse("Location Already Exists")
if add_new:
new_location = Location(campus_name=campus_name)
new_location.company_id = Company.objects.get(id = location_company_id)
new_location.city = post_dict['city']
new_location.country =post_dict['country']
new_location.street_address = post_dict['street_address']
new_location.postal_code = post_dict['postal_code']
new_location.save()
return HttpResponse("New Location Created")
return HttpResponse("Something went wrong...(add new loc)")
return HttpResponse("Something went wrong...(add new loc)")
return HttpResponse("Something went wrong...(add new loc)")
except ObjectDoesNotExist as e:
print("There is no answer that exist the database: ", str(e))
return HttpResponse("Something went wrong...(add new loc)")
except ValueError:
print("Could not convert data to an integer.")
return HttpResponse("Something went wrong...(add new loc)")
except:
print("Unexpected error:", sys.exc_info()[0])
return HttpResponse("Something went wrong...(add new loc)")
else:
print('Something went wrong...')
return HttpResponse("Something went wrong...(add new loc)")
# method to create new departments through the onboading page
def add_new_department(request):
try:
print("Accessed add_new_department..")
if request.method == 'POST':
print("Adding new department...")
post_dict = request.POST
print(post_dict)
if post_dict['department_name']!="" and post_dict['new_department_company_id']!= "":
all_departments = Department.objects.all()
add_new= True
department_name = post_dict['department_name']
department_name= department_name.upper()
department_company_id = int(post_dict['new_department_company_id'])
for department in all_departments:
if department.department_name == department_name and department.company_id.id == department_company_id:
add_new = False
return HttpResponse("Department Already Exists")
if add_new:
new_department = Department(department_name= department_name)
new_department.company_id =Company.objects.get(id = department_company_id)
new_department.save()
return HttpResponse("New Department Created")
return HttpResponse("Something went wrong...(add new dept)")
return HttpResponse("Something went wrong...(add new dept)")
return HttpResponse("Something went wrong...(add new dept)")
except ObjectDoesNotExist as e:
print("There is no answer that exist the database: ", str(e))
return HttpResponse("Something went wrong...(add new dept)")
except ValueError:
print("Could not convert data to an integer.")
return HttpResponse("Something went wrong...(add new dept)")
except:
print("Unexpected error:", sys.exc_info()[0])
return HttpResponse("Something went wrong...(add new dept)")
else:
print('Something went wrong...')
return HttpResponse("Something went wrong...(add new dept)")
# method to create new skills through the onboading page
def add_new_skill(request):
try:
print("Accessed add_new_skills..")
if request.method == 'POST':
print("Adding new skill...")
post_dict = request.POST
print(post_dict)
if post_dict['skill']!="":
all_skills = Skill.objects.all()
add_new = True
skill = post_dict['skill']
skill = skill.upper()
for item in all_skills :
if skill == item.skill_name:
add_new = False
if add_new:
new_skill = Skill(skill_name = skill)
new_skill.save()
return HttpResponse("New Skill Created")
else:
return HttpResponse("Skill Already Exists")
return HttpResponse("Something went wrong...(add new dept)")
return HttpResponse("Something went wrong...(add new dept)")
return HttpResponse("Something went wrong...(add new dept)")
except ObjectDoesNotExist as e:
print("There is no answer that exist the database: ", str(e))
return HttpResponse("Something went wrong...(add new dept)")
except ValueError:
print("Could not convert data to an integer.")
return HttpResponse("Something went wrong...(add new dept)")
except:
print("Unexpected error:", sys.exc_info()[0])
return HttpResponse("Something went wrong...(add new dept)")
else:
print('Something went wrong...')
return HttpResponse("Something went wrong...(add new dept)")
# method to create new employees through the onboading page
def add_new_employee(request):
try:
print("Accessed add_new_employee..")
if request.method == 'POST':
print("Adding new employee...")
post_dict = request.POST
print(post_dict)
if post_dict['first_name']!="" and post_dict['last_name']!= "" and post_dict['new_employee_company_id']!="" and post_dict['new_employee_location_id']!="" and post_dict['new_employee_department_id']!="" and post_dict['job_title']!="" :
new_employee = Employee(first_name=post_dict['first_name'])
new_employee.last_name = post_dict['last_name']
new_employee.job_title = post_dict['job_title']
new_employee.location = Location.objects.get(id = int(post_dict['new_employee_location_id']))
new_employee.department = Department.objects.get(id = int(post_dict['new_employee_department_id']))
new_employee.save()
new_employee_account =Account(owner = new_employee)
new_employee_account.username = str(new_employee.first_name)+"."+str(new_employee.last_name)
new_employee_account.password = str("<PASSWORD>")
new_employee_account.save()
return HttpResponse("New Employee and Account Created")
else:
return HttpResponse("Something went wrong...(add new employee)")
return HttpResponse("Something went wrong...(add new employee)")
except ObjectDoesNotExist as e:
print("There is no answer that exist the database: ", str(e))
return HttpResponse("Something went wrong...(add new employee)")
except ValueError:
print("Could not convert data to an integer.")
return HttpResponse("Something went wrong...(add new employee)")
except:
print("Unexpected error:", sys.exc_info()[0])
return HttpResponse("Something went wrong...(add new employee)")
else:
print('Something went wrong...')
return HttpResponse("Something went wrong... (add new employee)")
def applied(request):
return render(request, 'tasktrader/applied.html')
def create(request):
try:
print("Accessed create..")
if request.method == 'POST':
print("Adding new task...")
post_dict = request.POST
print(post_dict)
if post_dict['skill']!="" :
skill_list = post_dict['skill']
print(skill_list)
for skill in skill_list:
print('This is a new skill')
print(int(skill))
if post_dict['task_title']!="" and post_dict['task_description']!= "" and post_dict['start_date']!="" and post_dict['end_date']!="" and post_dict['time_commitment']!="" and post_dict['new_task_location_id']!="" and post_dict['new_task_department_id']!="" :
new_task = Task(task_title=post_dict['task_title'])
new_task.task_description = post_dict['task_description']
new_task.start_date = datetime.strptime(str(post_dict['start_date']), '%Y-%m-%d').date()
new_task.end_date = datetime.strptime(str(post_dict['end_date']), '%Y-%m-%d').date()
new_task.time_commitment = int(post_dict['time_commitment'])
new_task.location = Location.objects.get(id=int(post_dict['new_task_location_id']))
new_task.department = Department.objects.get(id=int(post_dict['new_task_department_id']))
new_task.status = Status.objects.get(id = 1)
new_task.save()
new_posted_task = Posted_Task()
new_posted_task.task_id = Task.objects.get(id=int(new_task.id))
new_posted_task.employee_id = Employee.objects.get(id=1)
new_posted_task.save()
return HttpResponse("New Task Created")
else:
return HttpResponse("Something went wrong...(create) 1")
else:
company_set = Company.objects.all()
location_set = Location.objects.all()
department_set = Department.objects.all()
skill_set = Skill.objects.all()
context = {'company_set':company_set,'location_set':location_set,'department_set':department_set,'skill_set':skill_set}
return render(request, 'tasktrader/create.html',context)
except ObjectDoesNotExist as e:
print("There is no answer that exist the database: ", str(e))
return HttpResponse("Something went wrong...(create)")
except ValueError:
print("Could not convert data to an integer.")
return HttpResponse("Something went wrong...create) 2")
except:
print("Unexpected error:", sys.exc_info()[0])
return HttpResponse("Something went wrong...create) 3")
else:
print('Something went wrong...')
return HttpResponse("Something went wrong...create) 4")
def dashboard(request):
return render(request, 'tasktrader/dashboard.html')
def explore(request):
print('exploreing')
programs = ["PYTHON","SQL",'R','PHOTOSHOP','VBA','JAVA','C#','PHOTOGRAPHY','EXCEL',
'POWERPOINT','PREZI','PHOTO-EDITING','VIDEO-EDITING','PAINTING','FINANCIAL ANALYSIS','PROGRAMMING','ALGORITHMS',
'SUMMARIZATION','PROOF READING']
PREFIX = ['HELP WITH ', 'NEED EXPERT IN ',' URGENT HELP IN ','EXPERT HELP NEEDED IN ','ASSISTANCE REQUIRED WITH ','GUIDANCE NEEDED WITH ','LARGE PROJECT : NEED HELP WITH ']
SUFFIX = [' HELP NEEDED',' TASK NEEDED FOR DEPARTMENT PROJECT',' TASK AVAILABLE',' TUTOROIALS REQUIRED']
DEPARTMENT = ['CORPORTATE STRATEGY PROJECT','PRODUCT DEVELOPMENT PROJECT','MARKETING PROJECT','ADVERTISING PROJECT','INSTAGRAM PROJECT','WHATSAPP PROJECT','OCULUS PROJECT']
res = []
for item in programs:
for pre in PREFIX:
res.append(pre+item)
for suf in SUFFIX:
res.append(item+suf)
for dep in DEPARTMENT:
res.append(dep)
print('res is')
print(len(res))
year_range = [str(i) for i in range(1900, 2014)]
month_range = ["01","02","03","04","05","06","07","08","09","10","11","12"]
day_range = [str(i).zfill(2) for i in range(1,28)]
num_range = ["11","10","9","8","7","6"]
emp_range = ["2","3","4","5","6","7"]
for re in res:
print(123)
print(re)
new_task = Task()
new_task.task_title = re
new_task.task_description ="rem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."
date_1 = (random.choice(year_range)+'-'+random.choice(month_range)+'-'+random.choice(day_range))
date_2 = (random.choice(year_range)+'-'+random.choice(month_range)+'-'+random.choice(day_range))
new_task.start_date = datetime.strptime(str(date_1), '%Y-%m-%d').date()
new_task.end_date = datetime.strptime(str(date_2), '%Y-%m-%d').date()
new_task.time_commitment = random.choice(day_range)
new_task.location = Location.objects.get(id=int(random.choice(num_range)))
new_task.department = Department.objects.get(id = int(random.choice(num_range)))
new_task.status = Status.objects.get(id = 1)
new_task.save()
new_posted_task = Posted_Task()
new_posted_task.task_id = Task.objects.get(id=int(new_task.id))
new_posted_task.employee_id = Employee.objects.get(id=int(random.choice(emp_range)))
new_posted_task.save()
new_task_skill = Task_Skills()
new_task_skill.task_id = new_task
new_task_skill.skill_id = Skill.objects.get(id=int(random.choice(emp_range)))
new_task_skill.save()
# Data generation code for tasks is below
return HttpResponse('Data Generated')
def insert_task(request):
return render(request, 'tasktrader/insert_task.html')
def nav(request):
return render(request, 'tasktrader/nav.html')
def profile(request):
return render(request, 'tasktrader/profile.html')
def taskresult(request):
return render(request, 'tasktrader/taskresult.html')
def tasks(request):
try:
print("Accessed tasks..")
if request.method == 'POST':
print("searching tasks...")
post_dict = request.POST
print(post_dict)
print('AA')
current_employee = Employee.objects.get(id=1)
company = Company.objects.filter(id=int(current_employee.location.company_id.id))
location_set = Location.objects.filter(company_id__in=company)
task_set = Task.objects.filter(location__in= location_set)
department_set = Department.objects.filter(company_id__in=company)
dep = post_dict['task_department_id']
loc = post_dict['task_location_id']
com = post_dict['time_commitment']
print('com is')
print(com)
print('dep is')
print(dep)
print('loc is')
print(loc)
dont_skip_dep = True
dont_skip_loc = True
if dep == 'ALL':
print('YES dep is All')
dont_skip_dep = False
if loc =='ALL':
print('YES loc is All')
dont_skip_loc = False
if dont_skip_dep==True:
if post_dict['task_department_id']!="" and isinstance(int(dep),int):
department_set = department_set.filter(id= int(dep))
print('cc')
task_set = task_set.filter(department__in=department_set)
if dont_skip_loc==True:
if post_dict['task_location_id']!="" and isinstance(int(loc),int):
location_set = location_set.filter(id = int(loc))
task_set = task_set.filter(location__in=location_set)
if post_dict['time_commitment']!="" and isinstance(int(com),int):
task_set = task_set.filter(time_commitment = int(com))
context = {'task_set':task_set,'location_set':location_set,'department_set':department_set}
return render(request, 'tasktrader/tasks.html',context)
else:
current_employee = Employee.objects.get(id=1)
company = Company.objects.filter(id=int(current_employee.location.company_id.id))
location_set = Location.objects.filter(company_id__in=company)
task_set = Task.objects.filter(location__in= location_set)
department_set = Department.objects.filter(company_id__in=company)
context = {'task_set':task_set,'location_set':location_set,'department_set':department_set}
return render(request, 'tasktrader/tasks.html',context)
except ObjectDoesNotExist as e:
print("There is no answer that exist the database: ", str(e))
return HttpResponse("Something went wrong...(tasks) 1")
except ValueError:
print("Could not convert data to an integer.")
return HttpResponse("Something went wrong...(tasks) 2")
except:
print("Unexpected error:", sys.exc_info()[0])
return HttpResponse("Something went wrong...(tasks) 3")
else:
print('Something went wrong...')
return HttpResponse("Something went wrong...(tasks) 4")
<file_sep>/v.0.3/tasktrader03/tasktrader/models.py
from django.db import models
from datetime import datetime
# Models representing objects that will make up tasktrader
class Company(models.Model):
id = models.AutoField(primary_key =True)
company_name = models.CharField(max_length = 30)
def __str__(self): # returns the string value for the company name and company ID
return_value = (str(self.id) + " , " +str(self.company_name))
return return_value
class Location(models.Model):
id = models.AutoField(primary_key=True)
campus_name = models.CharField(max_length=30)
company_id = models.ForeignKey(Company, on_delete=models.CASCADE)
city = models.CharField(max_length=30)
country = models.CharField(max_length=30)
street_address = models.CharField(max_length=30)
postal_code = models.CharField(max_length=30)
def __str__(self): # returns the string value for the Location
return_value = (str(self.id) + " , " +str(self.campus_name)+ " , " +str(self.city)+ " , " +str(self.country)+ " , " +str(self.street_address)+ " , " +str(self.postal_code))
return return_value
class Department(models.Model):
id = models.AutoField(primary_key = True)
company_id = models.ForeignKey(Company, on_delete=models.CASCADE)
department_name = models.CharField(max_length=30)
def __str__(self): # returns the string value for the Location
return_value = (str(self.id) + " , " +str(self.company_id.company_name)+ " , " +str(self.department_name))
return return_value
class Employee(models.Model):
id = models.AutoField(primary_key=True)
job_title = models.CharField(max_length=20)
first_name = models.CharField(max_length=20)
last_name = models.CharField(max_length=20)
location = models.ForeignKey(Location,on_delete=models.CASCADE)
department = models.ForeignKey(Department, on_delete= models.CASCADE)
supervisor = models.ForeignKey('Employee', null=True,blank=True,on_delete = models.CASCADE)
def __str__(self): # returns the string value for the Location
return_value = (str(self.id) + " , " +str(self.first_name)+ " , "+str(self.last_name) + " , " +str(self.department.department_name)+" , "+str(self.location.campus_name))
return return_value
class Account(models.Model):
id = models.AutoField(primary_key=True)
username = models.CharField(max_length=20)
password = <PASSWORD>.CharField(max_length=20)
owner = models.ForeignKey(Employee, on_delete=models.CASCADE)
def __str__(self):
return_value = (str(self.id) + " , "+ str(self.username))
return return_value
class Status(models.Model):
id = models.AutoField(primary_key=True)
status_type = models.CharField(max_length=20)
def __str__(self):
return_value = (str(self.id) + " , " + str(self.status_type))
return return_value
class Task(models.Model):
id = models.AutoField(primary_key=True)
task_title =models.CharField(max_length=30)
task_description = models.CharField(max_length = 50)
end_date = models.DateField(null=True)
start_date = models.DateField(null= True)
time_commitment = models.IntegerField(null=True, default=0)
location = models.ForeignKey(Location, on_delete = models.CASCADE)
department = models.ForeignKey(Department, on_delete = models.CASCADE)
status = models.ForeignKey(Status, on_delete = models.CASCADE)
def __str__(self):
return_value = (str(self.id) + " , "+str(self.task_title))
return return_value
class CV(models.Model):
id = models.AutoField(primary_key=True)
employee = models.ForeignKey(Employee,on_delete = models.CASCADE)
cv = models.FileField(upload_to='resumés')
def __str__(self):
return_value = (str(self.id) + " ,"+str(self.employee.first_name))
return return_value
class Picture(models.Model):
id = models.AutoField(primary_key=True)
employee = models.ForeignKey(Employee,on_delete = models.CASCADE)
picture = models.ImageField(upload_to='Profile_Pictures')
def __str__(self):
return_value = (str(self.id) + " ,"+str(self.employee.first_name))
return return_value
class Skill(models.Model):
id = models.AutoField(primary_key = True)
skill_name = models.CharField(max_length = 20)
def __str__(self):
return_value = (str(self.id)+ " ,"+str(self.skill_name))
return return_value
class Task_Skills(models.Model):
task_id = models.ForeignKey(Task, on_delete = models.CASCADE)
skill_id = models.ForeignKey(Skill, on_delete = models.CASCADE)
def __str__(self):
return_value = (str(self.task_id.id)+ " ,"+str(self.skill_id.id))
return return_value
class Employee_Skills(models.Model):
employee_id = models.ForeignKey(Employee, on_delete = models.CASCADE)
skill_id = models.ForeignKey(Skill, on_delete = models.CASCADE)
def __str__(self):
return_value = ("employee :"+str(self.employee_id.id)+ ", skill: "+str(self.skill_id.id))
return return_value
class Posted_Task(models.Model):
task_id = models.ForeignKey(Task, on_delete = models.CASCADE)
employee_id = models.ForeignKey(Employee, on_delete = models.CASCADE)
def __str__(self):
return_value = ("employee: "+str(self.employee_id.id)+ ", Task: "+ str(self.task_id.id))
return return_value
class Applied_Task(models.Model):
task_id = models.ForeignKey(Task, on_delete = models.CASCADE)
employee_id = models.ForeignKey(Employee, on_delete = models.CASCADE)
def __str__(self):
return_value = ("employee: "+str(self.employee_id.id)+ ", Task: "+ str(self.task_id.id))
return return_value
class Filled_Task(models.Model):
task_id = models.ForeignKey(Task, on_delete = models.CASCADE)
employee_id = models.ForeignKey(Employee, on_delete = models.CASCADE)
def __str__(self):
return_value = ("employee: "+str(self.employee_id.id)+ ", Task: "+ str(self.task_id.id))
return return_value
class Random_Task(models.Model):
task_id = models.ForeignKey(Task, on_delete = models.CASCADE)
employee_id = models.ForeignKey(Employee, on_delete = models.CASCADE)
def __str__(self):
return_value = ("employee: "+str(self.employee_id.id)+ ", Task: "+ str(self.task_id.id))
return return_value
class Current_User(models.Model):
am = models.ForeignKey(Employee, on_delete = models.CASCADE)
<file_sep>/v.0.3/tasktrader03/tasktrader/migrations/0001_initial.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-03 19:23
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Account',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('username', models.CharField(max_length=20)),
('password', models.CharField(max_length=20)),
],
),
migrations.CreateModel(
name='Applied_Task',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
],
),
migrations.CreateModel(
name='Company',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('company_name', models.CharField(max_length=30)),
],
),
migrations.CreateModel(
name='CV',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('cv', models.FileField(upload_to='resumés')),
],
),
migrations.CreateModel(
name='Department',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('department_name', models.CharField(max_length=30)),
('company_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Company')),
],
),
migrations.CreateModel(
name='Employee',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('job_title', models.CharField(max_length=20)),
('first_name', models.CharField(max_length=20)),
('last_name', models.CharField(max_length=20)),
('department', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Department')),
],
),
migrations.CreateModel(
name='Employee_Skills',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('employee_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Employee')),
],
),
migrations.CreateModel(
name='Filled_Task',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('employee_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Employee')),
],
),
migrations.CreateModel(
name='Location',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('campus_name', models.CharField(max_length=30)),
('city', models.CharField(max_length=30)),
('country', models.CharField(max_length=30)),
('street_address', models.CharField(max_length=30)),
('postal_code', models.CharField(max_length=30)),
('company_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Company')),
],
),
migrations.CreateModel(
name='Picture',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('picture', models.ImageField(upload_to='Profile_Pictures')),
('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Employee')),
],
),
migrations.CreateModel(
name='Posted_Task',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('employee_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Employee')),
],
),
migrations.CreateModel(
name='Random_Task',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('employee_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Employee')),
],
),
migrations.CreateModel(
name='Skill',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('skill_name', models.CharField(max_length=20)),
],
),
migrations.CreateModel(
name='Status',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('status_type', models.CharField(max_length=20)),
],
),
migrations.CreateModel(
name='Task',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('task_title', models.CharField(max_length=30)),
('task_description', models.CharField(max_length=50)),
('end_date', models.DateField(null=True)),
('start_date', models.DateField(null=True)),
('time_commitment', models.DateTimeField(blank=True, default=datetime.datetime.now)),
('department', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Department')),
('location', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Location')),
('status', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Status')),
],
),
migrations.CreateModel(
name='Task_Skills',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('skill_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Skill')),
('task_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Task')),
],
),
migrations.AddField(
model_name='random_task',
name='task_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Task'),
),
migrations.AddField(
model_name='posted_task',
name='task_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Task'),
),
migrations.AddField(
model_name='filled_task',
name='task_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Task'),
),
migrations.AddField(
model_name='employee_skills',
name='skill_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Skill'),
),
migrations.AddField(
model_name='employee',
name='location',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Location'),
),
migrations.AddField(
model_name='employee',
name='supervisor',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Employee'),
),
migrations.AddField(
model_name='cv',
name='employee',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Employee'),
),
migrations.AddField(
model_name='applied_task',
name='employee_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Employee'),
),
migrations.AddField(
model_name='applied_task',
name='task_id',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Task'),
),
migrations.AddField(
model_name='account',
name='owner',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasktrader.Employee'),
),
]
<file_sep>/V.0.0/views/create.php
<?php
include('../my_connect.php');
?>
<!DOCTYPE html>
<head>
<title>Tasktrader | Dashboard</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="../static/main.css">
<link href="https://fonts.googleapis.com/css?family=Muli:200,300,300i,400,600,600i,700,800,900" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-tagsinput/1.3.6/jquery.tagsinput.min.css">
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="<KEY>
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-tagsinput/1.3.6/jquery.tagsinput.min.js"></script>
<script src="../static/tasktrader.js"></script>
</head>
<body>
<div class="wrapper">
<?php
require('nav.php');
?>
<section class="explore_page">
<div class="heading">
<h2>Create Task</h2>
</div>
<div class="createForm">
<div class="row create_top">
<div class="col-xs-6" style="margin-left: 35px"><label>Employee Poster: </label><span style='padding-left: 35px' class="task_disabled"><NAME></span></div>
<!-- FORM BEGINS HERE -->
<form action="insert_task.php" method="POST" class="create_task form-horizontal">
<!-- Task Title -->
<div class="form-group">
<label class="control-label col-sm-2" for="task_title">Task Title:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="task_title" name="tname" requried>
</div>
</div>
<!-- Task Description -->
<div class="form-group">
<label class="control-label col-sm-2" for="task_title">Task Description:</label>
<div class="col-sm-10">
<textarea name="tdescription" class="form-control" rows="5" required></textarea>
</div>
</div>
<!-- Task Skills -->
<div class="form-group">
<label class="control-label col-sm-2" for="task_skills">Skills:</label>
<div class="col-sm-10">
<input name="task_tags" id="tags" value="SQL,accounting,excel" required>
</div>
</div>
<!-- Task Time Commitment, Location, Department -->
<div class="form-group row">
<label class="control-label col-sm-2" for="department">Department</label>
<div class="col-md-3">
<select class="form-control" name="department">
<option value="1" >Executive Board</option>
<option value="2" >Operations</option>
<option value="3" >Corporate Strategy</option>
<option value="4" >Research and Development</option>
<option value="5" >Human Resources</option>
<option value="6" >Marketing</option>
<option value="7" >Advertising</option>
<option value="8" >Product Development</option>
<option value="9" >Accounting</option>
<option value="10" >Business Intelligence</option>
<option value="11" >Information Technology</option>
<option value="12" >Information Solutions</option>
<option value="13" >Instagram</option>
<option value="14" >Oculus</option>
<option value="14" >WhatsApp</option>
</select>
</div>
<label class="control-label col-sm-1" for="location">Location</label>
<div class="col-md-2">
<select class="form-control" name="location">
<option value="1" >HeadQuarters</option>
<option value="2" >Mars Discovery District</option>
<option value="3" >Roths Child Boulevard</option>
<option value="4" >Internet City</option>
</select>
</div>
<label class="control-label col-sm-3" for="task_commitment">Time Commitment (hrs/week):</label>
<div class="col-md-1">
<input type="number" min="1" max="20" class="form-control" id="task_commitment" name="tcommitment" required>
</div>
</div>
<!-- Task Start/End Date -->
<div class="form-group row">
<label class="control-label col-sm-2" for="task_start_date">Start Date:</label>
<div class="col-md-3">
<input type="date" name="start_date" class="form-control" id="task_start_date">
</div>
<label class="control-label col-sm-1" for="task_end_date">End:</label>
<div class="col-md-3">
<input type="date" name="end_date" class="form-control" id="task_end_date">
</div>
</div>
<button type="submit" class="save_button save_later">Save and Post</button>
<!-- <button class="save_button save_post">Save and Post</button> -->
</form>
</div>
</div>
</section>
</div>
</body>
</html><file_sep>/V.0.1/tasktrader02/views/dashboard.php
<?php
// Enable error logging:
//error_reporting(E_ALL ^ E_NOTICE);
error_reporting(E_ALL);
ini_set('display_errors', 'on');
// mysqli connection via user-defined function
include ('../my_connect.php');
$mysqli = get_mysqli_conn();
?>
<!DOCTYPE html>
<head>
<title>Tasktrader | Dashboard</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="../static/main.css">
<link href="https://fonts.googleapis.com/css?family=Muli:200,300,300i,400,600,600i,700,800,900" rel="stylesheet">
</head>
<body>
<div class="wrapper">
<?php
require('nav.php');
?>
<section class="explore_page">
<div class="heading">
<h2>Dashboard</h2>
</div>
<div class="container">
<div class="row">
<!-- overview div begins here -->
<h3>Overview</h3>
<div class="border" id="topborder"></div>
<div class="col-md-4 text-center" id="bluewhite" style="box-shadow: 1px 1px 3px grey">
<h3>
<!-- Query to fetch all unfilled tasks -->
<?php
// SQL statement
$sql = "SELECT COUNT(*) FROM Task T WHERE T.status_id = 1 AND DATE_ADD(T.start_date, INTERVAL -7 DAY) > CURRENT_TIMESTAMP";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->execute();
// Bind result variables
$stmt->bind_result($applications);
/* fetch values */
while ($stmt->fetch())
{
print "$applications";
}
/* close statement and connection*/
$stmt->close();
?>
</h3>
<h4>unfilled tasks available.</h4>
</div>
<div class="col-md-4 text-center" id="lightblueblue" style="box-shadow: 1px 1px 3px grey">
<h3>
<!-- Query to aggregate total applications applied to -->
<?php
// SQL statement
$sql = "SELECT COUNT(*) FROM Applied_to_Task A WHERE A.employee_id = 10";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->execute();
// Bind result variables
$stmt->bind_result($applications);
/* fetch values */
while ($stmt->fetch())
{
print "$applications";
}
/* close statement and connection*/
$stmt->close();
?>
</h3>
<h4>tasks applied to, good for you.</h4>
</div>
<div class="col-md-4 text-center" id="greenwhite" style="box-shadow: 1px 1px 3px grey">
<!-- Query to fetch all applicants to apply to tasks posted by employee -->
<h3>
<?php
// SQL statement
$sql = "SELECT COUNT(*) FROM Applied_to_Task A WHERE A.task_id IN (SELECT P.task_id FROM Posted_Task P WHERE P.employee_id = 10)";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->execute();
// Bind result variables
$stmt->bind_result($applications);
/* fetch values */
while ($stmt->fetch())
{
print "$applications";
}
/* close statement and connection*/
$stmt->close();
?>
</h3>
<h4>people applied to your tasks, hooray!</h4>
</div>
</div>
<div class="row">
<h3>Applicants to our Postings</h3>
<div class="border"></div>
<div class="col-md-12">
<table class="table table-striped">
<thead>
<tr>
<th>Posting ID</th>
<th>Task Title</th>
<th>Applicant ID</th>
<th>Applicant Name</th>
<th>Applicant Title</th>
<th>Department</th>
<th>Location</th>
</tr>
</thead>
<tbody>
<!-- Analytics to fetch list of all applicants who applied to postings-->
<?php
// SQL statement
$sql = "SELECT P.task_id, T.task_title, A.employee_id, E.first_name, E.last_name, E.job_title, D.department_name, L.campus_name FROM Posted_Task P LEFT JOIN Applied_to_Task A ON P.task_id = A.task_id LEFT JOIN Task T ON P.task_id = T.ID LEFT JOIN Employee E ON A.employee_id = E.ID LEFT JOIN Department D ON E.department_id = D.ID LEFT JOIN Location L ON E.location_id = L.ID WHERE P.employee_id = 10 ";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->execute();
// Bind result variables
$stmt->bind_result($posting_id, $task_title, $applicant_id, $applicant_fname, $applicant_lname, $applicant_title, $applicant_dept, $applicant_campus);
/* fetch values */
while ($stmt->fetch())
{
print "<tr><td>$posting_id</td><td><a class='td_link' href='taskresult.php?id=$posting_id'>$task_title</a></td><td>$applicant_id</td><td>$applicant_fname $applicant_lname</td><td>$applicant_title</td><td>$applicant_dept</td><td>$applicant_campus</td></tr>";
}
/* close statement and connection*/
$stmt->close();
?>
</tbody>
</table>
</div>
</div>
<div class="row">
<h3>Leaderboard!</h3>
<div class="border"></div>
<h5>Other employees of your supervisor with above average applications</h5>
<br>
<div class="col-md-12">
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Job Title</th>
<th>Location</th>
</tr>
</thead>
<tbody>
<!-- query to get an agggregate list of applicants who are over the average -->
<?php
// SQL statement
$sql = "SELECT E.first_name, E.last_name, E.job_title, L.campus_name FROM Applied_to_Task A LEFT JOIN Employee E ON A.employee_id = E.ID LEFT JOIN Location L ON E.location_id = L.ID WHERE E.supervisor_id = 1 GROUP BY A.employee_id HAVING COUNT(*) > (SELECT COUNT(*)/COUNT(DISTINCT A.employee_id) AS avg_apps FROM Applied_to_Task A LEFT JOIN Employee E ON A.employee_id = E.ID WHERE E.supervisor_id = 1)";
// Prepared statement, stage 1: prepare
$stmt = $mysqli->prepare($sql);
// Prepared statement, stage 2: execute
$stmt->execute();
// Bind result variables
$stmt->bind_result($fname, $lname, $title, $campus);
/* fetch values */
while ($stmt->fetch())
{
print "<tr><td>$fname $lname</td><td>$title</td><td>$campus</td></tr>";
}
/* close statement and connection*/
$stmt->close();
$mysqli->close();
?>
</tbody>
</table>
</div>
</div>
</section>
</div>
</body>
</html><file_sep>/V.0.1/tasktrader02/tasktrader/views.py
from django.shortcuts import render, redirect
from django.template import loader
from . models import *
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
import requests
import datetime
import json
import requests
from django.core.exceptions import ObjectDoesNotExist
from . models import *
from django.views.decorators.csrf import csrf_exempt
from django.urls import reverse
from django.shortcuts import render, redirect
from django.template import loader
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
import sys
# Views to access webpages created
def index(request):
"""
This view is used to load the "applied.html" page
Return a JSON response for the edited form or load the edit form page
"""
return HttpResponse("Hello, world. You're at the tasktrader index.")
def onboarding(request):
print("Accessing oboarding method...")
print(request)
try:
company_set = Company.objects.all()
location_set = Location.objects.all()
department_set = Department.objects.all()
context = {'company_set':company_set,'location_set':location_set,'department_set':department_set}
return render(request, 'tasktrader/onboarding.html', context)
except ObjectDoesNotExist as e:
print("There is no answer that exist the database: ", str(e))
except ValueError:
print("Could not convert data to an integer.")
except:
print("Unexpected error:", sys.exc_info()[0])
else:
print('Something went wrong...')
'''
# Loading all the Active questions for the current form; Questions can also have a 'deleted' status where they are no longer needed, but they have data in the DB tied to it
question_set = Question.objects.filter(parent_form=current_form)
question_set = question_set.filter(question_status = Status.objects.get(status='ACTIVE'))
option_set = Option.objects.filter(current_question__in=question_set)
question_type_set = Question_Type.objects.all()
# Loading Set of all plants in accordance to the user's privileges
if(current_user.user_privileges == User_Privileges.objects.get(user_privileges='FULL_ACCESS')) or (current_user.user_privileges == User_Privileges.objects.get(user_privileges='ADMIN')):
plant_set = Plant.objects.all()
plant_set = plant_set.filter(plant_status = Status.objects.get(status = "ACTIVE"))
context = {'current_form':current_form,'question_set':question_set,'option_set':option_set,'question_type_set':question_type_set,'plant_set':plant_set}
return HttpResponseRedirect(str(current_form.form_id)+'/edit_forms')
else:
given_plant =Plant.objects.get(plant_id=current_user.parent_plant.plant_id)
if authenticate(request, given_plant.plant_id):
plant_set = []
plant_set.append(given_plant)
print('Redirecting to Edit Forms Page')
request.method = 'GET'
context = {'current_form':current_form,'question_set':question_set,'option_set':option_set,'question_type_set':question_type_set,'plant_set':plant_set}
return HttpResponseRedirect(str(current_form.form_id)+'/edit_forms')
else:
return HttpResponse("User Does Not Have Appropriate Access Level for This Feature")
else:
return HttpResponse("User Does Not Have Appropriate Access Level for This Feature")
else:
# GET Method for create form
# Loads set of all plants relevant to user's privileges
return HttpResponse("No get method exist for this page -> Rory sucks - Ayser")
else:
return HttpResponse('User Does Not Have Access')
'''
def add_new_company(request):
try:
print("Accessed add_new_company..")
if request.method == 'POST':
print("Adding new company...")
post_dict = request.POST
print(post_dict)
if post_dict['company_name']!="" :
all_companies = Company.objects.all()
add_new = True
company_name_to_add = post_dict['company_name']
company_name_to_add = company_name_to_add.upper()
for company in all_companies:
if company.company_name == company_name_to_add:
print("Company Name already exists")
add_new = False
return HttpResponse("Company Name Already Exists")
if add_new:
new_company = Company(company_name=company_name_to_add)
new_company.save()
return HttpResponse("New Company Created")
return HttpResponse("Something went wrong...")
except ObjectDoesNotExist as e:
print("There is no answer that exist the database: ", str(e))
except ValueError:
print("Could not convert data to an integer.")
except:
print("Unexpected error:", sys.exc_info()[0])
else:
print('Something went wrong...')
def applied(request):
return render(request, 'tasktrader/applied.html')
def create(request):
return render(request, 'tasktrader/create.html')
def dashboard(request):
return render(request, 'tasktrader/dashboard.html')
def explore(request):
return render(request, 'tasktrader/explore.html')
def insert_task(request):
return render(request, 'tasktrader/insert_task.html')
def nav(request):
return render(request, 'tasktrader/nav.html')
def profile(request):
return render(request, 'tasktrader/profile.html')
def taskresult(request):
return render(request, 'tasktrader/taskresult.html')
def tasks(request):
print(hello)
return render(request, 'tasktrader/tasks.html')
"""
if request.method == 'POST':
if(current_user.user_privileges == User_Privileges.objects.get(user_privileges='FULL_ACCESS')) or (current_user.user_privileges == User_Privileges.objects.get(user_privileges='ADMIN')):
post_dict = request.POST
print(post_dict)
if post_dict['plant_name']!="" :
all_plants = Plant.objects.all()
all_lines = Line.objects.all()
all_skus = SKU.objects.all()
add_new = True
plant_to_add = post_dict['plant_name']
plant_name_to_add = plant_to_add.upper()
for plant in all_plants:
if plant.plant_name == plant_name_to_add:
print("Plant Name Already Exists...")
plant.plant_status = Status.objects.get(status='ACTIVE')
plant.save()
for line in all_lines:
if line.parent_plant == plant:
line.line_status = Status.objects.get(status='ACTIVE')
line.save()
for sku in all_skus:
if sku.parent_line.parent_plant == plant:
sku.sku_status = Status.objects.get(status='ACTIVE')
sku.save()
add_new = False
new_plant= plant
break
if add_new == True:
new_plant = Plant()
new_plant = Plant(plant_name=plant_name_to_add)
new_plant.plant_status = Status.objects.get(status='ACTIVE')
new_plant.save()
new_plant.plant_key = plant_name_to_plant_key(plant_name_to_add,new_plant.plant_id)
new_plant.save()
context = {"new_plant": new_plant.plant_name, "new_plant_id": new_plant.plant_id, "new_plant_key": new_plant.plant_key}
return JsonResponse(context)
else:
return HttpResponse("Invalid Entry")
else:
return HttpResponse("User Does Not Have Access To This Function")
else:
return HttpResponse("Method Does Not Have A Get Method")
else:
HttpResponse("User Does Not Have Access")
"""
<file_sep>/V.0.1/tasktrader02/views/insert_task.php
<?php
// Enable error logging:
//error_reporting(E_ALL);
//ini_set('display_errors', 'on');
// mysqli connection via user-defined function
include('../my_connect.php');
$mysqli = get_mysqli_conn();
//1 CAPITALIZE EVERYTHING
if (!empty($_POST)){
$myString = $_POST['task_tags'];
$myArray = explode(',', strtoupper($myString));
//2 CHECK THAT SKILLS is in the skills Table
$verifySkill_sql = "SELECT Count(*)"
. "FROM Skill "
. "WHERE skill_name = ?";
$stmt = $mysqli->prepare($verifySkill_sql);
//iterate through each keyword to check if they are in skill table
foreach ($myArray as $value) {
if ($stmt) {
$stmt->bind_param('s', $value);
$stmt->execute();
$stmt->bind_result($result);
//if we do not have skills, add it to the insertSkill array
if($stmt->fetch()){
if ($result < 1){
$insertSkill[] = $value;
}
} else {
printf("Errormessage: %s\n", $mysqli->error);
}
}
}
$stmt->free_result();
//Insert any Skills that aren't added
$stmt2 = $mysqli->prepare("INSERT INTO Skill (skill_name) VALUES (?)");
if ($stmt2){
foreach ($insertSkill as $skill) {
$stmt2->bind_param('s', $skill);
if(!$stmt2->execute()){
echo "insert failed";
}
}
} else {
echo "Insert failed !";
}
//close connection
$stmt2->free_result();
//Insert Task into Tasks Table
$stmt3 = $mysqli-> prepare("INSERT INTO Task(task_title, task_description, start_date, end_date, weekly_time_commitment, location_id, department_id, status_id) VALUES (?,?,?,?,?,?,?,1) ");
$tname = $_POST['tname'];
$tdescription = $_POST['tdescription'];
$start_date = $_POST['start_date'];
$end_date = $_POST['end_date'];
$weekly_time_commitment = $_POST['tcommitment'];
$location_id = $_POST['location'];
$department_id = $_POST['department'];
$stmt3->bind_param('ssssiii', $tname, $tdescription, $start_date, $end_date, $weekly_time_commitment, $location_id, $department_id);
//if query executed, get the ID of the inserted row
if($stmt3->execute()) {
$id = $mysqli->insert_id;
} else {
echo "error";
}
$stmt3->free_result();
//insert to Task_Skills table
$stmt4 = $mysqli->prepare("INSERT INTO Task_Skills(task_id, skill_id) SELECT ? , S.ID FROM Skill S WHERE S.skill_name = ? ");
//if insert statment is true
if ($stmt4){
foreach ($myArray as $added) {
$stmt4->bind_param('is', $id, $added);
if($stmt4->execute()){
echo "<div class='update_message'>Task Sucessfully Created!</div>";
} else {
echo "insert failed<br>";
}
}
} else {
echo "Insert failed !";
}
//close connection
$stmt4->free_result();
$mysqli->close();
}
?>
<!DOCTYPE html>
<head>
<title>Tasktrader | Profile</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="../static/main.css">
<link href="https://fonts.googleapis.com/css?family=Muli:200,300,300i,400,600,600i,700,800,900" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-tagsinput/1.3.6/jquery.tagsinput.min.css">
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="<KEY>
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-tagsinput/1.3.6/jquery.tagsinput.min.js"></script>
</head>
<body>
<div class="wrapper">
<?php
require('nav.php');
?>
<section class="explore_page">
</section>
</div>
</body>
</html>
|
21df757f97a2ae789cf17434327e2dea21fe88ce
|
[
"JavaScript",
"Python",
"PHP"
] | 17 |
Python
|
ayser259/tasktrader
|
0292b3987474f8744fa12955542159789a34f9e7
|
627e2c06942931081e98408b66540b299eaebddb
|
refs/heads/master
|
<file_sep># Scott Editor
Following the [Build Your Own Text Editor](https://viewsourcecode.org/snaptoken/kilo/) tutorial.
Goal is to have a vim-clone along with most of my favorite plugins and
customizations built in.
<file_sep>CXX=g++
scott: scott.cpp
$(CXX) scott.cpp -o scott -Wall -Wextra -pedantic
<file_sep>#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <termios.h>
#include <time.h>
#include <unistd.h>
#define CTRL_KEY(k) ((k) & 0x1f)
#define SCOTT_VERSION "0.0.1"
#define SCOTT_TAB_STOP 3
void die(const char *s) {
write(STDOUT_FILENO, "\x1b[2J", 4);
write(STDOUT_FILENO, "\x1b[H", 3);
perror(s);
exit(1);
}
/*** data ***/
typedef struct erow {
int size;
int rsize;
char *chars;
char *render;
} erow;
struct editorConfig {
int cx, cy;
int rx;
int rowoff;
int coloff;
int screenrows;
int screencols;
int numrows;
erow *row;
char *filename;
char statusmsg[80];
time_t statusmsg_time;
struct termios orig_termios;
};
struct editorConfig E;
void disableRawMode() {
if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &E.orig_termios) == -1) { die("tcsetattr"); }
}
void enableRawMode() {
if (tcgetattr(STDIN_FILENO, &E.orig_termios) == -1) { die("tcgetattr"); }
atexit(disableRawMode);
struct termios raw = E.orig_termios;
raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
raw.c_oflag &= ~(OPOST);
raw.c_cflag |= (CS8);
raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
raw.c_cc[VMIN] = 0;
raw.c_cc[VTIME] = 1;
if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw) == -1) { die("tcsetattr"); }
}
char editorReadKey() {
int nread;
char c;
while ((nread = read(STDIN_FILENO, &c, 1)) != 1) {
if (nread == -1 && errno != EAGAIN) { die("read"); }
}
return c;
}
int getCursorPosition(int *rows, int *cols) {
char buf[32];
unsigned int i = 0;
if (write(STDOUT_FILENO, "\x1b[6n", 4) != 4) { return -1; }
while (i < sizeof(buf) - 1) {
if (read(STDIN_FILENO, &buf[i], 1) != 1) { break; }
if (buf[i] == 'R') { break; }
i++;
}
buf[i] = '\0';
if (buf[0] != '\x1b' || buf[1] != '[') { return -1; }
if (sscanf(&buf[2], "%d;%d", rows, cols) != 2) { return -1; }
return 0;
}
int getWindowSize(int *rows, int *cols) {
struct winsize ws;
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == -1 || ws.ws_col == 0) {
if (write(STDOUT_FILENO, "\x1b[999C\x1b[999B", 12) != 12) { return -1; }
return getCursorPosition(rows, cols);
} else {
*cols = ws.ws_col;
*rows = ws.ws_row;
return 0;
}
}
/*** row operations ***/
int editorRowCxToRx(erow *row, int cx) {
int rx = 0;
int j;
for(j = 0; j < cx; j++){
if(row->chars[j] == '\t') {
rx += (SCOTT_TAB_STOP - 1) - (rx % SCOTT_TAB_STOP);
}
rx++;
}
return rx;
}
void editorUpdateRow(erow *row) {
int tabs = 0;
int j;
for (j = 0; j < row->size; j++) {
if(row->chars[j] == '\t') {
tabs++;
}
}
free(row->render);
row->render = (char *)malloc(row->size + tabs * (SCOTT_TAB_STOP - 1) + 1);
int idx = 0;
for (j = 0; j < row->size; j++) {
if(row->chars[j] == '\t') {
row->render[idx++] = ' ';
while(idx % SCOTT_TAB_STOP != 0) {
row->render[idx++] = ' ';
}
} else {
row->render[idx++] = row->chars[j];
}
}
row->render[idx] = '\0';
row->rsize = idx;
}
void editorAppendRow(char *s, size_t len) {
E.row = (erow *) realloc(E.row, sizeof(erow) * (E.numrows + 1));
int at = E.numrows;
E.row[at].size = len;
E.row[at].chars = (char *) malloc(len + 1);
memcpy(E.row[at].chars, s, len);
E.row[at].chars[len] = '\0';
E.row[at].rsize = 0;
E.row[at].render = NULL;
editorUpdateRow(&E.row[at]);
E.numrows++;
}
/*** file i/o ***/
void editorOpen(char *filename) {
free(E.filename);
E.filename = strdup(filename);
FILE *fp = fopen(filename, "r");
if (!fp) { die("fopen"); }
char *line = NULL;
size_t linecap = 0;
ssize_t linelen;
while ((linelen = getline(&line, &linecap, fp)) != -1) {
while (linelen > 0 && (line[linelen - 1] == '\n' || line[linelen - 1] == '\r')) {
linelen--;
}
editorAppendRow(line, linelen);
}
free(line);
fclose(fp);
}
/*** append buffer ***/
struct abuf {
char *b;
int len;
};
#define ABUF_INIT {NULL, 0}
void abAppend(struct abuf *ab, const char *s, int len) {
char *newline = (char *) realloc(ab->b, ab->len + len);
if (newline == NULL) { return; }
memcpy(&newline[ab->len], s, len);
ab->b = newline;
ab->len += len;
}
void abFree(struct abuf *ab){
free(ab->b);
}
void editorMoveCursor(char key) {
erow *row = (E.cy >= E.numrows) ? NULL : &E.row[E.cy];
switch (key) {
case 'h':
if (E.cx != 0) {
E.cx--;
}
break;
case 'l':
if (row && E.cx < row->size) {
E.cx++;
}
break;
case 'k':
if (E.cy != 0) {
E.cy--;
}
break;
case 'j':
if (E.cy < E.numrows) {
E.cy++;
}
break;
}
row = (E.cy >= E.numrows) ? NULL : &E.row[E.cy];
int rowlen = row ? row->size : 0;
if(E.cx > rowlen) {
E.cx = rowlen;
}
}
void editorProcessKeypress() {
char c = editorReadKey();
switch (c) {
case CTRL_KEY('q'):
write(STDOUT_FILENO, "\x1b[2J", 4);
write(STDOUT_FILENO, "\x1b[H", 3);
exit(0);
break;
case 'h':
case 'j':
case 'k':
case 'l':
editorMoveCursor(c);
break;
}
}
/*** output ***/
void editorScroll() {
E.rx = 0;
if(E.cy < E.numrows) {
E.rx = editorRowCxToRx(&E.row[E.cy], E.cx);
}
if (E.cy < E.rowoff) {
E.rowoff = E.cy;
}
if (E.cy >= E.rowoff + E.screenrows) {
E.rowoff = E.cy - E.screenrows + 1;
}
if (E.rx < E.coloff) {
E.coloff = E.rx;
}
if (E.rx >= E.coloff + E.screencols) {
E.coloff = E.rx - E.screencols + 1;
}
}
void editorDrawRows(struct abuf *ab) {
int y;
for (y = 0; y < E.screenrows; y++) {
int filerow = y + E.rowoff;
if (filerow >= E.numrows) {
if (E.numrows == 0 && y == E.screenrows / 3) {
char welcome[80];
int welcomelen = snprintf(welcome, sizeof(welcome), "Scott Editor -- version %s", SCOTT_VERSION);
if(welcomelen > E.screencols) { welcomelen = E.screencols; }
int padding = (E.screencols - welcomelen) / 2;
if(padding) {
abAppend(ab, "~", 1);
padding--;
}
while (padding--) { abAppend(ab, " ", 1); }
abAppend(ab, welcome, welcomelen);
} else {
abAppend(ab, "~", 1);
}
} else {
int len = E.row[filerow].rsize - E.coloff;
if (len < 0) { len = 0; }
if (len > E.screencols) { len = E.screencols; }
abAppend(ab, &E.row[filerow].render[E.coloff], len);
}
abAppend(ab, "\x1b[K", 3);
abAppend(ab, "\r\n", 2);
}
}
void editorDrawStatusBar(struct abuf *ab) {
abAppend(ab, "\x1b[7m", 4);
char status[80], rstatus[80];
int len = snprintf(status, sizeof(status), "%.20s - %d lines", E.filename ? E.filename : "[No Name]", E.numrows);
int rlen = snprintf(rstatus, sizeof(rstatus), "%d/%d", E.cy + 1, E.numrows);
if (len > E.screencols) {
len = E.screencols;
}
abAppend(ab, status, len);
while (len < E.screencols) {
if (E.screencols - len == rlen) {
abAppend(ab, rstatus, rlen);
break;
} else {
abAppend(ab, " ", 1);
len++;
}
}
abAppend(ab, "\x1b[m", 3);
abAppend(ab, "\r\n", 2);
}
void editorDrawMessageBar(struct abuf *ab) {
abAppend(ab, "\x1b[K", 3);
int msglen = strlen(E.statusmsg);
if (msglen > E.screencols) {
msglen = E.screencols;
}
if (msglen && time(NULL) - E.statusmsg_time < 5) {
abAppend(ab, E.statusmsg, msglen);
}
}
void editorRefreshScreen() {
editorScroll();
struct abuf ab = ABUF_INIT;
abAppend(&ab, "\x1b[?25l", 6);
abAppend(&ab, "\x1b[H", 3);
editorDrawRows(&ab);
editorDrawStatusBar(&ab);
editorDrawMessageBar(&ab);
char buf[32];
snprintf(buf, sizeof(buf), "\x1b[%d;%dH", (E.cy - E.rowoff) + 1, (E.rx - E.coloff) + 1);
abAppend(&ab, buf, strlen(buf));
abAppend(&ab, "\x1b[?25h", 6);
write(STDOUT_FILENO, ab.b, ab.len);
abFree(&ab);
}
void editorSetStatusMessage(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
vsnprintf(E.statusmsg, sizeof(E.statusmsg), fmt, ap);
va_end(ap);
E.statusmsg_time = time(NULL);
}
/*** init ***/
void initEditor() {
E.cx = 0;
E.cy = 0;
E.rx = 0;
E.rowoff = 0;
E.coloff = 0;
E.numrows = 0;
E.row = NULL;
E.filename = NULL;
E.statusmsg[0] = '\0';
E.statusmsg_time = 0;
if (getWindowSize(&E.screenrows, &E.screencols) == -1) { die("getWindowSize"); }
E.screenrows -= 2;
}
int main(int argc, char *argv[]) {
enableRawMode();
initEditor();
if(argc >= 2) {
editorOpen(argv[1]);
}
editorSetStatusMessage("HELP: Ctrl-Q = quit");
while (1) {
editorRefreshScreen();
editorProcessKeypress();
}
return 0;
}
|
d0ebd7bf6ed695adea16083f32746d1451305447
|
[
"Markdown",
"Makefile",
"C++"
] | 3 |
Markdown
|
swerner/scott
|
292f4d49d9d558883a9458673a4ee9e2f48a9e21
|
160b7a3d2a945c7223512e6beb754c20dda7e42e
|
refs/heads/master
|
<repo_name>fahmifan/OPTA-Backend<file_sep>/app/Http/Controllers/BusAdminController.php
<?php
namespace App\Http\Controllers;
use App\Bus;
use App\BusAdmin;
use Illuminate\Http\Request;
class BusAdminController extends Controller
{
public function register(Request $request){
$request['remember_token'] = str_random(60);
$request['password'] = app('<PASSWORD>($request['password']);
BusAdmin::create($request->all());
return response()->json(200);
}
public function viewOneBus(Request $request){
$bus = Bus::find($request['bus_id']);
return response()->json($bus, 200);
}
public function viewAllBusses(Request $request){
$busses = BusAdmin::find($request['bus_admin_id'])->busses;
return response()->json($busses, 200);
}
public function addBus(Request $request){
Bus::create($request->all());
return response()->json(200);
}
public function deleteBus(Request $request){
Bus::destroy($request['bus_id']);
// $bus->delete();
return response()->json(200);
}
public function updateBus(Request $request){
$bus = Bus::find($request['bus_id']);
$bus->update($request->except('bus_id'));
return response()->json(200);
}
}
<file_sep>/database/factories/BusFactory.php
<?php
use Faker\Generator as Faker;
$factory->define(App\Bus::class, function (Faker $faker) {
return [
'bus_number' => rand(1, 10),
'price' => rand(4000, 8000),
'bus_admin_id' => rand(1, 3),
];
});
<file_sep>/app/Http/Controllers/AuthController.php
<?php
namespace App\Http\Controllers;
use App\User;
use App\BusAdmin;
use Illuminate\Http\Request;
class AuthController extends Controller
{
public function login(Request $request){
$user = User::where('email', $request['email'])->first();
$busAdmin = BusAdmin::where('email', $request['email'])->first();
if($user == NULL && $busAdmin == NULL){
return response()->json([
'error' => 'Email tersebut tidak terdaftar pada aplikasi ini'
], 403);
} else {
if($user == NULL){
if(!app('hash')->check($request['password'], $busAdmin->password)){
return response()->json([
'error' => 'Katasandi untuk Email tersebut salah, mohon dicoba lagi'
], 403);
} else {
return response()->json([
'user_id' => $busAdmin->id,
'token' => $busAdmin->remember_token,
'privilege' => '1'
], 200);
}
} else {
if(!app('hash')->check($request['password'], $user->password)){
return response()->json([
'error' => 'Katasandi untuk Email tersebut salah, mohon dicoba lagi'
], 403);
} else {
return response()->json([
'user_id' => $user->id,
'token' => $user->remember_token,
'privilege' => '2'
], 200);
}
}
}
}
}
<file_sep>/database/seeds/BusAdminSeeder.php
<?php
use Illuminate\Database\Seeder;
class BusAdminSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('bus_admin')->insert([
'email' => "<EMAIL>",
'password' => <PASSWORD>('<PASSWORD>'),
'company_name' => "Primajasa",
'balance' => 10000,
'remember_token' => str_random(10)
]);
DB::table('bus_admin')->insert([
'email' => "<EMAIL>",
'password' => bcrypt('<PASSWORD>'),
'company_name' => "Damri",
'balance' => 5000,
'remember_token' => str_random(10)
]);
DB::table('bus_admin')->insert([
'email' => "<EMAIL>",
'password' => <PASSWORD>'),
'company_name' => "Explorer 100",
'balance' => 1000,
'remember_token' => str_random(10)
]);
}
}
<file_sep>/app/Http/Controllers/UserController.php
<?php
namespace App\Http\Controllers;
use App\User;
use App\Bus;
use App\TopUpRequest;
use App\TripHistory;
use Illuminate\Http\Request;
class UserController extends Controller
{
public function register(Request $request){
$request['remember_token'] = str_random(60);
$request['password'] = app('hash')->make($request['password']);
$user = User::create($request->all());
return response()->json(200);
}
public function viewOneUser($user_id){
$user = User::find($user_id);
return response()->json($user, 200);
}
public function pay(Request $request){
$userId = $request['user_id'];
$busId = $request['bus_id'];
$user = User::find($userId);
$bus = Bus::find($busId);
if($user['balance'] < $bus['price']) {
return response()->json([
'status' => false,
'error' => "Saldo Kamu tidak cukup untuk membayar tiket Bus ini",
'price' => $bus['price']
], 200);
} else {
$newBalance = $user['balance'] - $bus['price'];
$user->balance = $newBalance;
$user->save();
TripHistory::create(
array(
'user_id' => $userId,
'bus_id' => $busId,
'on_board_time' => time()
)
);
return response()->json([
'status' => true,
'error' => null,
'price' => $bus['price'],
], 200);
}
}
public function requestTopup(Request $request){
$request['unique_code'] = rand(0, 999);
$request['request_time'] = time();
$request['expire_time'] = time() + 172800000;
$topUpRequest = TopUpRequest::create($request->all());
return response()->json([
'error' => null
], 200);
}
public function viewBalance(Request $request){
$balance = User::select('balance')->where('id', $request['user_id'])->get();
return response()->json($balance, 200);
}
}
<file_sep>/routes/web.php
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function () {
return view('welcome');
});
$router->group(['prefix' => 'api'], function($router){
// Routes for Auth
$router->post('login/', 'AuthController@login');
// Routes for User
$router->get('user/{id}', 'UserController@viewOneUser');
$router->post('user/register', 'UserController@register');
$router->post('user/pay', 'UserController@pay');
$router->post('user/topup/', 'UserController@requestTopup');
$router->post('user/balance', 'UserController@viewBalance');
$router->post('user/pay/history', 'UserController@viewPaymentHistory');
// Routes for Bus
$router->get('route/', 'BusController@viewRoutes');
// Routes for Bus Admin
$router->post('bus-admin/register', 'BusAdminController@register');
$router->post('bus-admin/bus', 'BusAdminController@viewOneBus');
$router->post('bus-admin/bus/all', 'BusAdminController@viewAllBusses');
$router->post('bus-admin/bus/add', 'BusAdminController@addBus');
$router->post('bus-admin/bus/delete', 'BusAdminController@deleteBus');
$router->post('bus-admin/bus/update', 'BusAdminController@updateBus');
});<file_sep>/app/TripHistory.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class TripHistory extends Model
{
protected $table = "trip_history";
protected $fillable = [
'on_board_status', 'user_id', 'bus_id', 'on_board_time', 'exit_time'
];
}
<file_sep>/app/TopUpRequest.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class TopUpRequest extends Model
{
protected $table = "top_up_request";
protected $fillable = [
'accepted_status', 'unique_code', 'nominal', 'request_time', 'expire_time', 'user_id'
];
protected $hidden = [
'unique_code'
];
}
|
70b3821ed516372d17300c01283d9acda01a373e
|
[
"PHP"
] | 8 |
PHP
|
fahmifan/OPTA-Backend
|
951d910e5535c36f2a751e1d8c9e62cc5d35eed5
|
b40ee65b121f0c714db5574cb8b6e7871d61bcbe
|
refs/heads/master
|
<repo_name>lbuchli/mcwayface<file_sep>/README.md
# Go Wayland McWayface
This is a Golang port of drewdevault's Wayland McWayface,
a rather simple wayland compositor, written step by step
to explain the process of developing a wayland compositor
with wlroots (or, in this case go-wlroots).
The original blog series start [here](https://drewdevault.com/2018/02/17/Writing-a-Wayland-compositor-1.html)
This port has it's own version of the blog series on the [wiki](https://github.com/lbuchli/mcwayface/wiki)
Before reading the translation (or the original blog), you should read the wayland compositor
introduction by the same blog author:
[Writing a Wayland compositor](https://drewdevault.com/2018/02/17/Writing-a-Wayland-compositor-1.html)
<file_sep>/mcw/main.go
package main
import (
"fmt"
"os"
"time"
"github.com/lbuchli/go-wlroots/wlroots"
)
type Server struct {
display wlroots.Display
backend wlroots.Backend
seat wlroots.Seat
compositor wlroots.Compositor
xdgShell wlroots.XDGShell
outputs []*Output
surfaces []wlroots.XDGSurface
}
type Output struct {
wlrOutput wlroots.Output
lastFrame time.Time
color [4]float32
}
func main() {
server := new(Server)
server.outputs = make([]*Output, 0)
server.display = wlroots.NewDisplay()
server.backend = wlroots.NewBackend(server.display)
server.backend.OnNewOutput(server.newOuput)
server.backend.Renderer().InitDisplay(server.display)
// configure seat
server.seat = wlroots.NewSeat(server.display, "seat0")
server.compositor = wlroots.NewCompositor(server.display, server.backend.Renderer())
server.xdgShell = wlroots.NewXDGShell(server.display)
server.xdgShell.OnNewSurface(server.handleNewSurface)
// setup socket for wayland clients to connect to
socket, err := server.display.AddSocketAuto()
if err != nil {
panic(err)
}
// start the backend
err = server.backend.Start()
if err != nil {
panic(err)
}
fmt.Printf("Running compositor on wayland display '%s'\n", socket)
err = os.Setenv("WAYLAND_DISPLAY", socket)
if err != nil {
panic(err)
}
// and run the display
server.display.Run()
}
func (s *Server) newOuput(output wlroots.Output) {
out := &Output{
wlrOutput: output,
lastFrame: time.Now(),
color: [4]float32{0, 0, 0, 1},
}
output.CreateGlobal()
out.wlrOutput.OnDestroy(s.destroyOutput)
out.wlrOutput.OnFrame(s.drawFrame)
// set the output mode to the last mode (only if there are modes)
// The last mode is usually the largest at the highest refresh rate
modes := out.wlrOutput.Modes()
if len(modes) > 0 {
out.wlrOutput.SetMode(modes[len(modes)-1])
}
s.outputs = append(s.outputs, out)
}
func (s *Server) destroyOutput(output wlroots.Output) {
for i, out := range s.outputs {
if out.wlrOutput.Name() == output.Name() {
// delete the output from the list
s.outputs = append(s.outputs[:i], s.outputs[i+1:]...)
break
}
}
}
func (s *Server) drawFrame(output wlroots.Output) {
renderer := s.backend.Renderer()
// search for our version of the output
var mcwOut *Output
for _, out := range s.outputs {
if out.wlrOutput.Name() == output.Name() {
mcwOut = out
break
}
}
// check if we haven't found it
if mcwOut == nil {
panic("Could not find display!")
}
width, height := output.EffectiveResolution()
// try to make the current output the current OpenGL context
_, err := output.MakeCurrent()
if err != nil {
panic("Could not change OpenGL context!")
}
renderer.Begin(output, width, height)
renderer.Clear(&wlroots.Color{
A: mcwOut.color[3],
R: mcwOut.color[0],
B: mcwOut.color[1],
G: mcwOut.color[2],
})
for _, surface := range s.surfaces {
surf := surface.Surface()
state := surf.CurrentState()
renderBox := &wlroots.Box{
X: 20,
Y: 20,
Width: state.Width(),
Height: state.Height(),
}
matrix := &wlroots.Matrix{}
transformMatrix := output.TransformMatrix()
matrix.ProjectBox(renderBox, state.Transform(), 0, &transformMatrix)
renderer.RenderTextureWithMatrix(surf.Texture(), matrix, 1)
surf.SendFrameDone(time.Now())
}
output.SwapBuffers()
renderer.End()
}
func (s *Server) handleNewSurface(surface wlroots.XDGSurface) {
surface.OnDestroy(s.handleSurfaceDestroy)
s.surfaces = append(s.surfaces, surface)
}
func (s *Server) handleSurfaceDestroy(surface wlroots.XDGSurface) {
for i, sb := range s.surfaces {
if surface == sb {
s.surfaces = append(s.surfaces[:i], s.surfaces[i+1:]...)
}
}
}
|
de5dfb94ab074766be261cd001869b48b31dc713
|
[
"Markdown",
"Go"
] | 2 |
Markdown
|
lbuchli/mcwayface
|
869844765c66afa7c47f6efc0e8e3dbb1a0f4ce4
|
df402857b921b05d65cd8184d05084fb1a722256
|
refs/heads/master
|
<file_sep>ActiveScaffold::Bridges.bridge "RecordSelect" do
install do
require File.join(File.dirname(__FILE__), "lib/record_select_bridge.rb")
end
end
<file_sep>File.open(File.expand_path('../../../../config/initializers/active_scaffold.rb', __FILE__), 'w') do |f|
f << "#ActiveSupport.on_load(:active_scaffold) { self.js_framework = :jquery }\n"
end
<file_sep>module ActionView
class ActiveScaffoldResolver < FileSystemResolver
# standard resolvers have a base path to views and append a controller subdirectory
# activescaffolds view path do not have a subdir, so just remove the prefix
def find_templates(name, prefix, partial, details)
super(name,'',partial, details)
end
end
end
|
64c8e3bf3072670ccb21757fc4c59663d223c405
|
[
"Ruby"
] | 3 |
Ruby
|
weyus/active_scaffold
|
3513a3d20099b736f669d18f00d9b4b7dbea0de5
|
2fa0588460cd9446623325042108ea8af7755e2a
|
refs/heads/master
|
<file_sep>$(()=>{
$(".login_btn").click(function (){
var uname = $("[name=uname]").val();
var upwd = $("[name=password]").val();
var data={
uname,
upwd
}
console.log(data);
$.ajax({
url:"http://127.0.0.1:3000/user/login",
type:"post",
data,
xhrFields:{withCredentials:true},
success:function(result){
console.log(result);
if(result.code>0){
window.open("index.html","_self")
}else{
$("[name=uname]").val("");
$("[name=password]").val("");
var span = $(".err_tip")[0].children[1]
var em = $(".err_tip")[0].children[0];
$(span).html("登录名与密码不匹配,请重新输入!");
$(".err_tip").addClass("error");
em.style.backgroundPosition="-104px -75px";
console.log(em.style.backgroundPosition)
}
}
})
})
})
var uname = document.getElementsByName("uname")[0];
var pwd = document.getElementsByName("password")[0];
var name_icon = document.getElementsByClassName("name_icon")[0];
var upwd_icon = document.getElementsByClassName("upwd_icon")[0];
uname.addEventListener("focus",function(){
name_icon.style.backgroundPosition="0 -48px";
})
uname.addEventListener("blur",function(){
name_icon.style.backgroundPosition="0 0";
})
pwd.addEventListener("focus",function(){
upwd_icon.style.backgroundPosition="-48px -48px";
})
pwd.addEventListener("blur",function(){
upwd_icon.style.backgroundPosition="-48px 0";
})
<file_sep>var goTop = document.querySelector(".icon-gotop")
window.onscroll = function () {
var aa = document.body.scrollTop || document.documentElement.scrollTop;
if (aa > 10) {
goTop.style.display = "block"
} else {
goTop.style.display = "none"
}
}
goTop.onclick = function () {
window.scrollTo(0, 0);
}
var search = document.getElementById("search")
var searchBtn = document.querySelector(".input-submit");
var near_hot_search = document.querySelector(".near-hot-search");
search.addEventListener("input",function(){
near_hot_search.style.opacity="0";
if(search.value === ""){
near_hot_search.style.opacity="1";
}
})
searchBtn.addEventListener("click",function(){
if(search.value){
window.open(`../public/category.html?title=${search.value}`,"_self")
// axios.post("http://127.0.0.1:3000/product/searchDetail",`title=${search.value}`).then(res=>{
// }).catch(err=>{
// console.log(err);
// })
}
})
search.addEventListener("keydown",function(e){
if(e.keyCode == 13){
if(search.value){
window.open(`../public/category.html?title=${search.value}`,"_self")
// axios.post("http://127.0.0.1:3000/product/searchDetail",`title=${search.value}`).then(res=>{
// }).catch(err=>{
// console.log(err);
// })
}
}
})
//首页轮播图
var ul = document.querySelectorAll(".ppt ul")[0]
var list = ul.children;
var ol = document.querySelectorAll(".tab ol")[0]
var points = ol.children;
var x = 0;
function up(m) {
if (!m) {
m = x + 0;
}
for (var j = 0; j < list.length; j++) {
list[j].className = "";
points[j].className = "";
}
x = m;
if (x == 5) {
x = 0
}
list[x].className = "list_active"
points[x].className = "on";
x++;
}
setInterval(function () {
up();
}, 3000)
var canClick = true;
ol.onclick = function (e) {
if (canClick) {
canClick=false;
var li = e.target;
if (li.nodeName == "LI") {
if (li.className !== "on") {
for (var i = 0; i < points.length; i++) {
if (points[i] == li) {
break;
}
}
up(i);
setTimeout(function () {
canClick = true;
}, 300);
}
}
}
}
// 底部轮播图
var i = 0;
var LIWIDTH = 1230;
var DURATION = 500;
var LICOUNT = 3;
var ulImgs = document.querySelector(".brand_list");
function moveTo(to) {
if (to == undefined) {
to = i + 1;
}
if (i == 0) {
if (to > i) {
ulImgs.className = "brand_list clearfix tr";
} else {
ulImgs.className = "brand_list clearfix";
ulImgs.style.marginLeft = -LIWIDTH * LICOUNT + "px";
setTimeout(function () {
moveTo(LICOUNT - 1);
}, 100);
return;
}
}
i = to;
ulImgs.style.marginLeft = -i * LIWIDTH + "px";
if (i == LICOUNT) {
i = 0;
setTimeout(function () {
ulImgs.className = "brand_list clearfix";
ulImgs.style.marginLeft = 0;
}, DURATION)
}
}
var btnLeft = document.getElementById("btn-left");
var btnRight = document.getElementById("btn-right");
//用开关,控制,上次动画没有播放完,下次动画不能开始!
var canClick = true;
btnRight.onclick = function () {
//调用两个按钮公共的移动方法,参数1表示移动到i+1的位置,相当于左移一个
move(1)
}
//两个按钮共用的移动函数,n传入1时,移动到i+1位置,左移。n传入-1时,移动到i-1位置,右移
function move(n) {
if (canClick) { //只有可以单击时
moveTo(i + n); //才调用真正移动ul的方法
canClick = false; //马上把开关关上,禁止再次点击
//只有本地transition动画播放完,才能自动打开开关,点击按钮才有反应。
setTimeout(function () {
canClick = true;
}, DURATION + 100);
}
}
btnLeft.onclick = function () {
move(-1);
}
var timer = setInterval(function () {
moveTo()
}, 3000)
// var ul = document.querySelector(".brand_list");
// var i = 0;
// var length = 1230;
// function moveTo(to) {
// if (!to) {
// to = i + 1;
// }
// if (i == 0) {
// if(to>i){
// ul.className = "brand_list clearfix tr";
// }else if(i<1){
// ul.className = "brand_list clearfix";
// ul.style.marginLeft = -length * 3 + "px";
// console.log(i);
// setTimeout(function(){
// moveTo(2);
// },100);
// return;
// }
// }
// i = to;
// console.log("正常的"+i)
// ul.style.marginLeft = -i * length + "px";
// if (i == 3) {
// i = 0;
// setTimeout(function () {
// ul.className = "brand_list clearfix";
// ul.style.marginLeft = 0;
// }, 500)
// }
// }
// // setInterval(function () {
// // moveTo()
// // }, 3000)
// var btnLeft=document.getElementById("btn-left");
// var btnRight=document.getElementById("btn-right");
// //用开关,控制,上次动画没有播放完,下次动画不能开始!
// var canClick=true;
// btnRight.onclick=function(){
// //调用两个按钮公共的移动方法,参数1表示移动到i+1的位置,相当于左移一个
// move(1)
// }
// //两个按钮共用的移动函数,n传入1时,移动到i+1位置,左移。n传入-1时,移动到i-1位置,右移
// function move(n){
// if(canClick){//只有可以单击时
// moveTo(i+n);//才调用真正移动ul的方法
// console.log("点击时的"+(i+n));
// console.log("点击时的"+i);
// canClick=false;//马上把开关关上,禁止再次点击
// //只有本地transition动画播放完,才能自动打开开关,点击按钮才有反应。
// setTimeout(function(){
// canClick=true;
// },600);
// }
// }
// btnLeft.onclick=function(){
// move(-1);
// }
<file_sep>var uname = document.getElementsByName("uname")[0];
var upwd = document.getElementsByName("upwd")[0];
var password = document.getElementsByName("password")[0];
var phone = document.getElementsByName("phone")[0];
var reg_btn = document.getElementsByClassName("reg_btn")[0];
var check = /^[\w-]{4,20}$/;
var checkPhone = /^1[345678]\d{9}$/
uname.addEventListener("focus",function(){
var info = uname.parentElement.nextElementSibling;
info.innerHTML="请输入4-20位的字符"
info.style.color="#00B7EE"
})
uname.addEventListener("blur",function(){
var info = uname.parentElement.nextElementSibling;
if(!uname.value){
info.innerHTML="用户名不能为空"
info.style.color="#d82618";
return
}
if(check.test(uname.value)){
axios.post("http://127.0.0.1:3000/user/hasReg","uname="+uname.value).then(res=>{
if(res.data.code){
info.innerHTML=res.data.msg
info.style.color="#d82618"
}else{
info.innerHTML=res.data.msg
info.style.color="#00B7EE"
}
}).catch(err=>{
console.log(err);
})
}else{
info.innerHTML="用户名只能用英文、数字及 -、_ 组成的4-20位字符"
info.style.color="#d82618"
}
})
upwd.addEventListener("blur",function(){
var info = upwd.parentElement.nextElementSibling;
if(check.test(upwd.value)){
if(uname.value==upwd.value){
info.innerHTML="用户名和密码不能相同"
info.style.color="#d82618"
}else{
info.innerHTML = "";
}
}else{
info.innerHTML="密码只能用英文、数字及 -、_ 组成的4-20位字符"
info.style.color="#d82618"
}
})
password.addEventListener("blur",function(){
var info = password.parentElement.nextElementSibling;
if(password.value==upwd.value){
info.innerHTML = "";
}else{
info.innerHTML="两次密码不一致"
info.style.color="#d82618"
}
})
phone.addEventListener("blur",function(){
var info = phone.parentElement.nextElementSibling;
if(!checkPhone.test(phone.value)){
info.innerHTML = "手机号格式不正确";
info.style.color="#d82618";
}
})
reg_btn.addEventListener("click",function(){
if(uname.value){
if(uname.parentElement.nextElementSibling.innerHTML=="用户名可用"){
if(check.test(upwd.value)){
if(uname.value!==upwd.value){
if(password.value==upwd.value){
if(checkPhone.test(phone.value)){
axios.post("http://127.0.0.1:3000/user/reg",`uname=${uname.value}&upwd=${password.value}`).then(result=>{
if(result.data){
window.open("./login.js","_self");
}
}).catch(err=>{
console.log(err);
})
}
}
}
}
}
}
})
<file_sep>const mysql = require('mysql');
const pool = mysql.createPool({
host:"127.0.0.1",
port:"3306",
user:"root",
password:"",
database:"alighting",
connectionLimit:10
})
module.exports=pool;<file_sep>axios.defaults.withCredentials = true;
axios.get("http://127.0.0.1:3000/product/searchCart").then(result=>{
var data = result.data.data;
// console.log(data)
var cart_del = document.getElementById("cart_del")
html = ``;
if(result.data.code == 0){
cart_del.innerHTML = `<div class="bruce flex-ct-x">
<div class="fault-text" data-text="暂无商品">暂无商品</div>
</div>`
}else{
if(result.data.data.length>0){
for(var key of data){
// console.log(key)
html+=`
<div class="lh30 mBtm10 clearfix">
<h4>产品清单</h4>
</div>
<div class="cart_cnt clearfix">
<div class="cart_cnt_tit">
<span class="c999">供应商:</span>
<a href="javascript:;">${key.company}</a>
<strong class="mLeft20">${key.linkman} ${key.phone}</strong>
</div>
<table class="table">
<thead>
<tr validated="0">
<th width="450" class="text-left">产品</th>
<th width="150">单价(元)</th>
<th width="150">数量</th>
<th width="100">金额(元)</th>
<th width="100">操作</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-left">
<input type="checkbox" checked value="" class="checkbox_left">
<a href="javascript:;" class="img60">
<img src="${key.img}" alt="">
</a>
<a href="javascript:;" class="pro_title">${key.title}</a>
</td>
<td>
<span>${key.price.toFixed(2)}</span>
</td>
<td id="add_td" data-td="${key.cid}">
<i class="icon minus">-</i><input type="text" class="input_text" value="${key.count}"><i class="icon plus">+</i>
</td>
<td>
<span>${key.price.toFixed(2)}</span>
</td>
<td>
<a href="javascript:;" data-cid="${key.cid}" class="icon_del"></a>
</td>
</tr>
</tbody>
</table>
<div class="checkbox_all">
<label class="mRight20"><input type="checkbox" checked>全选</label>
<a href="javascript:;">批量删除</a>
</div>
<div class="cart_submit_box clearfix" style="padding-left: 700px" att="${key.cid}">
<div class="cart_submit_box_pre" >
<p>
<label>数量 :</label>
<b>${key.count}</b>
</p>
<p>
<label>产品总价 :</label>
<span class="price">${key.price.toFixed(2)}</span>元
</p>
<p class="mTop10">
<label>支付总金额 :</label>
<b class="cf60 f16" price="${key.price}">${key.price.toFixed(2)}</b>
<span class="cf60">元</span>
</p>
</div>
<div class="cart_submit_box_btn">
<a href="javascript:;">继续采购>>></a>
<a href="javascript:;" class="mTop10 blue_btn">去结算</a>
</div>
</div>
</div>
`
}
cart_del.innerHTML = html;
// console.log(result.data)
console.log(cart_del)
var aaa = document.querySelectorAll(".icon_del");
for(var key of aaa){
key.addEventListener("click",function(e){
var cid = e.target.dataset.cid;
console.log(cid);
var data = {cid}
axios.get("http://127.0.0.1:3000/product/del",{ //params参数必写 , 如果没有参数传{}也可以
params:data
}).then(result=>{
console.log(result);
}).catch(err=>{
console.log(err);
})
})
}
var td = document.querySelectorAll(".cart_cnt");
for(var key of td){
key.addEventListener("click",function(e){
var inp = document.querySelector(".input_text");
var id = e.target.dataset.td;
if(e.target.nodeName=="I"){
var att = e.target.closest(".table").nextElementSibling.nextElementSibling;
var b = att.getElementsByTagName("b");
var price = att.getElementsByTagName("span")[0];
var count = b[0];
var sum = b[1];
if(e.target.innerHTML=="-"&&parseInt(e.target.nextElementSibling.value)>1){
e.target.nextElementSibling.value = parseInt(e.target.nextElementSibling.value)-1;
count.innerHTML = e.target.nextElementSibling.value;
sum.innerHTML = (e.target.nextElementSibling.value*sum.getAttribute("price")).toFixed(2)
price.innerHTML = sum.innerHTML
}else if(e.target.innerHTML=="+"){
e.target.previousElementSibling.value = parseInt(e.target.previousElementSibling.value)+1;
count.innerHTML = e.target.previousElementSibling.value;
sum.innerHTML = (e.target.previousElementSibling.value*sum.getAttribute("price")).toFixed(2)
price.innerHTML = sum.innerHTML
}
}
})
}
}else{
cart_del.innerHTML = `<div class="bruce flex-ct-x">
<div class="fault-text" data-text="暂无商品">暂无商品</div>
</div>`
}
}
}).catch(err=>{
console.log(err);
})<file_sep>var navcon_first = document.querySelector(".navcon_first_a");
var pro_class = document.querySelector(".pro-class");
console.log(navcon_first)
navcon_first.addEventListener("mouseenter",function(){
pro_class.style.display="block"
})
navcon_first.addEventListener("mouseleave",function(e){
if(e.relatedTarget.closest(".pro-class"))return
pro_class.style.display="none"
})
pro_class.addEventListener("mouseleave",function(){
pro_class.style.display="none"
})
<file_sep>var tab1 = document.querySelectorAll(".alt-tabs-content")[0];
var tab2 = document.querySelectorAll(".alt-tabs-content")[1];
var span1 = document.querySelectorAll(".alt_tabs .tab span")[0];
var span2 = document.querySelectorAll(".alt_tabs .tab span")[1];
span1.onclick=function(){
span1.setAttribute("class","cur");
span2.setAttribute("class","");
tab1.style.display="block";
tab2.style.display="none";
}
span2.onclick=function(){
span1.setAttribute("class","");
span2.setAttribute("class","cur");
tab1.style.display="none";
tab2.style.display="block";
}
var focus_tabs = document.querySelector(".focus-tabs");
var big_img = document.querySelector(".big_img")
focus_tabs.addEventListener("mouseover",function(e){
if(e.target.nodeName == "LI"){
for(var i=0;i< big_img.children.length;i++){
big_img.children[i].style.display="none"
if(i==e.target.dataset.imgid){
big_img.children[i].style.display="block"
}
}
}
})
var navcon_first = document.querySelector(".navcon_first_a");
var pro_class = document.querySelector(".pro-class");
navcon_first.addEventListener("mouseenter",function(){
pro_class.style.display="block"
})
navcon_first.addEventListener("mouseleave",function(e){
if(e.relatedTarget.closest(".pro-class"))return
pro_class.style.display="none"
})
pro_class.addEventListener("mouseleave",function(){
pro_class.style.display="none"
})
var goTop = document.querySelector(".icon-gotop")
window.onscroll = function () {
var aa = document.body.scrollTop || document.documentElement.scrollTop;
if (aa > 10) {
goTop.style.display = "block"
} else {
goTop.style.display = "none"
}
}
goTop.onclick = function () {
window.scrollTo(0, 0);
}<file_sep>// 可选地,上面的请求可以这样做
axios.get('http://127.0.0.1:3000/user/snzm').then(result=> {
var f1 = document.getElementById("floor1");
var f2 = document.getElementById("floor2");
var f3 = document.getElementById("floor3");
var f4 = document.getElementById("floor4");
var f5 = document.getElementById("floor5");
var f6 = document.getElementById("floor6");
var html = ``;
for(var i=70;i<80;i++){
var data = result.data[i];
html+=`
<li>
<var>
<a href="javascript:;">
<img src="${data.img_url}" alt="">
<samp></samp>
</a>
<ins>${data.title}</ins>
<h4>${data.details}</h4>
<h5>${data.factory}</h5>
<p>
<a href="javascript:;">查看产品</a>
</p>
</var>
</li>
`
}
f1.innerHTML=html;
html=``;
for(var i=80;i<90;i++){
var data = result.data[i];
html+=`
<li>
<var>
<a href="javascript:;">
<img src="${data.img_url}" alt="">
<samp></samp>
</a>
<ins>${data.title}</ins>
<h4>${data.details}</h4>
<h5>${data.factory}</h5>
<p>
<a href="javascript:;">查看产品</a>
</p>
</var>
</li>
`
}
f2.innerHTML=html;
html=``;
for(var i=90;i<100;i++){
var data = result.data[i];
html+=`
<li>
<var>
<a href="javascript:;">
<img src="${data.img_url}" alt="">
<samp></samp>
</a>
<ins>${data.title}</ins>
<h4>${data.details}</h4>
<h5>${data.factory}</h5>
<p>
<a href="javascript:;">查看产品</a>
</p>
</var>
</li>
`
}
f3.innerHTML=html;
html=``;
for(var i=100;i<110;i++){
var data = result.data[i];
html+=`
<li>
<var>
<a href="javascript:;">
<img src="${data.img_url}" alt="">
<samp></samp>
</a>
<ins>${data.title}</ins>
<h4>${data.details}</h4>
<h5>${data.factory}</h5>
<p>
<a href="javascript:;">查看产品</a>
</p>
</var>
</li>
`
}
f4.innerHTML=html;
html=``;
for(var i=110;i<120;i++){
var data = result.data[i];
html+=`
<li>
<var>
<a href="javascript:;">
<img src="${data.img_url}" alt="">
<samp></samp>
</a>
<ins>${data.title}</ins>
<h4>${data.details}</h4>
<h5>${data.factory}</h5>
<p>
<a href="javascript:;">查看产品</a>
</p>
</var>
</li>
`
}
f5.innerHTML=html;
html=``;
for(var i=120;i<130;i++){
var data = result.data[i];
html+=`
<li>
<var>
<a href="javascript:;">
<img src="${data.img_url}" alt="">
<samp></samp>
</a>
<ins>${data.title}</ins>
<h4>${data.details}</h4>
<h5>${data.factory}</h5>
<p>
<a href="javascript:;">查看产品</a>
</p>
</var>
</li>
`
}
f6.innerHTML=html;
html=``;
for(var i=60;i<70;i++){
var data = result.data[i];
html+=`
<li>
<var>
<a href="javascript:;">
<img src="${data.img_url}" alt="">
<samp></samp>
</a>
<ins>${data.title}</ins>
<h4>${data.details}</h4>
<h5>${data.factory}</h5>
<p>
<a href="javascript:;">查看产品</a>
</p>
</var>
</li>
`
}
f7.innerHTML=html;
})
.catch(function (error) {
console.log(error);
});
window.onscroll = function () {
var top = document.body.scrollTop || document.documentElement.scrollTop;
var fixnav = document.querySelector(".fixnav");
if (top > 520) {
fixnav.style.display = "block"
} else {
fixnav.style.display = "none"
}
var div = document.querySelectorAll(".fixnav .nav")[0];
var list = div.children;
if (top > 600) {
for (var key of list) {
key.className = ""
}
list[0].className = "cur"
}
if (top > 1330) {
for (var key of list) {
key.className = ""
}
list[1].className = "cur"
}
if (top > 2030) {
for (var key of list) {
key.className = ""
}
list[2].className = "cur"
}
if (top > 2750) {
for (var key of list) {
key.className = ""
}
list[3].className = "cur"
}
if (top > 3450) {
for (var key of list) {
key.className = ""
}
list[4].className = "cur"
}
if (top > 4140) {
for (var key of list) {
key.className = ""
}
list[5].className = "cur"
}
if (top > 4800) {
for (var key of list) {
key.className = ""
}
list[6].className = "cur"
}
}
|
8d673c4fbd7f88e721499fe7a5f3dc188e2466ff
|
[
"JavaScript"
] | 8 |
JavaScript
|
Nine9Dragon/alighting
|
1a9ded9522c50148aefc36756ccf48f5004f27bf
|
253365a80e255c703205520c9aed31e761a88ffd
|
refs/heads/main
|
<file_sep>import socket
import struct
import time
import threading
from scapy.arch import get_if_addr
class Server:
def __init__(self):
"""
Server initiate: define the parameters and data structure for the server.
"""
# Server Authorization Parameters
self.magic_cookie = 0xfeedbeef
self.offer_message_type = 0x2
# Server Global Parameters
self.network_ip = get_if_addr('eth1')
self.tcp_port = 2032
self.udp_dest_port = 13117
self.threads = []
self.master_tcp_socket = None
self.udp_socket = None
self.buffer_size = 1024
self.timing = 10
self.game_mode = False
self.connections = {} # {key: conn, value: (group_name, groupNumber)}
self.groups = {1: {}, 2: {}} # {key: groupNumber, value: {key: groupName, value: [connection, groupScore]}
self.groups_scores = {1: 0, 2: 0}
self.num_of_participants = 0
self.best_score_ever = 0
# Initiate Threads for server: TCP and UDP Protocols
self.tcp_thread = threading.Thread(target=self.server_tcp_binding)
self.udp_thread = threading.Thread(target=self.server_udp_binding)
def start_server(self):
"""
This function activate ports tcp & udp (happens once!!!)
"""
try:
self.tcp_thread.start()
self.udp_thread.start()
time.sleep(1.5)
except OSError:
time.sleep(1)
finally:
self.server_state_tcp_listening()
def server_state_udp(self):
"""
This function handle broadcast of udp to network
"""
message_to_send = struct.pack('Ibh', self.magic_cookie, self.offer_message_type, self.tcp_port)
# sending offers to port 13117 every second for 10 seconds
counter = 0
start = time.time()
while counter < self.timing and time.time()-start < self.timing:
self.udp_socket.sendto(message_to_send, ("<broadcast>", self.udp_dest_port))
time.sleep(1)
counter += 1
def server_tcp_binding(self):
"""
This function starting socket as TCPSocket and bind it to our port (2032)
"""
self.master_tcp_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.master_tcp_socket.bind((self.network_ip, self.tcp_port))
def server_udp_binding(self):
"""
This function starting socket as UDPSocket and bind it to our port, Enable broadcasting mode
"""
self.udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # Internet # UDP
self.udp_socket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
def server_state_tcp_listening(self):
"""
This function starting to listening the tcp port
"""
self.master_tcp_socket.listen(1)
print("Server started, listening on IP address {}".format(self.network_ip))
# starting udp connection thread
udp_starter = threading.Thread(target=self.server_state_udp)
udp_starter.start()
# starting start game thread
thread_start_game = threading.Timer(self.timing, self.start_game)
thread_start_game.start()
# listening to the port for 10 sec
# getting tries to connection from clients
while not self.game_mode:
try:
conn, addr = self.master_tcp_socket.accept()
if conn:
team_name = conn.recv(buffer_size)
team_name = str(team_name.decode("utf-8").rstrip())
if not team_name or self.game_mode:
conn.close()
break
client_group_num = (self.num_of_participants % 2) + 1
self.num_of_participants += 1
self.connections[conn] = (team_name, client_group_num)
self.groups[client_group_num][team_name] = conn
except error as e:
time.sleep(1)
def get_welcome_message(self):
"""
This function creating the welcome message
"""
welcome = "Welcome to Keyboard Spamming Battle Royale."
for group in self.groups.keys():
welcome += "\nGroup {}:\n==\n".format(group)
for team in self.groups[group].keys():
welcome += "{}\n\n".format(team)
welcome += "\nStart pressing keys on your keyboard as fast as you can!!\n"
return welcome
def start_game(self):
"""
This function starting the game, activated slaves only if there is connections
"""
#
self.set_game_mode(True)
if self.num_of_participants > 0:
welcome_message = self.get_welcome_message()
self.slaves_threads_manage()
self.send_message_to_clients(welcome_message)
thread_finish_game = threading.Timer(self.timing, self.finish_game)
thread_finish_game.start()
def kill_slaves_threads(self):
"""
This function delete the list of threads
"""
self.threads.clear()
def check_winning_group(self):
"""
This function calculate the winning group and return a game over message
:return: The Game Over message
"""
group_score, max_score, curr_winning_team, best_score = 0, 0, 1, False
message = "Game over!\n"
# check who is the winning team (by score)
for group in self.groups_scores.keys():
group_score = self.groups_scores[group]
if group_score > max_score:
max_score = group_score
curr_winning_team = group
if group_score > self.best_score_ever:
self.best_score_ever = group_score
best_score = True
message += "Group {0} types in {1} characters. ".format(group, group_score)
group_score = 0
message += "\nGroup {} wins!\n".format(curr_winning_team)
if best_score:
rap = "##############################################################\n"
message += rap + "# WOW !!!! this is the best score on this server! Well Done! #\n" + rap
message += "\nCongratulations to the winners:\n==\n"
for team in self.groups[curr_winning_team].keys():
message += "{}\n".format(team)
return message
def finish_game(self):
"""
This function finish the game, send summary message to clients if there is connection
"""
self.set_game_mode(False)
if self.num_of_participants > 0:
self.kill_slaves_threads()
summary_message = self.check_winning_group()
self.send_message_to_clients(summary_message)
self.clean_last_game()
def thread_slave_activate(self, connection):
"""
In This function each slave handle different client's msg
"""
# each slave handle different client's msg
group_num = self.connections[connection][1]
while self.game_mode:
try:
msg = connection.recv(buffer_size)
if not msg:
continue
msg = str(msg.decode("utf-8").rstrip())
if len(msg) == 1:
self.groups_scores[group_num] += 1
except:
return
def slaves_threads_manage(self):
"""
This function create slave thread for each connection
"""
for conn in self.connections.keys():
x = threading.Thread(target=self.thread_slave_activate, args=(conn,))
self.threads.append(x)
x.start()
def send_message_to_clients(self, message):
"""
This function sends the message to all the connection
:param message: The message to send
"""
# print(message)
for conn in self.connections.keys():
try:
# print("Send message to {}".format(self.connections[conn][0]))
conn.send(bytes(message, 'utf-8'))
except:
continue
def set_game_mode(self, status):
"""
This function set the game mode to a given boolean value
:param status: the status of the game to change - true or false
"""
self.game_mode = status
def clean_last_game(self):
"""
This function cleans the prev game
an allow a new game to start
"""
for conn in self.connections.keys():
try:
conn.close()
except:
continue
self.connections = {}
# cleaning the game properties
self.num_of_participants = 0
for group in self.groups.keys():
self.groups[group] = {}
print("Game over, sending out offer requests...")
self.server_state_tcp_listening()
if __name__ == "__main__":
server = Server()
server.start_server()
<file_sep>
## Game Keyboard Spamming Battle Royale
### Hackathon Network (The Secrets Team)
* This project was build as a part of "Intro to Data Comuunication" Course, taken in Ben Gurion University, Information System Engineering Faculty.
* The app was built in Python accoriding to Server-Client architecture and uses Sockets, Client-Server programming, Multithreading, TCP and UDP Protocols
### About
- Rules:
* The players in this game are randomly divided into two teams
* which have ten seconds to mash as many keys on the keyboard as possible.
- Instruction:
* activate the server.
* activate the client.
* when the connection is created - the client will get a "start to push on buttons" command.
Have Fun!
* <NAME> and <NAME>
<file_sep>import socket
import struct
from getch import _Getch
import time
from scapy.all import*
class Client:
"""
This Client class.
use as the player in the game.
get UDP packets from the server and connect to TCP server
"""
def __init__(self):
"""
Initiation to the client class: initiate all the IP's ports and authorization parameter
"""
# Server Authorization Parameters
self.magic_cookie = 0xfeedbeef # 0xfeedbeef
self.offer_message_type = 0x2
# Client Global Parameters
self.ip_network = get_if_addr('eth1')
self.udp_listen_port = 13117
self.buffer_size = 1024
self.team_name = "The <PASSWORD>\n"
self.sending_message_time = 8
self.tcp_socket = None
def listen_state(self):
"""
This function means the client is in the listen (to udp) state:
Client get udp from server, check the TCPs port to connect for starting the game
"""
sock_udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock_udp.bind(('', self.udp_listen_port))
print("Client started, listening for offer requests...")
# Client Listen to the udp port - 13117, until catch a message
while True:
try:
message, addr = sock_udp.recvfrom(buffer_size) # buffer size is 7 bytes
print("Received offer from {}, attempting to connect...".format(addr[0]))
# Handle properly message and extract the server's port number
unpack_message = struct.unpack('Ibh', message)
if len(unpack_message) == 3 and \
unpack_message[0] == self.magic_cookie and \
unpack_message[1] == self.offer_message_type:
self.connect_server_state(addr[0], unpack_message[2])
break
except socket.error as e:
time.sleep(1)
def connect_server_state(self, server_address, server_port):
"""
This function Try to connect the server and return a socket if succeed
:param server_address: the server ip to connect to
:param server_port: the server port to connect to
"""
# print("trying to connect ip:{}, port:{}".format(server_address, server_port))
self.tcp_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.tcp_socket.connect((server_address, server_port))
def send_details_to_server(self):
"""
This function send the Team-Name to the server
"""
self.sock_tcp.sendto(bytes(self.team_name, 'utf-8'))
welcome_message, addr = self.sock_tcp.recv(self.buffer_size)
if welcome_message:
print(welcome_message)
self.game_state()
def game_state(self):
"""
This function means the client is in the game state:
meaning: the client sends messages to the server (chars)
the client listen to the server respond - "game is over"
"""
start = time.time()
while time.time()-start < self.sending_messgae_time:
try:
char = _Getch()
sock_tcp.send(char)
except:
# probably server disconnected
self.listen_state()
message, addr = self.sock_tcp.recv(self.buffer_size)
if not len(message) == 0:
message_to_print = message.decode("utf-8")
print(message_to_print)
self.listen_state()
def run_game(self):
"""
This function initiate the game
"""
self.listen_state()
if self.tcp_socket:
self.send_details_to_server()
if __name__ == "__main__":
client = Client()
while True:
try:
client.run_game()
except:
time.sleep(1)
|
bf8d501c34a55ed1161c62f3521bbde97b5b1bca
|
[
"Markdown",
"Python"
] | 3 |
Python
|
asafsalo/Hackathon_Network
|
82c01bb3418bbd0829afec1e55505c683ced9f04
|
395bc5003f37eb21f6016d974549c620678d45a4
|
refs/heads/master
|
<file_sep>import React, { Component } from "react";
import Grid from './grid';
import './index.css';
export default class Game extends Component {
constructor() {
super();
}
render() {
return (
<div className="container">
<Grid></Grid>
</div>
);
}
}<file_sep># Simple React Based Game
## Introduction
Fetch the repo from github and then run following command:
```javascript
npm install
```
Run local server:
```javascript
npm start
```
That's it! You are good to go.
|
41818b58ce46d8bf26ae65f5bbc9e765705e8905
|
[
"JavaScript",
"Markdown"
] | 2 |
JavaScript
|
ruchit-parikh/simple-react-game
|
a2e98ebf7a86122084fc38bc7fc8a6d2eaa1db93
|
a51c72766ad7cedfd56a9fa3a586eaa0576c8774
|
refs/heads/master
|
<file_sep>#include <string.h>
#include <mysql/mysql.h>
#include <stdio.h>
#include <stdlib.h>
#define DB_HOST "localhost"
#define DB_USER "root"
#define DB_PASS "<PASSWORD>"
#define DB_NAME "testdb"
#define STRING_SIZE 50
int main(int argc, char **argv)
{
MYSQL_STMT *stmt;
MYSQL *con = mysql_init(NULL);
MYSQL_BIND bind[1];
my_ulonglong affected_rows;
MYSQL_RES *result;
MYSQL_ROW row;
char str_data[STRING_SIZE];
unsigned long str_length;
int param_count;
const char* query;
unsigned int num_fields;
unsigned int i;
char** table;
if (mysql_library_init(0, NULL, NULL)) {
fprintf(stderr, "could not initialize MySQL client library\n");
exit(1);
}
if (con == NULL)
{
fprintf(stderr, "%s\n", mysql_error(con));
exit(1);
}
if (mysql_real_connect(con, DB_HOST, DB_USER, DB_PASS,
DB_NAME, 0, NULL, 0) == NULL)
{
fprintf(stderr, "%s\n", mysql_error(con));
mysql_close(con);
exit(1);
}
query = "SELECT * FROM testtable";
stmt = mysql_stmt_init(con);
if(!stmt)
{
fprintf(stderr, " mysql_stmt_init(), out of memory\n");
fprintf(stderr, "%s\n", mysql_error(con));
mysql_close(con);
exit(1);
}
if(mysql_stmt_prepare(stmt, query, strlen(query)))
{
fprintf(stderr, " mysql_stmt_prepare(), INSERT failed\n");
fprintf(stderr, " %s\n", mysql_stmt_error(stmt));
exit(0);
}
fprintf(stdout, " prepare, SELECT successful\n");
param_count = mysql_stmt_param_count(stmt);
fprintf(stdout, " total parameters in SELECT: %d\n", param_count);
/*
if (param_count != 1)
{
fprintf(stderr, " invalid parameter count returned by MySQL\n");
exit(0);
}
memset(bind, 0, sizeof(bind));
bind[0].buffer_type = MYSQL_TYPE_STRING;
bind[0].buffer = (char*)str_data;
bind[0].buffer.length = STRING_SIZE;
bind[0].is_null = 0;
bind[0].length = &str_length;
ur quel sujetif(mysql_stmt_bind_param(stmt, bind))
{
fprintf(stderr, " mysql_stmt_bind_param() failed\n");
fprintf(stderr, " %s\n", mysql_stmt_error(stmt));
exit(0);
}
strncpy(str_data, DB_NAME, STRING_SIZE);
str_length = strlen(str_data);
if (mysql_stmt_execute(stmt))
{
fprintf(stderr, " mysql_stmt_execute(), 1 failed\n");
fprintf(stderr, " %s\n", mysql_stmt_error(stmt));
exit(0);
}*/
result = mysql_list_tables(con, NULL);
if(result)
{
num_fields = mysql_num_fields(result);
printf("result is empty %d\n", num_fields);
}else{
fprintf(stderr,"Error: %s\n", mysql_error(&stmt));
}
/*
*table = malloc(sizeof(MYSQL_RES)*num_fields);
if(*table == NULL)
{
fprintf(stderr, "Error: malloc doesn't work");
return EXIT_FAILURE;
}
*/
while((row = mysql_fetch_row(result)))
{
unsigned long *lengths;
lengths = mysql_fetch_lengths(result);
printf("result is empty %d\n", num_fields);
for(i = 0; i < num_fields; i++)
{
printf("%.*s ", (int) lengths[i],
row[i] ? row[i] : "NULL");
}
printf("\n");
}
printf("la requete a été executé\n");
mysql_stmt_close(stmt);
mysql_close(con);
mysql_library_end();
return EXIT_SUCCESS;
}
<file_sep>this project is an c aplication for create Qr code
For create it we have use 'https://github.com/nayuki/QR-Code-generator' this repository
<file_sep>-- MySQL dump 10.13 Distrib 5.7.29, for Linux (x86_64)
--
-- Host: localhost Database: home_service
-- ------------------------------------------------------
-- Server version 5.7.29-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Dumping data for table `bill`
--
LOCK TABLES `bill` WRITE;
/*!40000 ALTER TABLE `bill` DISABLE KEYS */;
/*!40000 ALTER TABLE `bill` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Dumping data for table `city`
--
LOCK TABLES `city` WRITE;
/*!40000 ALTER TABLE `city` DISABLE KEYS */;
/*!40000 ALTER TABLE `city` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Dumping data for table `coast_estimate`
--
LOCK TABLES `coast_estimate` WRITE;
/*!40000 ALTER TABLE `coast_estimate` DISABLE KEYS */;
/*!40000 ALTER TABLE `coast_estimate` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Dumping data for table `job`
--
LOCK TABLES `job` WRITE;
/*!40000 ALTER TABLE `job` DISABLE KEYS */;
/*!40000 ALTER TABLE `job` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Dumping data for table `mission`
--
LOCK TABLES `mission` WRITE;
/*!40000 ALTER TABLE `mission` DISABLE KEYS */;
/*!40000 ALTER TABLE `mission` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Dumping data for table `service_provider`
--
LOCK TABLES `service_provider` WRITE;
/*!40000 ALTER TABLE `service_provider` DISABLE KEYS */;
/*!40000 ALTER TABLE `service_provider` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Dumping data for table `services`
--
LOCK TABLES `services` WRITE;
/*!40000 ALTER TABLE `services` DISABLE KEYS */;
/*!40000 ALTER TABLE `services` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Dumping data for table `subscribe`
--
LOCK TABLES `subscribe` WRITE;
/*!40000 ALTER TABLE `subscribe` DISABLE KEYS */;
/*!40000 ALTER TABLE `subscribe` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Dumping data for table `subscription`
--
LOCK TABLES `subscription` WRITE;
/*!40000 ALTER TABLE `subscription` DISABLE KEYS */;
/*!40000 ALTER TABLE `subscription` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Dumping data for table `user`
--
LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2020-03-29 14:13:41
<file_sep>-- MySQL dump 10.13 Distrib 5.7.29, for Linux (x86_64)
--
-- Host: localhost Database: home_service
-- ------------------------------------------------------
-- Server version 5.7.29-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Current Database: `home_service`
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `home_service` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `home_service`;
--
-- Table structure for table `bill`
--
DROP TABLE IF EXISTS `bill`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bill` (
`idBill` int(11) NOT NULL AUTO_INCREMENT,
`idServiceProvider` int(11) DEFAULT NULL,
`duration` datetime DEFAULT NULL,
`billDate` date NOT NULL,
`htPrice` double DEFAULT NULL,
`price` double NOT NULL,
`state` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`idBill`),
KEY `idServiceProvider` (`idServiceProvider`),
CONSTRAINT `bill_ibfk_1` FOREIGN KEY (`idServiceProvider`) REFERENCES `service_provider` (`idServiceProvider`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `bill`
--
LOCK TABLES `bill` WRITE;
/*!40000 ALTER TABLE `bill` DISABLE KEYS */;
/*!40000 ALTER TABLE `bill` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `city`
--
DROP TABLE IF EXISTS `city`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `city` (
`idCity` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`idCity`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `city`
--
LOCK TABLES `city` WRITE;
/*!40000 ALTER TABLE `city` DISABLE KEYS */;
/*!40000 ALTER TABLE `city` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `coast_estimate`
--
DROP TABLE IF EXISTS `coast_estimate`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `coast_estimate` (
`idCostEstimate` int(11) NOT NULL AUTO_INCREMENT,
`hourlyRate` double DEFAULT NULL,
`duration` datetime DEFAULT NULL,
`mouvingPrice` double DEFAULT NULL,
`costEstimateDate` date DEFAULT NULL,
`htPrice` double DEFAULT NULL,
`Price` double DEFAULT NULL,
PRIMARY KEY (`idCostEstimate`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `coast_estimate`
--
LOCK TABLES `coast_estimate` WRITE;
/*!40000 ALTER TABLE `coast_estimate` DISABLE KEYS */;
/*!40000 ALTER TABLE `coast_estimate` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `job`
--
DROP TABLE IF EXISTS `job`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `job` (
`idJob` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`idJob`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `job`
--
LOCK TABLES `job` WRITE;
/*!40000 ALTER TABLE `job` DISABLE KEYS */;
/*!40000 ALTER TABLE `job` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `mission`
--
DROP TABLE IF EXISTS `mission`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mission` (
`idMission` int(11) NOT NULL AUTO_INCREMENT,
`state` int(11) DEFAULT NULL,
`dateMission` date DEFAULT NULL,
`idUser` int(11) DEFAULT NULL,
`idServiceProvider` int(11) DEFAULT NULL,
`idService` int(11) DEFAULT NULL,
`idBill` int(11) DEFAULT NULL,
PRIMARY KEY (`idMission`),
KEY `idUser` (`idUser`),
KEY `idServiceProvider` (`idServiceProvider`),
KEY `idService` (`idService`),
KEY `idBill` (`idBill`),
CONSTRAINT `mission_ibfk_1` FOREIGN KEY (`idUser`) REFERENCES `user` (`idUser`),
CONSTRAINT `mission_ibfk_2` FOREIGN KEY (`idServiceProvider`) REFERENCES `service_provider` (`idServiceProvider`),
CONSTRAINT `mission_ibfk_3` FOREIGN KEY (`idService`) REFERENCES `services` (`idService`),
CONSTRAINT `mission_ibfk_4` FOREIGN KEY (`idBill`) REFERENCES `bill` (`idBill`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `mission`
--
LOCK TABLES `mission` WRITE;
/*!40000 ALTER TABLE `mission` DISABLE KEYS */;
/*!40000 ALTER TABLE `mission` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `service_provider`
--
DROP TABLE IF EXISTS `service_provider`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `service_provider` (
`idServiceProvider` int(11) NOT NULL AUTO_INCREMENT,
`deleted` tinyint(1) DEFAULT NULL,
`firstName` varchar(255) NOT NULL,
`lastName` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`zipcode` varchar(255) NOT NULL,
`profilPicture` varchar(255) DEFAULT NULL,
`qrCode` varchar(255) DEFAULT NULL,
`company` varchar(255) DEFAULT NULL,
`idJob` int(11) DEFAULT NULL,
`hourlyRate` double DEFAULT NULL,
`mouvingPrice` double DEFAULT NULL,
PRIMARY KEY (`idServiceProvider`),
KEY `idJob` (`idJob`),
CONSTRAINT `service_provider_ibfk_1` FOREIGN KEY (`idJob`) REFERENCES `job` (`idJob`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `service_provider`
--
LOCK TABLES `service_provider` WRITE;
/*!40000 ALTER TABLE `service_provider` DISABLE KEYS */;
/*!40000 ALTER TABLE `service_provider` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `services`
--
DROP TABLE IF EXISTS `services`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `services` (
`idService` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`idService`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `services`
--
LOCK TABLES `services` WRITE;
/*!40000 ALTER TABLE `services` DISABLE KEYS */;
/*!40000 ALTER TABLE `services` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `subscribe`
--
DROP TABLE IF EXISTS `subscribe`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `subscribe` (
`idSubscrib` int(11) NOT NULL AUTO_INCREMENT,
`state` tinyint(1) DEFAULT NULL,
`dateStart` date DEFAULT NULL,
`dateEnd` date DEFAULT NULL,
`renew` tinyint(1) DEFAULT NULL,
`idUser` int(11) DEFAULT NULL,
`idSubscription` int(11) DEFAULT NULL,
PRIMARY KEY (`idSubscrib`),
KEY `idUser` (`idUser`),
KEY `idSubscription` (`idSubscription`),
CONSTRAINT `subscribe_ibfk_1` FOREIGN KEY (`idUser`) REFERENCES `user` (`idUser`),
CONSTRAINT `subscribe_ibfk_2` FOREIGN KEY (`idSubscription`) REFERENCES `subscription` (`idSubscription`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `subscribe`
--
LOCK TABLES `subscribe` WRITE;
/*!40000 ALTER TABLE `subscribe` DISABLE KEYS */;
/*!40000 ALTER TABLE `subscribe` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `subscription`
--
DROP TABLE IF EXISTS `subscription`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `subscription` (
`idSubscription` int(11) NOT NULL AUTO_INCREMENT,
`deleted` tinyint(1) DEFAULT NULL,
`title` varchar(255) NOT NULL,
`type` int(11) NOT NULL,
`price` double NOT NULL,
`duration` datetime NOT NULL,
`description` text,
PRIMARY KEY (`idSubscription`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `subscription`
--
LOCK TABLES `subscription` WRITE;
/*!40000 ALTER TABLE `subscription` DISABLE KEYS */;
/*!40000 ALTER TABLE `subscription` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
`idUser` int(11) NOT NULL AUTO_INCREMENT,
`deleted` tinyint(1) DEFAULT NULL,
`firstName` varchar(255) NOT NULL,
`lastName` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`phoneNumber` varchar(255) NOT NULL,
`profilPicture` varchar(255) DEFAULT NULL,
PRIMARY KEY (`idUser`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user`
--
LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2020-03-29 15:02:28
<file_sep>#include <string.h>
#include <mysql/mysql.h>
#include <stdio.h>
#define DB_HOST "localhost"
#define DB_USER "root"
#define DB_PASS "<PASSWORD>"
#define DB_NAME "testdb"
int main(int argc, char **argv)
{
MYSQL_STMT *stmt;
MYSQL *con = mysql_init(NULL);
int param_count;
const char* query;
if (con == NULL)
{
fprintf(stderr, "%s\n", mysql_error(con));
exit(1);
}
if (mysql_real_connect(con, DB_HOST, DB_USER, DB_PASS,
DB_NAME, 0, NULL, 0) == NULL)
{
fprintf(stderr, "%s\n", mysql_error(con));
mysql_close(con);
exit(1);
}
/*
if (mysql_query(con, "USE testdb"))
{
fprintf(stderr, "%s\n", mysql_error(con));
mysql_close(con);
exit(1);
}*/
// char* today = DATE_FORMAT(NOW(),'_%Y_%m_%d_%H_%i_%s');
// char* folder = '/var/lib/mysql-files/';
// char* file = 'test';
// char* ext = '.csv';
query = "SELECT * FROM testtable INTO OUTFILE '/var/lib/mysql-files/DATE_FORMAT(NOW()\'_\%Y_\%m\').csv' FIELDS ENCLOSED BY '\"' TERMINATED BY ';' ESCAPED BY '\"' LINES TERMINATED BY '\r\n';";
stmt = mysql_stmt_init(con);
if(!stmt)
{
fprintf(stderr, " mysql_stmt_init(), out of memory\n");
fprintf(stderr, "%s\n", mysql_error(con));
mysql_close(con);
exit(1);
}
if(mysql_stmt_prepare(stmt, query, strlen(query)))
{
fprintf(stderr, " mysql_stmt_prepare(), INSERT failed\n");
fprintf(stderr, " %s\n", mysql_stmt_error(stmt));
exit(0);
}
fprintf(stdout, " prepare, SELECT successful\n");
param_count= mysql_stmt_param_count(stmt);
fprintf(stdout, " total parameters in SELECT: %d\n", param_count);
if (param_count != 0) /* validate parameter count */
{
fprintf(stderr, " invalid parameter count returned by MySQL\n");
exit(0);
}
if (mysql_stmt_execute(stmt))
{
fprintf(stderr, " mysql_stmt_execute(), 1 failed\n");
fprintf(stderr, " %s\n", mysql_stmt_error(stmt));
exit(0);
}
printf("la requete a été executé");
mysql_stmt_close(stmt);
mysql_close(con);
exit(0);
}
<file_sep>/* gcc qrcode.c qrcodegen.c `sdl-config --cflags --libs` -o sdl
*
* QR Code generator demo (C)
*
* Run this command-line program with no arguments. The program
* computes a demonstration QR Codes and print it to the console.
*
* Copyright (c) Project Nayuki. (MIT License)
* https://www.nayuki.io/page/qr-code-generator-library
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
* - The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* - The Software is provided "as is", without warranty of any kind, express or
* implied, including but not limited to the warranties of merchantability,
* fitness for a particular purpose and noninfringement. In no event shall the
* authors or copyright holders be liable for any claim, damages or other
* liability, whether in an action of contract, tort or otherwise, arising from,
* out of or in connection with the Software or the use or other dealings in the
* Software.
*/
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <SDL/SDL.h>
#include "qrcode.h"
// Function prototypes
static void black_square(SDL_Surface *screen, SDL_Rect position, int size_pix);
static void doBasicDemo(void);
static void printQr(const uint8_t qrcode[], int size_screen, int size_pix);
static void pause();
// The main application program.
int main(void) {
doBasicDemo();
return EXIT_SUCCESS;
}
/*---- Demo suite ----*/
// Creates a single QR Code, then prints it to the console.
static void doBasicDemo(void) {
const char *text = "name : Roger\n job : Plombier\n society : Gedimat\n City :Lyon"; // User-supplied text
enum qrcodegen_Ecc errCorLvl = qrcodegen_Ecc_LOW; // Error correction level
// Make and print the QR Code symbol
uint8_t qrcode[qrcodegen_BUFFER_LEN_MAX];
uint8_t tempBuffer[qrcodegen_BUFFER_LEN_MAX];
bool ok = qrcodegen_encodeText(text, tempBuffer, qrcode, errCorLvl,
qrcodegen_VERSION_MIN, qrcodegen_VERSION_MAX, qrcodegen_Mask_AUTO, true);
if (ok)
printQr(qrcode, 340, 10);
}
// /*---- Utilities ----*/
// // Prints the given QR Code to the console.
static void printQr(const uint8_t qrcode[], int size_screen, int size_pix) {
SDL_Surface *screen = NULL;
SDL_Surface *rect = NULL;
SDL_Rect position;
if(SDL_Init(SDL_INIT_VIDEO) == -1)
{
fprintf(stderr, "Error in SDL init : %s\n", SDL_GetError());
exit(EXIT_FAILURE);
}
screen = SDL_SetVideoMode(size_screen, size_screen, 8, SDL_HWSURFACE);
SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 17, 206, 112));
if (screen == NULL)
{
fprintf(stderr, "imposible to load video mode : %s\n", SDL_GetError());
exit(EXIT_FAILURE);
}
SDL_WM_SetCaption("Qr code", NULL);
int size = qrcodegen_getSize(qrcode);
int border = 4;
position.x = 0;
position.y = 0;
for (int y = 0; y < size ; y++) {
for (int x = 0; x < size; x++) {
if (qrcodegen_getModule(qrcode, x, y))
{
position.x += size_pix;
}else{
black_square(screen, position, size_pix);
position.x += size_pix;
}
}
position.x = 0;
position.y += size_pix;
}
SDL_SaveBMP(screen, "Qr-code.bmp");
SDL_Flip(screen);
pause();
SDL_Quit();
}
void black_square(SDL_Surface *screen, SDL_Rect position, int size_pix)
{
SDL_Surface *rect = NULL;
rect = SDL_CreateRGBSurface(SDL_HWSURFACE, size_pix, size_pix, 8, 0, 0, 0, 0);
if (rect == NULL)
{
fprintf(stderr, "impossible de tracer rect : %s\n", SDL_GetError());
exit(EXIT_FAILURE);
}
SDL_FillRect(rect, NULL, SDL_MapRGB(screen->format, 0, 0, 0));
SDL_BlitSurface(rect, NULL, screen, &position);
}
void pause()
{
int continuer = 1;
SDL_Event event;
while (continuer)
{
SDL_WaitEvent(&event);
switch(event.type)
{
case SDL_QUIT:
continuer = 0;
}
}
}
|
34626b22dd48e9e31828b127c3bea3c215f135d4
|
[
"Markdown",
"C",
"SQL"
] | 6 |
C
|
Sti9mat3/projet_anuel
|
1106e69f9fa3e494b5e53b46a939050e92405d14
|
3d7c058d840baedcae929da8af95c102c2b71e3a
|
refs/heads/master
|
<file_sep>package com.liul85.learn;
import static com.liul85.learn.Piece.create;
/**
* Created by twcn on 3/2/16.
*/
public class PieceTest extends junit.framework.TestCase {
private static final String white = "white";
private Piece whitePiece;
private static final String black = "black";
private Piece blackPiece;
@Override
public void setUp() throws Exception {
whitePiece = create("p", white);
blackPiece = create("P", black);
}
public void testPawnColor() throws Exception {
assertEquals(white, whitePiece.getColor());
assertEquals(black, blackPiece.getColor());
assertTrue(whitePiece.isWhite());
assertTrue(blackPiece.isBlack());
assertFalse(blackPiece.isWhite());
}
public void testPrintFormat() throws Exception {
assertEquals("P", blackPiece.toString());
assertEquals("p", whitePiece.toString());
}
}
<file_sep>package com.liul85.learn;
import com.liul85.util.StringUtil;
/**
* Created by twcn on 3/4/16.
*/
public class BoardTest extends junit.framework.TestCase {
private Board board;
@Override
public void setUp() throws Exception {
board = new Board();
}
public void testCreateBoard() throws Exception {
assertEquals(32, board.getNumberOfPawn());
assertEquals(16, Piece.getNumber("white"));
assertEquals(16, Piece.getNumber("black"));
String blankRank = StringUtil.appendNewLine("........");
assertEquals(StringUtil.appendNewLine("RNBQKBNR") +
StringUtil.appendNewLine("PPPPPPPP") +
blankRank + blankRank + blankRank + blankRank +
StringUtil.appendNewLine("pppppppp") +
StringUtil.appendNewLine("rnbqkbnr"), board.print());
}
}
<file_sep>package com.liul85.learn;
import com.liul85.util.StringUtil;
/**
* Created by twcn on 3/2/16.
*/
public class Piece {
private String color;
private String name;
private static int whiteNumber = 0;
private static int blackNumber = 0;
private Piece(String name, String color) {
this.name = name;
this.color = color;
}
public static Piece create(String name, String color) {
if (color.equals("white")) {
whiteNumber += 1;
} else if (color.equals("black")) {
blackNumber += 1;
}
return new Piece(name, color);
}
public static int getNumber(String color) {
if (color.equals("white")) {
return whiteNumber;
} else if (color.equals("black")) {
return blackNumber;
}
return 0;
}
public String getColor() {
return color;
}
@Override
public String toString() {
return name;
}
public boolean isWhite() {
return color.equals("white");
}
public boolean isBlack() {
return color.equals("black");
}
}
|
c385d64b03d2a2547d9b0d964ddb95297715d4c0
|
[
"Java"
] | 3 |
Java
|
liul85/ChessVariants
|
db15d88775c2c54155a503700a6e5df216d0c6af
|
669e2ddab5ad6397d7188a97ef7626f04f130c71
|
refs/heads/master
|
<file_sep>params =
{
"factories": [
{
"name": "Grain Farm",
"guid": 1010262,
"tpmin": 1,
"outputs": [
{
"Product": 1010192,
"Amount": 1,
"StorageAmount": 2
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 20,
"InactiveAmount": 10
},
{
"Product": 1010052,
"Amount": 20
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAVZUlEQVRogdVad1TV57IdRV<KEY>YFguxJcvSiEiBiKTn8fJq6ijLv54zZ84KQy21N6e6P4CBlhrWe2iiOpT7zlKL83bZ0qVtRGRLRNp<KEY>
"locaText": {
"polish": "Uprawa zboża",
"english": "Grain Farm",
"taiwanese": "穀物農場",
"brazilian": "Grain Farm",
"russian": "Ферма",
"chinese": "谷物农场",
"portuguese": "Grain Farm",
"french": "Ferme céréalière",
"korean": "곡물 농장",
"japanese": "穀物農場",
"italian": "Fattoria di grano",
"german": "Getreidefarm",
"spanish": "Granja de trigo"
}
},
{
"name": "<NAME>",
"guid": 1010263,
"tpmin": 0.5,
"outputs": [
{
"Product": 1010193,
"Amount": 1,
"StorageAmount": 1
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 50,
"InactiveAmount": 25
},
{
"Product": 1010052,
"Amount": 20
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAU3klEQVRoge2aeVwUZ5rHC2jOhr6rq7vqrbObhm5o6Ibmvm8<KEY>
"locaText": {
"polish": "Farma bydła",
"english": "Cattle Farm",
"taiwanese": "牛牧場",
"brazilian": "Cattle Farm",
"russian": "Скотоферма",
"chinese": "牛牧场",
"portuguese": "Cattle Farm",
"french": "Élevage de gros bétail",
"korean": "가축 농장",
"japanese": "牛の牧草地",
"italian": "Allevamento di bestiame",
"german": "Rinderfarm",
"spanish": "Granja vacuna"
}
},
{
"name": "Hop Farm",
"guid": 1010264,
"tpmin": 0.6666666666666667,
"outputs": [
{
"Product": 1010194,
"Amount": 1,
"StorageAmount": 1
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 20,
"InactiveAmount": 10
},
{
"Product": 1010052,
"Amount": 20
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAU9ElEQVRogc1aZ3Rc5Zm+cgWMsSVrdGfu/dq9d5pGvY1mRl2WVUZt1IslWdWSJdmSmyQ3ucpF7jY2BlwAG2xYSkgMYQmHEpNQDNlQEkrghECyJCEbdjmEheD42R8aE7J7CGAcss8598+c893zPfM+b7+S9PURIknSJEmSJkuSNOVzz+Tg7yGX8c5vFZMkSZoqSdLVbBYLNWQjglKqWFWVqKpKhBBmct11YZIkXS1NkJKkCVL/b4iFSJI0xWQyXcs5tzCz2aVRmskJ8eucV2mM1WqM1WqUlumMpVNKjdmzZ8+WJOkqRVKukWV5hhDiKumv5P45JKxW63Sz2WwiMonRVV6ckBz13eKW3DfmVvo+WHqgC727mlAzWICSrnTEue1vckIqCSExTGY6Y8ylqWoc51wLWmuadHkW+sZWnWYymcxc5V5DiAfHz45i83dWont3OXr2VcHfnYDKZR4s2OKHt5zCXazAEOJtndIGnfNGp8P+2uZbV0FTWTO10GQeHm4hhFwtTcj0y/CZlBVJusZqtU7/iuf+DyYTQsIEIakOq/Hotu+uwdAtnVh+tBVNo/Mwb0EUfBUMyUUK3MUKorLMiMwww5FAYFA+1je+EDvvH0X7WAnikhxvxSRZX+GqmmuxWLgsyzO+4FKXAsnU8PDwmY<KEY>",
"locaText": {
"polish": "Uprawa chmielu",
"english": "Hop Farm",
"taiwanese": "啤酒花農場",
"brazilian": "Hop Farm",
"russian": "Ферма хмеля",
"chinese": "啤酒花农场",
"portuguese": "Hop Farm",
"french": "Houblonnière",
"korean": "홉 농장",
"japanese": "ホップ農場",
"italian": "Fattoria di luppoli",
"german": "Hopfenplantage",
"spanish": "Granja de lúpulo"
}
},
{
"name": "Potato Farm",
"guid": 1010265,
"tpmin": 2,
"outputs": [
{
"Product": 1010195,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 20,
"InactiveAmount": 10
},
{
"Product": 1010052,
"Amount": 20
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAUNklEQVRoge2Zd3RU95n3L+ACqEtz587cuffOnZGEhEQRRQgsJFHUUe8NgShCdAGim2CDABtM78UUgWgChAVCwiBA9F4EEdUmhGLHODbZN+vNbjb72T8k+2SzSd6QxPvuOW++5zznzNz7z3zmKb/neX6C8A/9Q//QP/Q3qsXv2R8+aykIQitBEN4QBOGt37M3mt/9P9P3P+4Nf3//t3Rdb60oSpvvzcvL620vL6+3dV1vLQiCo4uLi5suiiabzWa12+3esiz7KKLipXh4WHRdd22G+h8FaikIwluSJDkoiuKuKIpFVVVPTdP8dYseYLVau9gsls6apv<KEY>
"locaText": {
"polish": "Uprawa ziemniaków",
"english": "Potato Farm",
"taiwanese": "馬鈴薯農場",
"brazilian": "Potato Farm",
"russian": "Картофельная ферма",
"chinese": "马铃薯农场",
"portuguese": "Potato Farm",
"french": "Exploitation de pommes de terre",
"korean": "감자 농장",
"japanese": "ジャガイモ農場",
"italian": "Fattoria di patate",
"german": "Kartoffelhof",
"spanish": "Granja de patatas"
}
},
{
"name": "<NAME>",
"guid": 1010266,
"tpmin": 4,
"outputs": [
{
"Product": 120008,
"Amount": 1,
"StorageAmount": 8
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 10,
"InactiveAmount": 5
},
{
"Product": 1010052,
"Amount": 5,
"ShutdownThreshold": 0.2
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAQ/0lEQVRoge3ZaVCU+Z3A8c4mla2t1Ax90N0cfUHTNN2AIMjZnIIICsgtiCiIHA5yKSiIoIIgciOoICqi3LcICh7oeDujouMxmcxkpyZbmdkjtbVbm1TtZpL57otJUtk3WU2czG7VfN8+z4vfp57n/3+epx6B4Lu+67v+v/U3CoXCztFR8EOpVOqqUCjEAoHge9/2UK+VTCz2Hepr/s318Ua++PgST270cv5UBWX5qb92dzHUf9vz/am+<KEY>
"locaText": {
"polish": "Chata drwala",
"english": "Lumberjack's Hut",
"taiwanese": "伐木工人棚屋",
"brazilian": "Lumberjack's Hut",
"russian": "Хижина лесоруба",
"chinese": "伐木工人棚屋",
"portuguese": "Lumberjack's Hut",
"french": "Cabane de bûcheron",
"korean": "벌목꾼의 오두막",
"japanese": "木こりの小屋",
"italian": "Capanno del taglialegna",
"german": "Holzfällerhütte",
"spanish": "Cabaña de leñador"
}
},
{
"name": "Sheep Farm",
"guid": 1010267,
"tpmin": 2,
"outputs": [
{
"Product": 1010197,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 20,
"InactiveAmount": 10
},
{
"Product": 1010052,
"Amount": 10
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAXL0lEQVRogdVad1RUeZZ+ajvTYexGG6iqVy9VldNtt63dtvY<KEY>9g+<KEY>9<KEY>97o8<KEY>2D4/A85itrJUKS9kM8f2P7lZlhaGMDH2xy+vhYwNTkFzRNqoISCf6UEgiKOpHXEJLmPJdlNJEkynBKnRCxG8ScFtJyiqDdEqqo8liQ38VVUopydLF8o5JWYedyNp7MDGB<KEY>tkq<KEY>
"locaText": {
"polish": "Farma owiec",
"english": "Sheep Farm",
"taiwanese": "綿羊牧場",
"brazilian": "Sheep Farm",
"russian": "Овцеферма",
"chinese": "绵羊牧场",
"portuguese": "Sheep Farm",
"french": "Élevage de moutons",
"korean": "양 농장",
"japanese": "羊の牧草地",
"italian": "Allevamento di pecore",
"german": "Schäferei",
"spanish": "Granja ovina"
}
},
{
"name": "<NAME>",
"guid": 1010269,
"tpmin": 1,
"outputs": [
{
"Product": 1010199,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 40,
"InactiveAmount": 20
},
{
"Product": 1010052,
"Amount": 30
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAV7klEQVRoge2aZ1RVZ9bHj1GjSWZEiXC5555670UFLr0ISu+9iPQiCBawIVWKSld6EQRFEBREERsgFlTUGE0gKhaMXbAlmpioo4kN/+8H0Mwk82YmbSYfZq/1X+veL2c9v7PL8+xnH4L4n/1mG0YQxDs/0rD/6or+TXuz8OEEQYwSCAQfiMeJ5UQi0YcikehDjuPGKigo/IUgiHeJPynUOwRBjCAIYrS8vPwYXlFRwDCMmOd5TVYksqQEZDgpIGdKKcqcE4m0xCT<KEY>
"locaText": {
"polish": "Farma świń",
"english": "Pig Farm",
"taiwanese": "養豬場",
"brazilian": "Pig Farm",
"russian": "Свиноферма",
"chinese": "养猪场",
"portuguese": "Pig Farm",
"french": "Élevage de porcs",
"korean": "돼지 농장",
"japanese": "豚の牧草地",
"italian": "Allevamento di maiali",
"german": "Schweinezucht",
"spanish": "Granja porcina"
}
},
{
"name": "<NAME>",
"guid": 1010558,
"tpmin": 1,
"outputs": [
{
"Product": 1010209,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 50,
"InactiveAmount": 25
},
{
"Product": 1010052,
"Amount": 10,
"ShutdownThreshold": 0.2
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAXV0lEQVRogc16eVhUZ57u0WiWTqJCKM6ps58qdpClKKD2hSoKqliLYl9ll02RRRRBQRDBBVTc0KCCCGLUEMGoHTVqOqt2Z+mklyTT6e7Y6cw8PXPvzJ2+me4nM+/8Iel2+qYTk3tzp9/nOf/Ueer5zvu9v++3fgTx3WIRQRCL73sWfcfr/T/HIoIglhAE8ZiXl9dyhmGeElesWEES5OMEQTx837OUIIiH/hu/8yvxEEmSj4syGcVTVAjHcUZKJjvB87xeyXFhIiWKklwuiBQlchxHe3t7LyPukf7/hgcxi8UkQTwuyOXB2Umxt9fkWT8bXZOGfWU2pIZL4CjqGEPRu1yGiB9Upmg/E2j5UZZlV3p5eS0nvmNlFi0s8ChLsI8RBPEIcW/3/hqppYIgyAtSDHdePViLIzkJGEo2o<KEY>
"locaText": {
"polish": "Ch<NAME>śliwska",
"english": "Hunting Cabin",
"taiwanese": "狩獵小屋",
"brazilian": "Hunting Cabin",
"russian": "Хижина охотника",
"chinese": "狩猎小屋",
"portuguese": "Hunting Cabin",
"french": "Cabane de chasse",
"korean": "사냥꾼 오두막",
"japanese": "狩猟小屋",
"italian": "Capanno da caccia",
"german": "Jagdhütte",
"spanish": "Cabaña de cazador"
}
},
{
"name": "<NAME>",
"guid": 100654,
"tpmin": 0.5,
"outputs": [
{
"Product": 1010198,
"Amount": 1,
"StorageAmount": 1
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 100,
"InactiveAmount": 50
},
{
"Product": 1010052,
"Amount": 10
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAVtUlEQVRoge2aeXBUZdr2D+nsJCSd9HrOc7buTjpJZ9/3pBMS2RcB2XcUFAb3FRlFBEFAkM2wBQgJCZvg7qe4AYOIOjIuo4x8AqPj6OggmyBL8nv/IPPWlF999SLjvPV+Vd9V1dWn+<KEY>
"locaText": {
"polish": "Uprawa czerwonej papryki",
"english": "Red Pepper Farm",
"taiwanese": "紅椒農場",
"brazilian": "Red Pepper Farm",
"russian": "Перечная ферма",
"chinese": "红椒农场",
"portuguese": "Red Pepper Farm",
"french": "Ferme de poivrons rouges",
"korean": "피망 농장",
"japanese": "赤トウガラシ農園",
"italian": "Fattoria di peperoncini",
"german": "Paprikafarm",
"spanish": "Granja de pimientos rojos"
}
},
{
"name": "Vineyard",
"guid": 100655,
"tpmin": 0.5,
"outputs": [
{
"Product": 120014,
"Amount": 1,
"StorageAmount": 1
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 200,
"InactiveAmount": 100
},
{
"Product": 1010052,
"Amount": 10
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAUTElEQVRogc1aZ3Bb15l9lCwpclRpQgDfu+++AoJgbwABsIAVIAkC7L33IooiKUosYhF7E4tIqpNUoUhJliVZtCVLsmQ5juPYzmyySRzH69nZ7CTjzY7/bCaZeNZxyp79QTrJZta2ih3nzNyZNxi8uffM952v3ccwTwanz1nr1pbTE+7xlcGJYZj1DMNsZBjmGwzDbGYY<KEY>SuQmCC",
"locaText": {
"polish": "Winnica",
"english": "Vineyard",
"taiwanese": "葡萄園",
"brazilian": "Vineyard",
"russian": "Виноградник",
"chinese": "葡萄园",
"portuguese": "Vineyard",
"french": "Vignoble",
"korean": "포도원",
"japanese": "ブドウ園",
"italian": "Vigneto",
"german": "Weinberg",
"spanish": "Viñedo"
}
},
{
"name": "Fishery",
"guid": 1010278,
"tpmin": 2,
"outputs": [
{
"Product": 1010200,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 40,
"InactiveAmount": 20
},
{
"Product": 1010052,
"Amount": 25
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAATtElEQVRogeVaaXRb5Zm+zgJhC7YrR/bVvd93dWWyx/Juy7IlW/Iu25JXWbJsLdbiRbZleYvsOHHs7CQQnMQhOwRMEpKQhiUQCCRAKGQhC4Yk7JnOcs5MO+2hQ09bBnjmR0x/dFoI01DaM8853zn6dc999H7PuzzvZZh/HIRNnn9oTI1lmNuZG2fqj/0y/xeEMQwzVRCEcI7jZIIgREdFRd3N/IORCWMY5j<KEY>
"locaText": {
"polish": "Dom rybaka",
"english": "Fishery",
"taiwanese": "漁場",
"brazilian": "Fishery",
"russian": "Рыболовецкая гавань",
"chinese": "渔场",
"portuguese": "Fishery",
"french": "Pêcherie",
"korean": "양어장",
"japanese": "漁場",
"italian": "Area di pesca",
"german": "Fischerei",
"spanish": "Pescadería"
}
},
{
"name": "<NAME>",
"guid": 1010310,
"tpmin": 0.5,
"outputs": [
{
"Product": 1010232,
"Amount": 1,
"StorageAmount": 1
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 500,
"InactiveAmount": 250
},
{
"Product": 1010115,
"Amount": 25
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYc0lEQVRoge2aeVRUV7q3T8zQnU53jDYK1hmrCgFREE<KEY>9x3aLXzs0YHxkf6NNvR38Pt2VKJ3G0Jmlesiz3MoiijSRJotK2bTtBEF5shfq/BtRGEIQX2rVr11YURU<KEY>
"locaText": {
"polish": "Wytwórnia saletry",
"english": "Saltpetre Works",
"taiwanese": "硝石採石場",
"brazilian": "Saltpetre Works",
"russian": "Фабрика селитры",
"chinese": "硝石采石场",
"portuguese": "Saltpetre Works",
"french": "Salpêtrière",
"korean": "초석 작업장",
"japanese": "硝石の採石場",
"italian": "Salina",
"german": "Salpeterwerk",
"spanish": "Taller de salitre"
}
},
{
"name": "<NAME>",
"guid": 1010560,
"tpmin": 2,
"outputs": [
{
"Product": 1010228,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 120,
"InactiveAmount": 60
},
{
"Product": 1010115,
"Amount": 25
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAARHklEQVRoge2Zd1CcZ37HubtM5iZjW4ilyFLOVrEln4oto4IQotdlYdld+hbYAuyyBRaWvksXIDqidwRCgAoIEOqo2CpWsYotn5t8ts/2+JzLJZPkUu7icz75I7HmJolt+c5zmsn489/7vvPOfD/v8/6e3/M+r5PT93zP93zPd4Gbs/PmR53hj8bNze2xnz6/+TdPr1r9sa6tn+0RUTy1ciXuLi7ejzrbQ/PYY4+5W5o6vuicnqdzeASvgCBCJbE8t3kLa597DvelS/WPOuNDIVan/<KEY>
"locaText": {
"polish": "Kopalnia piasku",
"english": "Sand Mine",
"taiwanese": "沙礦",
"brazilian": "Sand Mine",
"russian": "Песчаный карьер",
"chinese": "沙矿",
"portuguese": "Sand Mine",
"french": "Mine de silice",
"korean": "모래 광산",
"japanese": "砂採取場",
"italian": "Miniera di sabbia",
"german": "Quarzgrube",
"spanish": "Mina de arena"
}
},
{
"name": "Concrete Factory",
"guid": 1010280,
"tpmin": 1,
"outputs": [
{
"Product": 1010202,
"Amount": 1,
"StorageAmount": 2
}
],
"inputs": [
{
"Product": 1010231,
"Amount": 1,
"StorageAmount": 3
},
{
"Product": 1010219,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 400,
"InactiveAmount": 200
},
{
"Product": 1010117,
"Amount": 75
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAARSklEQVRoge2ZeXCT952HlaTd2Z0pmxjJJgHahiZpQtKQLCRL2WwJmzTbKelOkoYAJsbmMrEBcxiMbfnQZVs+ZMmybNmy5Bvf+AZjY3zg27JlWZIl35w5aGi5CoRAwrN/ENw4dGcDSZqd2X5m3tHMT++883l+3+s9BIK/6670j9+3gW9DD0So919buPi17v/pBI+ZMxP+loa+lmb96Eceq1eurHhpyZI9s4TCV55/4aV8saqOefOeLPtr5z+3cEntDkkBM2fOfPqv/f/scy+o58yYIfxuXX9Fbm5uD/b2dnP69CSnT08yNmYnu/4kazfsZfGLL15+ZNasUIFAcL9AILhPIBAI5syYIUzM6+Tfl624+tVrzZ41a6O7ULjVUDXKvHlP5X5npkUi0cKUrLKbnr5i62NPPJXg4eb20vaAbSdGR22cOjXB+fNnae0fZePOVBoba3C5+rlw4U/U1dXS0d7Gvvy8G<KEY>
"locaText": {
"polish": "Fabryka betonu zbrojonego",
"english": "Concrete Factory",
"taiwanese": "混凝土工廠",
"brazilian": "Concrete Factory",
"russian": "Бетоносмесительный завод",
"chinese": "混凝土工厂",
"portuguese": "Concrete Factory",
"french": "Cimenterie",
"korean": "콘크리트 공장",
"japanese": "コンクリート工場",
"italian": "Fabbrica di calcestruzzo",
"german": "Betonwerk",
"spanish": "Fábrica de cemento"
}
},
{
"name": "Soap Factory",
"guid": 1010281,
"tpmin": 2,
"outputs": [
{
"Product": 1010203,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010234,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 50,
"InactiveAmount": 25
},
{
"Product": 1010115,
"Amount": 50
}
],
"region": 5000000,
"icon": "data:image/png;base64,i<KEY>//Q//<KEY>mor82CRE+B7Fu+aKHC+fOFP9NX+j5Cs<KEY>
"locaText": {
"polish": "Wytwórnia mydła",
"english": "Soap Factory",
"taiwanese": "肥皂工廠",
"brazilian": "Soap Factory",
"russian": "Мыловарня",
"chinese": "肥皂工厂",
"portuguese": "Soap Factory",
"french": "Savonnerie",
"korean": "비누 공장",
"japanese": "石鹸工場",
"italian": "Fabbrica di sapone",
"german": "Siederei",
"spanish": "Fábrica de jabón"
}
},
{
"name": "Brick Factory",
"guid": 1010283,
"tpmin": 1,
"outputs": [
{
"Product": 1010205,
"Amount": 1,
"StorageAmount": 2
}
],
"inputs": [
{
"Product": 1010201,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 20,
"InactiveAmount": 10
},
{
"Product": 1010115,
"Amount": 25
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAARHElEQVRoge3aaXQU15UH8JKMwUsMqOnuqq56S1V1S60F7b1Jaknd2gUIxCIjtCA12gBJbGITEmAEYRdgCGaxWYwBOwFvOGZYJPASx5kkY0+ceBzHZ5KMcyY2xjHODGEz9n8+dCOQg+1Ek8UffM95p/RJ6l/fe9979Z4E4Zv4Jr6Jr3OECYIQHhp3hJ5hofG1j3BBEAapqnqX3Wi8jw0bFiFJkslsNouSJJnU4epwk<KEY>",
"locaText": {
"polish": "Cegielnia",
"english": "Brick Factory",
"taiwanese": "磚塊工廠",
"brazilian": "Brick Factory",
"russian": "Кирпичный завод",
"chinese": "砖块工厂",
"portuguese": "Brick Factory",
"french": "Briqueterie",
"korean": "벽돌 공장",
"japanese": "レンガ工場",
"italian": "Fabbrica di mattoni",
"german": "Ziegelei",
"spanish": "Fábrica de ladrillos"
}
},
{
"name": "Sawmill",
"guid": 100451,
"tpmin": 4,
"outputs": [
{
"Product": 1010196,
"Amount": 1,
"StorageAmount": 8
}
],
"inputs": [
{
"Product": 120008,
"Amount": 1,
"StorageAmount": 8
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 10,
"InactiveAmount": 5
},
{
"Product": 1010052,
"Amount": 10
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAASi0lEQVRoge2ad2yVZ5bGT2BMKAlMaDbGtJB<KEY>zQn<KEY>//<KEY>Mj<KEY>8GtetkANERkhSg7v2nlypWH9r69I83B9DiTzRGM1IcxXBfKVEskIw2hDNeFMlKvXGfbIxlrDGWkLoTR+hCmW8KZaQ1ntjW<KEY>
"locaText": {
"polish": "Tartak",
"english": "Sawmill",
"taiwanese": "鋸木廠",
"brazilian": "Sawmill",
"russian": "Лесопилка",
"chinese": "锯木厂",
"portuguese": "Sawmill",
"french": "Scierie",
"korean": "제재소",
"japanese": "製材所",
"italian": "Segheria",
"german": "Sägewerk",
"spanish": "Serrería"
}
},
{
"name": "<NAME>",
"guid": 1010325,
"tpmin": 2,
"outputs": [
{
"Product": 1010247,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010209,
"Amount": 1,
"StorageAmount": 6
},
{
"Product": 1010240,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 500,
"InactiveAmount": 225
},
{
"Product": 1010116,
"Amount": 200
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAVRElEQVRogc1aZ3BUV5p9YIMBmySkDu/e+0KrlWMrILViS2rl1K2sVmihiDIKCCWQkFAARJBACBAgRBLBIhuThDE2GNvYYGOPZzzjmfLs7mxtzdbs1NbU7Hrt8dkfyFOUy1u7WwP2nKpX79etuufd79x7vnMfxz07zOU4br6dnd0rCoVCKSqVMlMyd0Gt9pUICRR5PkiiNIAQ4kXt7LTM1pZftmzZ<KEY>
"locaText": {
"polish": "Zakład futrzarski",
"english": "Fur Dealer",
"taiwanese": "皮草貿易商",
"brazilian": "Fur Dealer",
"russian": "Меховщик",
"chinese": "皮草贸易商",
"portuguese": "Fur Dealer",
"french": "Pelleterie",
"korean": "모피상",
"japanese": "毛皮商",
"italian": "Mercante di pellicce",
"german": "Schneiderei",
"spanish": "Tratante de pieles"
}
},
{
"name": "Light Bulb Factory",
"guid": 1010286,
"tpmin": 1,
"outputs": [
{
"Product": 1010208,
"Amount": 1,
"StorageAmount": 2
}
],
"inputs": [
{
"Product": 1010241,
"Amount": 1,
"StorageAmount": 4
},
{
"Product": 1010243,
"Amount": 1,
"StorageAmount": 3
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 1000,
"InactiveAmount": 500
},
{
"Product": 1010117,
"Amount": 150
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUh<KEY>yC<KEY>//<KEY>3axLNuNYZiOvzWQHsMwnQkhPWSO60kUCr/4mM/LayuvoLUpGy0NGXhedAT1mVGouxqE2vM+qDk5HzWps<KEY>
"locaText": {
"polish": "<NAME>",
"english": "Light Bulb Factory",
"taiwanese": "燈泡工廠",
"brazilian": "Light Bulb Factory",
"russian": "Электроламповый завод",
"chinese": "灯泡工厂",
"portuguese": "Light Bulb Factory",
"french": "Usine d'ampoules",
"korean": "전구 공장",
"japanese": "電球工場",
"italian": "Fattoria di lampadine",
"german": "Glühbirnenfabrik",
"spanish": "Fábrica de bombillas"
}
},
{
"name": "Window-Makers",
"guid": 1010285,
"tpmin": 1,
"outputs": [
{
"Product": 1010207,
"Amount": 1,
"StorageAmount": 2
}
],
"inputs": [
{
"Product": 120008,
"Amount": 1,
"StorageAmount": 8
},
{
"Product": 1010241,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 200,
"InactiveAmount": 100
},
{
"Product": 1010116,
"Amount": 100
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAV5ElEQVRogc2aeVRU55rut2by5CRRDEUVe6oBjcY4IjgwiMyjilAyU0xFMRfFVFAFBQVVzPMoUyEziICoQaQYFI3GxBg1gxlP+pihT+ecpLNudxI7Tk//ATmn+65e597TcO7tZ63vn713rb1/663vfb73+16C+Ptp1dJYvTSe+t/Gr9d/fe5/jH796KcJgniOy+X+dv369S/RNL1+A4/HEZoJuULhX4YFl<KEY>",
"locaText": {
"polish": "Wytwórnia okien",
"english": "Window Makers",
"taiwanese": "窗戶製造廠",
"brazilian": "Window-Makers",
"russian": "Оконная фабрика",
"chinese": "窗户制造厂",
"portuguese": "Window-Makers",
"french": "Vitrerie",
"korean": "창문 공장",
"japanese": "窓製造所",
"italian": "Produttori di finestre",
"german": "Fensterfabrik",
"spanish": "Fabricante de ventanas"
}
},
{
"name": "Sailmakers",
"guid": 1010288,
"tpmin": 2,
"outputs": [
{
"Product": 1010210,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010197,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 75,
"InactiveAmount": 38
},
{
"Product": 1010115,
"Amount": 50
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAXcElEQVRogc16d1iUZ772q8aY5MSGDDPz9pmxxBSTnGTTNs1NNTFZV0MsYAEVpSN9hs4w9CoovYMN6SCgVB36CIj0MhSp1hAlak527/MH5Jyc79ucL6bs9d3XNX/NvHM993s/v/4jiD8OiwiCeJwgiCUEQTxGEMSCR3h2AUEQC+f/Y+EjPvu7YrGOjs4yiZ6eUKKnJ9TV1V1KEMTin/ntj4deSMwRXiIUCv9t5cqVy+lltI505crlBEE8Mf/9vxQLdXR0lokEAv03N0hvkXp63iRJPiOVSpcT//2GF/300Do6OssoilpFr<KEY>",
"locaText": {
"polish": "Żaglomistrz",
"english": "Sailmakers",
"taiwanese": "船帆製造廠",
"brazilian": "Sailmakers",
"russian": "Парусная фабрика",
"chinese": "船帆制造厂",
"portuguese": "Sailmakers",
"french": "Voilerie",
"korean": "돛 제작소",
"japanese": "帆布工場",
"italian": "Velai",
"german": "Segelweberei",
"spanish": "Fabricante de velas"
}
},
{
"name": "<NAME>",
"guid": 100416,
"tpmin": 2,
"outputs": [
{
"Product": 1010201,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 10,
"InactiveAmount": 5
},
{
"Product": 1010115,
"Amount": 50
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAX60lEQVRoge16Z1RU6ZruVjuofVoQCqpqh28HkAxFkXMVOWcQRRHQIiMSBSRHEVQQFEXE0LYYCWZFxYC5jd2G7lY7nj6d7qx15849Z+6de+957o9Cp7vH0+fMrJk58+O8a71rr121a6/3qed70/d+FPU3+Zv8Tf4aMpOiqFkURb0lCMJsmqbn0jQ9l2XZOYIgzDanqLcpinrrF/omRVFvTP9u1vQ7Zvx1zKeoWba2tm/JZLJ35XK5KS/nRaJQ2IiMqBIZUSWxrD2vVFpLDGPBsqw5x3FmHMeZEUIkQaEQaJrmOI6j5XK5KTEwmG9iYvIbSg/6jf8MUDMoiprFUtQcmqZlhBCJUyr9zAWuxMVa+qIyVYu1ulAsD3eFRm0JVxvxhdpSvONiLZ2zlciErcRN2ErcWVtzclRlIfbaSkIlYZhlZiwbJrKiG03TljKZTCmXy9/5jwI0g6KoN1iKmqNQKExEmrZklWyiv7P14xNtafh0ZyEebc3B/U3LcXdjBm53peHepuV4tC0HH23Nxof9WfhwSxYebtHh4WYdHmxegQd9K3CvZzkm6pOwIy8MhZFu3ylNTE+LHBfDK3lrQRAMp8H8u8hMiqLekFPUO+YKhQmvVFoTRpEe7uXwzcPBQny<KEY>KpW8xEgWRC6XzPVM/MXU/leRGZTe4Depfz4EM4v6Kx50+TX5/4lgv2yU+shTAAAAAElFTkSuQmCC",
"locaText": {
"polish": "Wyrobisko gliny",
"english": "Clay Pit",
"taiwanese": "陶土礦場",
"brazilian": "Clay Pit",
"russian": "Глиняный карьер",
"chinese": "陶土矿场",
"portuguese": "Clay Pit",
"french": "Carrière d'argile",
"korean": "점토 채취장",
"japanese": "粘土穴",
"italian": "Cava di argilla",
"german": "Lehmgrube",
"spanish": "Cantera de arcilla"
}
},
{
"name": "Coachmakers",
"guid": 1010289,
"tpmin": 0.5,
"outputs": [
{
"Product": 1010211,
"Amount": 1,
"StorageAmount": 1
}
],
"inputs": [
{
"Product": 120008,
"Amount": 1,
"StorageAmount": 8
},
{
"Product": 1010255,
"Amount": 1,
"StorageAmount": 2
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 1200,
"InactiveAmount": 600
},
{
"Product": 1010117,
"Amount": 150
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAW1UlEQVRoge16aXRc5ZnmNWY<KEY>
"locaText": {
"polish": "<NAME>",
"english": "Coachmakers",
"taiwanese": "車輛製造廠",
"brazilian": "Coachmakers",
"russian": "Каретная мастерская",
"chinese": "车辆制造厂",
"portuguese": "Coachmakers",
"french": "Carrossier",
"korean": "마차 제작소",
"japanese": "客車工場",
"italian": "Carrozzai",
"german": "Kutschen-Werkhalle",
"spanish": "Fábrica de carros"
}
},
{
"name": "Bakery",
"guid": 1010291,
"tpmin": 1,
"outputs": [
{
"Product": 1010213,
"Amount": 1,
"StorageAmount": 2
}
],
"inputs": [
{
"Product": 1010235,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 60,
"InactiveAmount": 30
},
{
"Product": 1010115,
"Amount": 50
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAATYklEQVRoge2ZaVAWV7rHG42ZrCqE1/fl7T7ndPfLvu/ry6KsguybIIsbAgIaQ1TAfUHcBREUFQVUENzQRNHEDQRl31cxkrl3MjVTd+reqqmpO7dmyf9+gEymZskkM05yq+78q051f+gP/evnnOd5+v9w3A8nnT9a/9K/9E+QDsdxsziOmz2z<KEY>9K+lw0y/6I4VC8<KEY>Wy<KEY>f<KEY>g<KEY>QOiVFpKlIYay3K+h6PDRNGmTNy+cALt966g+dZF3KouwfGdG+Dv6fZrVweb4yIhEUzN7PT19Q0ETniT+wGio8Nx3GsKheIdok/UEs/byIxFR/p591ytOPi79qY63Kw8hNK8Fdi9OgQb47ywyt8aCVoTRLlokB7uhZJt2Ti5N/d39pYWlyml/lSplBUKxTvfJ8xsjuPeWrBggVIW<KEY>",
"locaText": {
"polish": "Piekarnia",
"english": "Bakery",
"taiwanese": "麵包店",
"brazilian": "Bakery",
"russian": "Пекарня",
"chinese": "面包店",
"portuguese": "Bakery",
"french": "Boulangerie",
"korean": "제빵소",
"japanese": "パン屋",
"italian": "Panificio",
"german": "Bäckerei",
"spanish": "Panadería"
}
},
{
"name": "Brewery",
"guid": 1010292,
"tpmin": 1,
"outputs": [
{
"Product": 1010214,
"Amount": 1,
"StorageAmount": 2
}
],
"inputs": [
{
"Product": 1010194,
"Amount": 1,
"StorageAmount": 3
},
{
"Product": 1010236,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 200,
"InactiveAmount": 100
},
{
"Product": 1010115,
"Amount": 75
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw<KEY>
"locaText": {
"polish": "Browar",
"english": "Brewery",
"taiwanese": "釀酒廠",
"brazilian": "Brewery",
"russian": "Пивоварня",
"chinese": "酿酒厂",
"portuguese": "Brewery",
"french": "Brasserie",
"korean": "양조장",
"japanese": "醸造所",
"italian": "Birrificio",
"german": "Brauerei",
"spanish": "Cervecería"
}
},
{
"name": "Artisanal Kitchen",
"guid": 1010293,
"tpmin": 0.5,
"outputs": [
{
"Product": 1010215,
"Amount": 1,
"StorageAmount": 1
}
],
"inputs": [
{
"Product": 1010193,
"Amount": 1,
"StorageAmount": 3
},
{
"Product": 1010198,
"Amount": 1,
"StorageAmount": 3
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 100,
"InactiveAmount": 50
},
{
"Product": 1010116,
"Amount": 75
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAZsklEQVRogcWaaXBc15meL0lRJIBe7tobegN633c0Gmtj30gABEgAJAgQJDaSILiC+75KIrVRpmSa2kmJ2qhdsmzZkT2yrImdsSeeTKVSybgqU+WM88eZqiTO1FQyefIDIK0ZO7bHS3KqvuqqW7e7z1Pvd+655/0+Qfj9xzJBEJYLgrBCEIT7BUFYLQhCqdlsLtM0TffFMAtCmSAIJUv3rFz6zvKl3/j/MpZ9YeKlkiAYdTqdppSUlIui6DIajR5Vrw8oihKSZTmsKEpI0euDql7vNxqNHlEUXaWlpTadTqeJgiAKi4CrBEG47/8V1PKlPysRRVFUS0utJqPRI0lSTFGUvKqqRZMsd6iq2muS5UFNloc0RTmsyfKwJssbTIoyoKrq2qV7io<KEY>
"locaText": {
"polish": "Kuchnia tradycyjna",
"english": "Artisanal Kitchen",
"taiwanese": "工匠廚房",
"brazilian": "Artisanal Kitchen",
"russian": "Кухня",
"chinese": "工匠厨房",
"portuguese": "Artisanal Kitchen",
"french": "Cuisine artisanale",
"korean": "직공 주방",
"japanese": "職人キッチン",
"italian": "Cucina artigianale",
"german": "Großküche",
"spanish": "Cocina artesanal"
}
},
{
"name": "Cannery",
"guid": 1010295,
"tpmin": 0.6666666666666667,
"outputs": [
{
"Product": 1010217,
"Amount": 1,
"StorageAmount": 1
}
],
"inputs": [
{
"Product": 1010227,
"Amount": 1,
"StorageAmount": 8
},
{
"Product": 1010215,
"Amount": 1,
"StorageAmount": 2
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 100,
"InactiveAmount": 50
},
{
"Product": 1010116,
"Amount": 75
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAVqElEQVRogc2ad3RUZd7HL21FVxFChklm5t47<KEY>y+f9<KEY>3f/<KEY>zq//nkcQfr263T3d754ev/j+<KEY>WDKZQDH4WTP5W/APCiE5IY0rdbDKLyhik0593kaTJslrtp1FqHtNoNOp+/fo9KgjCA8Id9/s/UQ9t3759R40cmXTqi3Os3rodn2Abnn4BPO4+mq<KEY>",
"locaText": {
"polish": "<NAME>",
"english": "Cannery",
"taiwanese": "罐頭工廠",
"brazilian": "Cannery",
"russian": "Консервный завод",
"chinese": "罐头工厂",
"portuguese": "Cannery",
"french": "Conserverie",
"korean": "통조림 공장",
"japanese": "缶詰工場",
"italian": "Conservificio",
"german": "Konservenfabrik",
"spanish": "Fábrica de conservas"
}
},
{
"name": "<NAME>",
"guid": 1010294,
"tpmin": 2,
"outputs": [
{
"Product": 1010216,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010195,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 40,
"InactiveAmount": 20
},
{
"Product": 1010052,
"Amount": 50
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAVU0lEQVRogc1ad1RU97Y+ltybpiEKU86cMjMgxhKfiVEBlaKCAqELDGXobRjKMLShz8DQBum9g0jvYAkq0hGV2EjAFmsssaGgYlDY7w/Iy13r3beuWXrv81trrzVr5o8z3/r23r+9v99BkH8fFiIIsghBkI8QBPkbgiB/n//80fxvC/6Nz35vWKyAIJ9TqVQKiqIEQaWycRxXJKlUFoZhDOKLL75EEORjZI7QB4tFy5YtW4pTqWupFEozRqc92q218dFurY2PKPLyt2kUShkTwzZjyzEGMqfSB6nMAgRBPsYpFEVfJwO4PFgMv11shzsX6uHuzy0w0lMEB/ZHA0Ve/g2BEluxpUuXIXPp98HhIxqNpsDEmJpcg42QE24G+/c6Q0qwMYjsVYCjvRa2fcMCirz8DBvHHTEMU0IR5FPkA1NlgQKi8LkiFV8bmZo2XlOR/KJyrzMUxXJB4qkDXubfgsG2laC5QQnsfQL61n278SKbIHYqKCjQEARZ/P/95/8RixhLlixHaTSvwrb234cfPZ64MD4OncO9UFqeBhkZYkjMTAJpZgak1jY3Wzo6TSniTAdFDFNC5rraB4NFVCqVQjAY5hnVNS/9xJLzp+7dhVN37kCMLB<KEY>MiDYmTn1MUwAAAAASUVORK5CYII=",
"locaText": {
"polish": "Gorzelnia",
"english": "Schnapps Distillery",
"taiwanese": "烈酒釀酒廠",
"brazilian": "Schnapps Distillery",
"russian": "Винокурня",
"chinese": "烈酒酿酒厂",
"portuguese": "Schnapps Distillery",
"french": "Distillerie",
"korean": "슈냅스 양조장",
"japanese": "アルコール蒸留所",
"italian": "Distilleria di liquori",
"german": "Schnapsbrennerei",
"spanish": "Destilería de licor"
}
},
{
"name": "Butcher's",
"guid": 1010316,
"tpmin": 1,
"outputs": [
{
"Product": 1010238,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010199,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 80,
"InactiveAmount": 40
},
{
"Product": 1010115,
"Amount": 50
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAATeklEQVRoge1aaVQUZ7oujca4Qq9VXfV9tXQ3yL7a7DvIKi644UJEjUZxQ1BxJa4oRlFGBRUVlYAYNYo7o+Zq9sWYbWIS10RFkVVj0u3Nnf<KEY>",
"locaText": {
"polish": "Rzeźnik",
"english": "Slaughterhouse",
"taiwanese": "肉鋪",
"brazilian": "Butcher's",
"russian": "Мясная лавка",
"chinese": "肉铺",
"portuguese": "Butcher's",
"french": "Boucherie",
"korean": "도축장",
"japanese": "肉屋",
"italian": "Macelleria",
"german": "Metzgerei",
"spanish": "Carnicería"
}
},
{
"name": "<NAME>",
"guid": 100659,
"tpmin": 2,
"outputs": [
{
"Product": 120016,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 120014,
"Amount": 1,
"StorageAmount": 6
},
{
"Product": 1010241,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 1000,
"InactiveAmount": 500
},
{
"Product": 1010116,
"Amount": 150
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAS4klEQVRogdVaeXBUdba+AQJJb0mH7tzue+/vd7fudLo7W6dD9o2wBAiQgOwCQQghQAiQsCeELBD2AEkkLAohgBAEZRfHB4iAo4KCMqMiCow44AI8VFwQxu/9keDM/POqHjjq+6pOdVVXV9f57tnPuQzzx4YPwzDt2sTnd9blkdCOYZiOJpNJLwhCEA0IMLIMo2UYpgPz/4hQB7PZrBMEgRc5zmMJDp4vCUIatVhcFovFzDCMH8Mw7X9vJf83+DAM42swGIKi3O6outVlL/3pYOM/vvywFjs2zgTPsutkQnoqgmA3Go0BTKt1/lDwYRimncAI/izLBiuExPTv1+vKve8+wt<KEY>
"locaText": {
"polish": "Wytwórnia szampana",
"english": "Champagne Cellar",
"taiwanese": "香檳酒廠",
"brazilian": "Champagne Cellar",
"russian": "Завод игристых вин",
"chinese": "香槟酒厂",
"portuguese": "Champagne Cellar",
"french": "Cave à champagne",
"korean": "샴페인 저장고",
"japanese": "シャンパン醸造所",
"italian": "Cantina di champagne",
"german": "Sektkellerei",
"spanish": "Bodega de champán"
}
},
{
"name": "Steelworks",
"guid": 1010296,
"tpmin": 1.3333333333333335,
"outputs": [
{
"Product": 1010218,
"Amount": 1,
"StorageAmount": 2
}
],
"inputs": [
{
"Product": 1010219,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 200,
"InactiveAmount": 100
},
{
"Product": 1010115,
"Amount": 200
}
],
"region": 5000000,
"icon": "data:image/png;base64,<KEY>Iy<KEY>CoKQooiL22<KEY>kSuQmCC",
"locaText": {
"polish": "Stalownia",
"english": "Steelworks",
"taiwanese": "煉鋼廠",
"brazilian": "Steelworks",
"russian": "Сталелитейный завод",
"chinese": "炼钢厂",
"portuguese": "Steelworks",
"french": "Aciérie",
"korean": "제강소",
"japanese": "鉄工所",
"italian": "Acciaieria",
"german": "Stahlwerk",
"spanish": "Acerería"
}
},
{
"name": "Furnace",
"guid": 1010297,
"tpmin": 2,
"outputs": [
{
"Product": 1010219,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010227,
"Amount": 1,
"StorageAmount": 8
},
{
"Product": 1010226,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 100,
"InactiveAmount": 50
},
{
"Product": 1010115,
"Amount": 100
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAARTElEQVRoge2aeVQUZ7rGPzXGxCwqARurq+qrqsYtixvQe0Oz72jcghoEF5Ctodl3mmZrdmhWWRRRUURFUaMmmk2jZnEyJ5nsy82dk0nMxDvjmMk9Se5M5rl/dIOT<KEY>",
"locaText": {
"polish": "Piec hutniczy",
"english": "Furnace",
"taiwanese": "高爐",
"brazilian": "Furnace",
"russian": "Плавильня",
"chinese": "高炉",
"portuguese": "Furnace",
"french": "Fourneau",
"korean": "제철소",
"japanese": "溶鉱炉",
"italian": "Fornace",
"german": "Hochofen",
"spanish": "Alto horno"
}
},
{
"name": "<NAME>",
"guid": 1010298,
"tpmin": 2,
"outputs": [
{
"Product": 1010226,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 20,
"InactiveAmount": 10
},
{
"Product": 1010115,
"Amount": 10,
"ShutdownThreshold": 0.2
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAWdUlEQVRogdVaeXRUdZa+qSVJZYGkUqnt1at9X5PKniI7WUhCEhKSEEL2jewxCwSSAFlICPuigiIisggujTIuDbaoPdp2D02r7ehoD2rb2C2KirYLAiHf/FFpe3N6pqfV03PPuaf+eHXqva/uvd/vu/c+om/HfIiIS0S+c875ln73ezcOEQUTEUtEaiISEZEf/T8ExCEiicfot0g6n1tGRGlEpCWiIPJGymfO/+mNQ94opPxsg+75qTLp3gAu5RGRhYjERBRI/4+iE0hEVjaEWxcqoAEiaiWiUh5ROhEZiWge/TE6/9TGJSIhESUS<KEY>
"locaText": {
"polish": "Mielerz",
"english": "Charcoal Kiln",
"taiwanese": "炭窯",
"brazilian": "Charcoal Kiln",
"russian": "Угольная печь",
"chinese": "炭窑",
"portuguese": "Charcoal Kiln",
"french": "Charbonnière",
"korean": "숯가마",
"japanese": "木炭窯",
"italian": "Forno a carbone",
"german": "Köhlerei",
"spanish": "Horno de carbonización"
}
},
{
"name": "Weapon Factory",
"guid": 1010299,
"tpmin": 0.6666666666666667,
"outputs": [
{
"Product": 1010221,
"Amount": 1,
"StorageAmount": 1
}
],
"inputs": [
{
"Product": 1010219,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 150,
"InactiveAmount": 75
},
{
"Product": 1010115,
"Amount": 50
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAVB0lEQVRoge2aeWzb53nHf77jWBZFiuSP/PF3khRvird4iBRvipR4iKJO0rovH7Ity5JsRb5k2VLs+HbsOIlj53CbpkmbNGmLNMva9UA7DMOKYd2GYevWDuiODOvWrTfSfveHZKNpkzgFtiYF9gXev4gf8Hze532f53mfhwTx//o/1bpfWb93WkcQxEae4B+QyWRVEq2kWiqVbqdpeitBE<KEY>
"locaText": {
"polish": "<NAME>",
"english": "Weapon Factory",
"taiwanese": "武器工廠",
"brazilian": "Weapon Factory",
"russian": "Оружейный завод",
"chinese": "武器工厂",
"portuguese": "Weapon Factory",
"french": "Usine d'armements",
"korean": "무기 공장",
"japanese": "武器工場",
"italian": "Fabbrica di armi",
"german": "Kanonengießerei",
"spanish": "Fábrica de armas"
}
},
{
"name": "Heavy Weapons Factory",
"guid": 1010301,
"tpmin": 0.5,
"outputs": [
{
"Product": 1010223,
"Amount": 1,
"StorageAmount": 1
}
],
"inputs": [
{
"Product": 1010219,
"Amount": 1,
"StorageAmount": 4
},
{
"Product": 1010222,
"Amount": 1,
"StorageAmount": 2
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 2200,
"InactiveAmount": 1100
},
{
"Product": 1010117,
"Amount": 250
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0<KEY>07z8/OTyeVyX29v7ymCIDxIUdREQRAe9PHxmcxMZh7mOI4WBCGI0LS9ZsERNAw8g/qlT6N20QHEJReBY5jpPE1rGYZ5eAzmH8ca70tRP6dpmggsa03JrsCqQ29i+PgnmPH4OTQMPYvpK46iZPZaCBzXJjCMxtfX9+<KEY>
"locaText": {
"polish": "Fabryka broni ciężkiej",
"english": "Heavy Weapons Factory",
"taiwanese": "重兵器工廠",
"brazilian": "Heavy Weapons Factory",
"russian": "Завод тяжелого вооружения",
"chinese": "重兵器工厂",
"portuguese": "Heavy Weapons Factory",
"french": "Usine d'armements lourds",
"korean": "중화기 공장",
"japanese": "重火器工場",
"italian": "Fabbrica di armi pesanti",
"german": "Geschützfabrik",
"spanish": "Fábrica de armas pesadas"
}
},
{
"name": "Motor Assembly Line",
"guid": 1010302,
"tpmin": 0.6666666666666667,
"outputs": [
{
"Product": 1010224,
"Amount": 1,
"StorageAmount": 1
}
],
"inputs": [
{
"Product": 1010219,
"Amount": 1,
"StorageAmount": 4
},
{
"Product": 1010204,
"Amount": 1,
"StorageAmount": 2
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 1800,
"InactiveAmount": 900
},
{
"Product": 1010117,
"Amount": 250
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAW00lEQVRogcV6aZQd1<KEY>6<KEY>//7zJahado<KEY>5<KEY>9yI9kaJo2Oy8vL4u73Q41jMnqIvnyeIcXK/v9mOz1YbLXh7qU+M+iIP1JoZe+QgzjmMV5NefcsadZMPszAykoKFhkGEb62XOj+<KEY>
"locaText": {
"polish": "Linia montażowa silników",
"english": "Motor Assembly Line",
"taiwanese": "馬達生產線",
"brazilian": "Motor Assembly Line",
"russian": "Линия сборки двигателей",
"chinese": "马达生产线",
"portuguese": "Motor Assembly Line",
"french": "Usine de moteurs",
"korean": "전동기 공장",
"japanese": "モーター組み立てライン",
"italian": "Catena di montaggio automobilistica",
"german": "Motorenfabrik",
"spanish": "Fábrica de motores"
}
},
{
"name": "Cab Assembly Line",
"guid": 1010303,
"tpmin": 1,
"outputs": [
{
"Product": 1010225,
"Amount": 1,
"StorageAmount": 2
}
],
"inputs": [
{
"Product": 1010211,
"Amount": 1,
"StorageAmount": 3
},
{
"Product": 1010224,
"Amount": 1,
"StorageAmount": 3
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 3000,
"InactiveAmount": 1500
},
{
"Product": 1010117,
"Amount": 500
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAXyUlEQVRogc2ad3Rc5Zn/r22wvWZxQzN35t77vreNpmiKZjRdGs1oqnrvtqxmq9lqLkKSLcvGtnAvGOOCAxgCJJjYpoW1MRBKCpAASVg2Idms4fyWHyRhCZuEwBrw9/eHRDEGfsHJ2d3nnO8fc2bOvPdzn+e9T7kvw/z32LQv0f<KEY>
"locaText": {
"polish": "<NAME>",
"english": "Cab Assembly Line",
"taiwanese": "汽車生產線",
"brazilian": "Cab Assembly Line",
"russian": "Линия сборки парового транспорта",
"chinese": "汽车生产线",
"portuguese": "Cab Assembly Line",
"french": "Usine d'automobiles à vapeur",
"korean": "자동차 공장",
"japanese": "馬車組み立てライン",
"italian": "Catena di montaggio carrozze",
"german": "Dampfwagenfabrik",
"spanish": "Fábrica de coches"
}
},
{
"name": "<NAME>",
"guid": 1010282,
"tpmin": 1,
"outputs": [
{
"Product": 1010204,
"Amount": 1,
"StorageAmount": 2
}
],
"inputs": [
{
"Product": 1010229,
"Amount": 1,
"StorageAmount": 4
},
{
"Product": 1010230,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 250,
"InactiveAmount": 125
},
{
"Product": 1010115,
"Amount": 25
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAATxklEQVRoge1aZ1SVZ9Z91CSWGEXCbW9/L5aIJVZERUVEgg2s2BCQ3ouIIqIUFUFBQKQpCIIU6R2kXZooooAo9pix6xhT/CbJlJj9/bhoZiaZ+ZJMxuTHd9Y6665177prvfs8e59znnNeQv7f/iPrTwh5mxAyiBAymBAykBDyTt93A/q8PyGkX5//Lq0/RaghUqlUpmSYUYIgfMAwzChBLggMw9CiVCqjafp95YgRwyUSyVCiBvs2UQP73Vg/QshgQS4IxvPGXfBzM4SDxaw/rlg0qUtvyqgyhVSeQMtkO2iatuRper5A03ocx41jWZaSEfIu+R2BeVsqlco4Wr66/pQ<KEY>
"locaText": {
"polish": "Odlewnia mosiądzu",
"english": "Brass Smeltery",
"taiwanese": "黃銅冶煉廠",
"brazilian": "Brass Smeltery",
"russian": "Плавильня латуни",
"chinese": "黄铜冶炼厂",
"portuguese": "Brass Smeltery",
"french": "Fonderie de laiton",
"korean": "황동 제작소",
"japanese": "真鍮精錬所",
"italian": "Fonderia di ottone",
"german": "Messinghütte",
"spanish": "Fundición de latón"
}
},
{
"name": "<NAME>",
"guid": 101331,
"tpmin": 4,
"outputs": [
{
"Product": 1010566,
"Amount": 1,
"StorageAmount": 200
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 250,
"InactiveAmount": 125
},
{
"Product": 1010115,
"Amount": 100
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAR5ElEQVRogc2aZ3Ac53nHlxRJmVQBAQHcu+27aHcoh3o43OFwHbiGw1UAd4dy6ATAgsICEoUA0QiABBvYmyRaIilZkiVRlbIUWSKt8ahYmSQfnGKnzMhOMp7EH+RJYtn/fACIkBFpiyAd5T/zfLm5ndnfPs/zf9/32SWIB68Vt8TKxbj1t/+3unnDqwiCeJggiHWJiYmPxcfHx3FxXDwXx8XHx8fHJSYmPkaS5CMEQXyHIIjVBEE8tHjdt64VBEGsoihqHRcXF8+yLMUwTIrEMNksy6o5jisRWdYgMIyR47gSiWXVIsOoJJpOkyiKoygqMTEx8TFiAf4h4lvI1gqCIFYnJCQ8TtM0I9J0DkPK23OyMl+IhkP/0Nfb<KEY>
"locaText": {
"polish": "Rafineria",
"english": "Oil Refinery",
"taiwanese": "煉油廠",
"brazilian": "Oil Refinery",
"russian": "Нефтяной завод",
"chinese": "炼油厂",
"portuguese": "Oil Refinery",
"french": "Raffinerie de pétrole",
"korean": "정유 공장",
"japanese": "石油精製所",
"italian": "Raffineria petrolifera",
"german": "Ölraffinerie",
"spanish": "Refinería de petróleo"
}
},
{
"name": "<NAME>",
"guid": 1010304,
"tpmin": 4,
"outputs": [
{
"Product": 1010226,
"Amount": 1,
"StorageAmount": 8
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 50,
"InactiveAmount": 25
},
{
"Product": 1010115,
"Amount": 50
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAUxklEQVRoge2Zd3BV153HL2DsuCJh6b1bzjm3vF7ufU1PemoICQRCEiDUe0MFgXpBEipI9A5GNGNsMHYMxsaG2Ni4JcFOnGziTGIn9topzibeySSbeLKb7CTZknz3jyfLhmCc7Do7uzP+zvxm7pv3x72f8yvn/H6H4z7TZ/pM/180i+O42RzHzeU47nOiKN5mNptvJxx3K8dxN0//939WsziOm0sIuVWLjZ1nNptNqiDIiig6VUnyyaIc1AjRVUGQY2Nj53FRyFl/yw+azXHcTVx05eZO//6kF86Ji4u7U5Ikwhhzy6KYolC6kohiuyarJyyq9hVN0X6qyPI+hdIKWZQD8fHx/LSHPlXvzOI4bg7HcbdosbHzZFkWBEGQRVGkhJD5ZrP5do7jbvkI2FUQMTExMRohOh<KEY>
"locaText": {
"polish": "Kopalnia węgla",
"english": "Coal Mine",
"taiwanese": "煤礦",
"brazilian": "Coal Mine",
"russian": "Угольная шахта",
"chinese": "煤矿",
"portuguese": "Coal Mine",
"french": "Mine de charbon",
"korean": "석탄 광산",
"japanese": "炭鉱",
"italian": "Miniera di carbone",
"german": "Kohlemine",
"spanish": "Mina de carbón"
}
},
{
"name": "<NAME>",
"guid": 1010305,
"tpmin": 4,
"outputs": [
{
"Product": 1010227,
"Amount": 1,
"StorageAmount": 8
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 50,
"InactiveAmount": 25
},
{
"Product": 1010115,
"Amount": 50
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYN0lEQVRogc1aaVRUV7a+auwkdqKCFFV1h3OHKoZirmKmoAaGYqaY50lQUZEZERRUJkUERQQVUQHnORrHOHbM1Ek0iTHmmTZTp6NJd/KSlZeOacfv/YDYWf3s1+nXyXtvr7VX/bi11j3f2fvbe5/vXIr6ZWwcRVHjx37H/ULv+EVtPEVRT9ja2k4mU6bY2NjYTJHL5b+mKOpXFEVN+D9e20+2CXZ2dk8LCkFg<KEY>
"locaText": {
"polish": "Kopalnia żelaza",
"english": "Iron Mine",
"taiwanese": "鐵礦",
"brazilian": "Iron Mine",
"russian": "Железный рудник",
"chinese": "铁矿",
"portuguese": "Iron Mine",
"french": "Mine de fer",
"korean": "철광산",
"japanese": "鉄鉱",
"italian": "Miniera di ferro",
"german": "Eisenmine",
"spanish": "Mina de hierro"
}
},
{
"name": "<NAME>",
"guid": 1010307,
"tpmin": 2,
"outputs": [
{
"Product": 1010229,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 250,
"InactiveAmount": 125
},
{
"Product": 1010115,
"Amount": 25
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAXO0lEQVRoge1aeVSTd7r+3KaddqxFIyHflu8LCkLCTgIhCYGQEPYtYV8TCPsOiisKsiMqQhE3VLQtLl0UcUPFfcG1VluttrU6c52Z9s7SM+eeO3NP57l/QJ3Onc7Uzm3vvX/c55zf4Y+cw/k9v3d73vf9COL/8aNiCkEQU79xpvzvXucf479edhpBED+hafqnAoFgJsuydhRFzbGzs5tFEMSLk7//n8IUgiCmCwnhy+ysWXbsrFl2NE3PFgsEIoZhHGl72p2jKH/KgUokHRwWMSQZJxKJxDRB/JT4P2SZKQRBzKAoag4jEvkylKiQo+kgnmQNtEg0OE/Cf7l4cSnOn38bDx6exeHhAcyTSH7FM0yovb29kCCIGT/mxf6<KEY>
"locaText": {
"polish": "Kopalnia cynku",
"english": "Zinc Mine",
"taiwanese": "鋅礦",
"brazilian": "Zinc Mine",
"russian": "Цинковый рудник",
"chinese": "锌矿",
"portuguese": "Zinc Mine",
"french": "Mine de zinc",
"korean": "아연 광산",
"japanese": "亜鉛鉱",
"italian": "Miniera di zinco",
"german": "Zinkmine",
"spanish": "Mina de zinc"
}
},
{
"name": "<NAME>",
"guid": 1010308,
"tpmin": 2,
"outputs": [
{
"Product": 1010230,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 250,
"InactiveAmount": 125
},
{
"Product": 1010115,
"Amount": 25
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYXElEQVRoge1ad3RUZfq+CIJrARIymZl77/fdMr2XTHqb9F5JJYVAEjoJgZDQS4iU0HtX6Uu<KEY>vW9//i4f0f8akPsUwMt9cAAAAASUVORK5CYII=",
"locaText": {
"polish": "Kopalnia miedzi",
"english": "Copper Mine",
"taiwanese": "銅礦",
"brazilian": "Copper Mine",
"russian": "Медный рудник",
"chinese": "铜矿",
"portuguese": "Copper Mine",
"french": "Mine de cuivre",
"korean": "구리 광산",
"japanese": "銅鉱",
"italian": "Miniera di rame",
"german": "Kupfermine",
"spanish": "Mina de cobre"
}
},
{
"name": "<NAME>",
"guid": 1010309,
"tpmin": 2,
"outputs": [
{
"Product": 1010231,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 250,
"InactiveAmount": 125
},
{
"Product": 1010115,
"Amount": 25
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAWjUlEQVRogdWad1yVZ7bvX2NMm0lUDrBh7/d9996gOUkmM8lMcjLJzGROkpkcU9QYU+w9RuwoIFIVpCll00SULiAdpPe26bCl9yYWLIAlmjGZMcn3/oHJPfeeez9HMzltfT7r7/1+9+9Zaz1rPUsQ/nNsxv/l/yPtIUEQHlEIws9<KEY>
"locaText": {
"polish": "Kopalnia wapienia",
"english": "Limestone Quarry",
"taiwanese": "石灰岩礦場",
"brazilian": "Limestone Quarry",
"russian": "Известняковый карьер",
"chinese": "石灰岩矿场",
"portuguese": "Limestone Quarry",
"french": "Carrière de calcaire",
"korean": "석회석 광산",
"japanese": "石灰岩の採石場",
"italian": "Giacimento di calcare",
"german": "Zementmine",
"spanish": "Cantera de caliza"
}
},
{
"name": "<NAME>",
"guid": 1010311,
"tpmin": 0.4,
"outputs": [
{
"Product": 1010233,
"Amount": 1,
"StorageAmount": 1
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 250,
"InactiveAmount": 125
},
{
"Product": 1010367,
"Amount": 25
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSU<KEY>
"locaText": {
"polish": "Kopalnia złota",
"english": "Gold Mine",
"taiwanese": "金礦",
"brazilian": "Gold Mine",
"russian": "Золотая шахта",
"chinese": "金矿",
"portuguese": "Gold Mine",
"french": "Mine d'or",
"korean": "금광",
"japanese": "金鉱",
"italian": "Miniera d'oro",
"german": "Goldmine",
"spanish": "Mina de oro"
}
},
{
"name": "Rendering Works",
"guid": 1010312,
"tpmin": 1,
"outputs": [
{
"Product": 1010234,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010199,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 40,
"InactiveAmount": 20
},
{
"Product": 1010115,
"Amount": 40
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBOR<KEY>",
"locaText": {
"polish": "Wytwórnia łoju",
"english": "Rendering Works",
"taiwanese": "精煉工作坊",
"brazilian": "Rendering Works",
"russian": "Салотопный завод",
"chinese": "精炼工作坊",
"portuguese": "Rendering Works",
"french": "Fonderie de suif",
"korean": "축산 가공장",
"japanese": "獣脂加工所",
"italian": "Scorticatoio",
"german": "Wasenmeisterei",
"spanish": "Extractor de grasa"
}
},
{
"name": "<NAME>",
"guid": 1010313,
"tpmin": 2,
"outputs": [
{
"Product": 1010235,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010192,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 50,
"InactiveAmount": 25
},
{
"Product": 1010052,
"Amount": 10
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAWG0lEQVRoge2aZ1SVZ7bHXzXVjNIOnHPe/p5z6CC9dw5Ih0Mv0otUkY6CFAUUQbAgCKIoTUFsKCBqDMZuTGLXmBidSTKTuXOTmZjRaMrM/36AZM3kVpiZO/fD/a+1P5y1zofnt/577+fZ7/MQxP9rTpr3z17AXDRvJhYQBPEyz/OvkSS5kCTJhQRBvEIQxPx/6ur+C/20aIIgXhMTxBu8urq6XCzWkZEky5O8AU9R5pSYsqcoitbW1v4FQRAvEf9HXPpx8a+KRKJFEolEmyRJRiBJfVYqteJp2l2gqAhaKt3n<KEY>
"locaText": {
"polish": "Wiatrak",
"english": "Flour Mill",
"taiwanese": "磨坊",
"brazilian": "Flour Mill",
"russian": "Мельница",
"chinese": "磨坊",
"portuguese": "Flour Mill",
"french": "Moulin",
"korean": "제분소",
"japanese": "製粉所",
"italian": "Mulino",
"german": "Mühle",
"spanish": "Molino de harina"
}
},
{
"name": "Malthouse",
"guid": 1010314,
"tpmin": 2,
"outputs": [
{
"Product": 1010236,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010192,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 150,
"InactiveAmount": 75
},
{
"Product": 1010115,
"Amount": 25
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAThklEQVRoge1ZeXRX5Zm+AUFUxCT8ttz7bffe3y8h+76H7CvZ95CFbCRkXyAJIQkhAgmEsIQAgQBBQBaRRQQZxAVFsRYX1Grdaqu12jqtnbZnnKm11mf+SOzxjFtHbadzxuec76+7nO+57/c+93nfV5K+x/f4Ht/jW8BOkqQZkiTdIEnSrOl1gyRJM6ev/d<KEY>yzWTePEdqoLKwWISwWISiKERRlPlGo3GuJEmzp++f+ekzkiTdOL1mTV/7hxOYZTabb1EUZT43cCduNqsaIZ4q55sz4vyer8iLe6c8P+U1jfFTgtIkoQgfWZaZLMsGs9lsUhSFUJNJVxTFmRBiJYQowl7YT5P6hxCykyRpjslkMgtKk5IXuh9MjXR/aKGf85WkENt/DLcn4+DGYoyuykBfTSSai4JwaP9BxIQHvy0ordAIz/Vx1YdjQ/<KEY>",
"locaText": {
"polish": "Słodownia",
"english": "Malthouse",
"taiwanese": "麥芽加工廠",
"brazilian": "Malthouse",
"russian": "Солодильня",
"chinese": "麦芽加工厂",
"portuguese": "Malthouse",
"french": "Malterie",
"korean": "맥아 저장고",
"japanese": "麦芽製造所",
"italian": "Malteria",
"german": "Mälzerei",
"spanish": "Maltería"
}
},
{
"name": "<NAME>",
"guid": 1010315,
"tpmin": 2,
"outputs": [
{
"Product": 1010237,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010197,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 50,
"InactiveAmount": 25
},
{
"Product": 1010052,
"Amount": 50
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAWZ0lEQVRoge2ad3BWZ5bmL8bGYRqTJH3fd/P9JIEACwTKOWcJCUWEItKnLJQQSCjLCCGEJBBKiCARBIicDdhgA44YZxu33dPj6ZqardqdqQ21VT1V3W77t38gz3bvbtdO19K9vVX7VL11/7pv3eeec97znHNeQfj/+N9ijiAIz8w+/5/EHEEQnhMF4SWnxYtfXrx48cuiILzk5OT0vCAI8wRBeE4QhGeFv3KSzwiC8ILJZHLQRG2tZDan6bLsbUjSalEUl6mqatXNZl1RFHHRokULhCfE/urIPCMIwotWUVQli6X0k49u8I//8JCrlyfx9/VAspi/Ec3mn4tm82PRYvqFVVE8dXvdLAjC88JfAZk5wn+PhRdFUVQs9qYd165MkpkcSX5aLHVlOUwMd/P143t8+OFtPnx4k/MXTyJZLHs1UfNzcHAwCYLwwuwe/1cIPCsIwvP29vY/k19+ebHFYtEsJlPPr757j+hgL1JigynauI6y/HSqy/LZt38vXR3befTwFsOjw/j5+f6jKsrtqiSFqyaTdeHChQuFJ9b5ixCaIwjCs6IovuTg4GCyStJSQ5a9rJIabqhqmmyxTNy+fYHujjqigr0ozUul0raRuspCdu7s5NZrJ7l58xxDw0PkFOSRujGT5cuX/7NV1rI1UfTTTCZDVdVFwpPY+bMdBs8Ig<KEY>
"locaText": {
"polish": "Szwalnia",
"english": "Framework Knitters",
"taiwanese": "紡織工廠",
"brazilian": "Framework Knitters",
"russian": "Ткацкая мастерская",
"chinese": "纺织工厂",
"portuguese": "Framework Knitters",
"french": "Filature",
"korean": "편물 공장",
"japanese": "織物工場",
"italian": "Maglieriste",
"german": "Weberei",
"spanish": "Telar de marco"
}
},
{
"name": "Dynamite Factory",
"guid": 1010300,
"tpmin": 1,
"outputs": [
{
"Product": 1010222,
"Amount": 1,
"StorageAmount": 2
}
],
"inputs": [
{
"Product": 1010234,
"Amount": 1,
"StorageAmount": 4
},
{
"Product": 1010232,
"Amount": 1,
"StorageAmount": 3
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 1000,
"InactiveAmount": 500
},
{
"Product": 1010117,
"Amount": 250
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEU<KEY>6JcaYyVWez2RtBleVKxtWzfvRtaGdv//Jdy/jl98<KEY>",
"locaText": {
"polish": "Fabryka dynamitu",
"english": "Dynamite Factory",
"taiwanese": "炸藥工廠",
"brazilian": "Dynamite Factory",
"russian": "Фабрика динамита",
"chinese": "炸药工厂",
"portuguese": "Dynamite Factory",
"french": "Usine de dynamite",
"korean": "다이너마이트 공장",
"japanese": "ダイナマイト工場",
"italian": "Fabbrica di dinamite",
"german": "Dynamitfabrik",
"spanish": "Fábrica de dinamita"
}
},
{
"name": "Glassmakers",
"guid": 1010319,
"tpmin": 2,
"outputs": [
{
"Product": 1010241,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010228,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 100,
"InactiveAmount": 50
},
{
"Product": 1010116,
"Amount": 100
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyC<KEY>z0lEQVRoge2aZ3<KEY>7+2o6j3d8XNO66rbBk3V0SkXh/2ozZD8a+OKnn+ecnHBwzZuxqDjU6h0BRFYlhfBLDotgEsYhkMqcEBARgCIIM/2fBDKYjyDMYhj<KEY>",
"locaText": {
"polish": "Huta szkła",
"english": "Glassmakers",
"taiwanese": "玻璃製造廠",
"brazilian": "Glassmakers",
"russian": "Стекольная фабрика",
"chinese": "玻璃制造厂",
"portuguese": "Glassmakers",
"french": "Verrerie",
"korean": "유리 제조소",
"japanese": "ガラス工場",
"italian": "Vetrai",
"german": "Glashütte",
"spanish": "Cristalero"
}
},
{
"name": "<NAME>",
"guid": 1010320,
"tpmin": 1,
"outputs": [
{
"Product": 1010242,
"Amount": 1,
"StorageAmount": 2
}
],
"inputs": [
{
"Product": 120008,
"Amount": 1,
"StorageAmount": 8
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 750,
"InactiveAmount": 375
},
{
"Product": 1010117,
"Amount": 150
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0<KEY>0E310WY7XZC3<KEY>8cXIdX51ay+MTzcweXc/tt9p4eKCcsZ2ljDRm01a59G/SYuyzoofHEdUo1+qyHG9WlHCTKPrIr8mSK<KEY>
"locaText": {
"polish": "Zakład snycerski",
"english": "Marquetry Workshop",
"taiwanese": "鑲嵌工作坊",
"brazilian": "Marquetry Workshop",
"russian": "Завод по обработке дерева",
"chinese": "镶嵌工作坊",
"portuguese": "Marquetry Workshop",
"french": "Atelier de marqueterie",
"korean": "고급 가구 제작소",
"japanese": "寄せ木工房",
"italian": "Laboratorio di intarsi",
"german": "Kunstschreinerei",
"spanish": "Taller de marquetería"
}
},
{
"name": "<NAME>",
"guid": 1010321,
"tpmin": 1,
"outputs": [
{
"Product": 1010243,
"Amount": 1,
"StorageAmount": 2
}
],
"inputs": [
{
"Product": 1010226,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 725,
"InactiveAmount": 367
},
{
"Product": 1010117,
"Amount": 150
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAATFUlEQVRoge3aeXCcZ30H8Fc2zkUc24q0x/M+x3vsu/vurvY+tKd2da+0h1aXJUu2rNuyZUuyYid2nDiOk5gkpolpQ5MCDUcIdCAcpUNDAg2Eo2EIME2htA1Duc+2dKADSQHn2z+kKBYOHTkNR2f6m3n+2ZmdeT/ze37P<KEY>//<KEY>
"locaText": {
"polish": "Fabryka żarników",
"english": "Filament Factory",
"taiwanese": "燈絲工廠",
"brazilian": "Filament Factory",
"russian": "Завод нитей накала",
"chinese": "灯丝工厂",
"portuguese": "Filament Factory",
"french": "Usine de filaments",
"korean": "필라멘트 공장",
"japanese": "フィラメント工場",
"italian": "Fabbrica di filati",
"german": "Glühfadenfabrik",
"spanish": "Fábrica de filamentos"
}
},
{
"name": "Bicycle Factory",
"guid": 1010323,
"tpmin": 2,
"outputs": [
{
"Product": 1010245,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010255,
"Amount": 1,
"StorageAmount": 6
},
{
"Product": 1010219,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 1200,
"InactiveAmount": 600
},
{
"Product": 1010117,
"Amount": 150
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAWmklEQVRogc1aZ1RV17rdmkSTm8SgOXDO2avtvQ9WQBFBAQtWEFAEKwgWikgRUFDAgoDSpNkQkEMRa0CxRbFEgw08ajRXX2LMS4x6E5ObmK53xFiY7wckIy/l5nrHu8mbY5yx99jj/Pjm+r65vrKWJP3n0UGSpI7tzx/en5IkqZMkSc+0v3f4A+z4t9BBajOws16SntfpdC/q9frnZVn+S7du3bqoNjZ6TZY5IYTSLl26SZL0bPv//3SDn5HaVriTJEmdqCQ9Rwh5mTFmErLor1A6SMjCycSYPTMwFxud7u3Ro72/NuqNazWZD+Gca926devyZ5HpIElSZ1mWdbIsc1sbGxPnXON6vWbSM3tOyKyoyJjPGg8dQ1XNDkwLmvEtl<KEY>CYII=",
"locaText": {
"polish": "Fabryka bicykli",
"english": "Bicycle Factory",
"taiwanese": "腳踏車工廠",
"brazilian": "Bicycle Factory",
"russian": "Фабрика велосипедов",
"chinese": "脚踏车工厂",
"portuguese": "Bicycle Factory",
"french": "Usine de grands-bis",
"korean": "자전거 공장",
"japanese": "自転車工場",
"italian": "Fabbrica di biciclette",
"german": "Hochrad-Werkhalle",
"spanish": "Fábrica de bicicletas"
}
},
{
"name": "Clockmakers",
"guid": 1010324,
"tpmin": 0.6666666666666667,
"outputs": [
{
"Product": 1010246,
"Amount": 1,
"StorageAmount": 1
}
],
"inputs": [
{
"Product": 1010241,
"Amount": 1,
"StorageAmount": 4
},
{
"Product": 1010249,
"Amount": 1,
"StorageAmount": 2
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 1400,
"InactiveAmount": 700
},
{
"Product": 1010117,
"Amount": 150
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAASjklEQVRogdWaZ1hVV7rHF5porFECp+y9djkHbCDdQokKsYOIEguiUQQBBa<KEY>
"locaText": {
"polish": "Wytwórnia zegarów",
"english": "Clockmakers",
"taiwanese": "鐘錶匠",
"brazilian": "Clockmakers",
"russian": "Часовщики",
"chinese": "钟表匠",
"portuguese": "Clockmakers",
"french": "Horlogerie",
"korean": "시계 제작소",
"japanese": "時計職人",
"italian": "Orologiai",
"german": "Uhrenwerkstatt",
"spanish": "Relojero"
}
},
{
"name": "Sewing Machine Factory",
"guid": 1010284,
"tpmin": 2,
"outputs": [
{
"Product": 1010206,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 120008,
"Amount": 1,
"StorageAmount": 8
},
{
"Product": 1010219,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 500,
"InactiveAmount": 250
},
{
"Product": 1010116,
"Amount": 150
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAY8ElEQVRogc16d3RU173uwV3SzJxz9t7njBhAEk1UUSTUUEG9<KEY>j<KEY>8<KEY>2DDEgHH2mPRaFwDSmkupXSOQqGQKKVzGGOBgiCsZoytY4ytkwVhtaRSLfb29p7tAXw7et9rt0N7DzfjIe871gMcx937Q25yh90tCIJACFnhp9F8cGTEhraiC<KEY>",
"locaText": {
"polish": "Fabryka maszyn do szycia",
"english": "Sewing Machine Factory",
"taiwanese": "縫紉機器工廠",
"brazilian": "Sewing Machine Factory",
"russian": "Фабрика швейных машин",
"chinese": "缝纫机器工厂",
"portuguese": "Sewing Machine Factory",
"french": "Usine de machines à coudre",
"korean": "재봉틀 공장",
"japanese": "ミシン工場",
"italian": "Fabbrica di macchine da cucire",
"german": "Nähmaschinenfabrik",
"spanish": "Fábrica de máquinas de costura"
}
},
{
"name": "Gramophone Factory",
"guid": 1010326,
"tpmin": 0.5,
"outputs": [
{
"Product": 1010248,
"Amount": 1,
"StorageAmount": 1
}
],
"inputs": [
{
"Product": 1010242,
"Amount": 1,
"StorageAmount": 3
},
{
"Product": 1010204,
"Amount": 1,
"StorageAmount": 3
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 1600,
"InactiveAmount": 800
},
{
"Product": 1010117,
"Amount": 150
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAARDklEQVRogc2aeXBU15XGr9hCbLM1/d7rfu/e+5bW1t1St9St1i60qwUSqyQkkIQECIQEElrQAggLwmZhCww4ssErYFvsGMUGJCGEWWwTUvbEdkgmrolTScbJTGUSZybjmSwz3/zRsuIslcGxCD5V3x9dr+rW+9U937nnnteE3P8YTwiZZDabpyhTlJmKosycMW<KEY>
"locaText": {
"polish": "Fabryka gramofonów",
"english": "Gramophone Factory",
"taiwanese": "留聲機工廠",
"brazilian": "Gramophone Factory",
"russian": "Фабрика граммофонов",
"chinese": "留声机工厂",
"portuguese": "Gramophone Factory",
"french": "Usine de gramophones",
"korean": "축음기 공장",
"japanese": "蓄音機工場",
"italian": "Fabbrica di grammofoni",
"german": "Phonographenfabrik",
"spanish": "Fábrica de gramófonos"
}
},
{
"name": "Goldsmiths",
"guid": 1010327,
"tpmin": 1,
"outputs": [
{
"Product": 1010249,
"Amount": 1,
"StorageAmount": 2
}
],
"inputs": [
{
"Product": 1010226,
"Amount": 1,
"StorageAmount": 4
},
{
"Product": 1010233,
"Amount": 1,
"StorageAmount": 3
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 750,
"InactiveAmount": 375
},
{
"Product": 1010117,
"Amount": 125
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAASCElEQ<KEY>9exqnTx/XPyZquKf5zLu4K/ZRfziE+iPBNKSG4MgYhTM3EvepOCqyosjcNYL4sKcw<KEY>
"locaText": {
"polish": "Warsztat złotnika",
"english": "Goldsmiths",
"taiwanese": "金匠",
"brazilian": "Goldsmiths",
"russian": "Плавильня золота",
"chinese": "金匠",
"portuguese": "Goldsmiths",
"french": "Orfèvrerie",
"korean": "금 세공소",
"japanese": "金細工工房",
"italian": "Orafi",
"german": "Goldschmelze",
"spanish": "Orfebre"
}
},
{
"name": "Jewellers",
"guid": 1010328,
"tpmin": 2,
"outputs": [
{
"Product": 1010250,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010256,
"Amount": 1,
"StorageAmount": 6
},
{
"Product": 1010249,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 2500,
"InactiveAmount": 1250
},
{
"Product": 1010116,
"Amount": 150
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAW6ElEQVRoge1aaVQU17Yu0Rg1GgW76e6qU6eqq8GJROOAEwYHBo2apFFRNESjgihKEOcR1KA4gIogo7QMggMgk8wqkxNKUAREBeIQRVQUNOKM3/sBGcw19+Xel9z11lvvW2v/6dVd1d/Z+9tn730Ow/w//u9D73fW6h32vxatGIZpzTBMOwMDgw85juvKderUlVKqL5PJOsnl8o5yubyjgmE+YBimPcMw7zMM8x7zK9H/LIB1esBbL/6FAPmQGPA8rxE5bjDPK<KEY>
"locaText": {
"polish": "Warsztat jubilera",
"english": "Jewellers",
"taiwanese": "珠寶商",
"brazilian": "Jewellers",
"russian": "Ювелирная мастерская",
"chinese": "珠宝商",
"portuguese": "Jewellers",
"french": "Joaillerie",
"korean": "귀금속 세공소",
"japanese": "宝石商",
"italian": "Gioiellieri",
"german": "Goldschmiede",
"spanish": "Joyero"
}
},
{
"name": "Spectacle Factory",
"guid": 101250,
"tpmin": 0.6666666666666667,
"outputs": [
{
"Product": 120030,
"Amount": 1,
"StorageAmount": 1
}
],
"inputs": [
{
"Product": 1010241,
"Amount": 1,
"StorageAmount": 4
},
{
"Product": 1010204,
"Amount": 1,
"StorageAmount": 2
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 1000,
"InactiveAmount": 500
},
{
"Product": 1010117,
"Amount": 100
}
],
"region": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAUiklEQVRogc1aaXRT17W+BAjYlnSHc+6VbWxswGAGz7MleZbnSbItT5I8D9iWB3mejWdbmKFgYiZjIAxJaDBJIAlJWEnzUkiaJm2avA4vndbra5u2SV/mNH19+d4PCUqz2q42lJfstfaS1l33x/7OPt++e3/nMMyXbyscfo/DVzEMcy/DMGsZhnFy/N7LMMxKx3tfKVvB2AO7l7EHK+c4jpPL5cTFxUUpODl5cBznxXGct+Dk5CGXyynDMC4Mw6xmviJgbq78GkEQFC4uLkqWZTcQQrZKHBdIKQ2TBEFFCEmUBCFVovR3IqXf4nnej1LqxjCMM2NfgC/VbmbBWSaTiQqFYjMhJFKidEQk5IREyP0SpRAJuZAWF4zDw3qcGopDd7YSfusF8DwfIJPJRMaexS/VVjIM4+zi4qLked6f8nzmRq91+PkL0/je2WIcbd2GmUovHGzaht3V3rBVe+PieDIW23xx0iADpTRTVCg2C4KgYL7ErKxgGGaNTCYTeZ73V1L66KVjrfjhA0V4aCgQBxp9YKvyxoTZA+NmT8xUemOm0gszFesxbvTAcZMAidJXRJ6PEQTB092+xVZ9GUBWMgyjEBUKH4mQvGceHMBrS+k41+uHYo0cybE7kJwSjaSkKGiTo5GZEopCjQLDxa6YqfSCrcobKl8CkZBxQkg4dXZ2Z+<KEY>
"locaText": {
"polish": "Fabryka okularów",
"english": "Spectacle Factory",
"taiwanese": "眼鏡工廠",
"brazilian": "Spectacle Factory",
"russian": "Оптическая мастерская",
"chinese": "眼镜工厂",
"portuguese": "Spectacle Factory",
"french": "Usine de lunettes",
"korean": "안경 공장",
"japanese": "眼鏡工場",
"italian": "Fabbrica di occhiali",
"german": "Brillenfabrik",
"spanish": "Fábrica de gafas"
}
},
{
"name": "Sugar Cane Plantation",
"guid": 1010329,
"tpmin": 2,
"outputs": [
{
"Product": 1010251,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 5,
"InactiveAmount": 3
},
{
"Product": 1010366,
"Amount": 10
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAUWklEQVRoge1ZZ1CV19Z+Nc2YGCMC55z33ftt9I6AokSwY0BsgEpRQJpI7ygoiopYULGgItgrthg1IoKNCKKI0pu9REVAydXo5E70+X6A+XLv3Fwx9975yuSZeebMvD/O7Gc/a6+19toM8yf+xJ/4/4Bu/9ML+D38o4V1+w27MwzzIcMwHxNCPmVZtidhyKed3/6wqLd//MHf8UOGYT5mGKYHwzCfdv5+0vnto3/AjxmG6aFQKD5TKBSfMQzT8zf8TEND4/M+ffr05jiuL6WUFRQKiVJqTCntL7CsjcAK/QghHMuyPd9XTHeGYT5WV1fvRQhRUyqVGm+pUCg0BXV1Fa/gZUGlMiCEmPBKpREhREdQKCSWZXmWZSnHcYRlWcqyLOUVCllkWX2BFfoJLGshsGw/juPMRY4zF1jWQiJkAM/zgyWeHyUQ4imwbKxKU/GNi4vlLVcP8Sd9fWW1SOlolmX5zk3pmgsKhvlMoVBIEqV2PMd5C4T4CYT4CZT68oQE8oSECxy3cJCFVrXdQL1bdrZG+XraQg5h2aWEZZN5jpstEhJPOS6JsGwKYdnlAmFzBllq/2hnrVs7YrhJ8aiR5mUOX/erdXK0vDN+rHW7h5vtm9TFE7ApywXBwfpYu3Y4V<KEY>
"locaText": {
"polish": "Plantacja trzciny cukrowej",
"english": "Sugar Cane Plantation",
"taiwanese": "甘蔗園",
"brazilian": "Sugar Cane Plantation",
"russian": "Плантация тростника",
"chinese": "甘蔗园",
"portuguese": "Sugar Cane Plantation",
"french": "Plantation de canne à sucre",
"korean": "사탕수수 농장",
"japanese": "さとうきび農園",
"italian": "Piantagione di canne da zucchero",
"german": "Zuckerrohrplantage",
"spanish": "Plantación de caña de azúcar"
}
},
{
"name": "Tobacco Plantation",
"guid": 1010330,
"tpmin": 0.5,
"outputs": [
{
"Product": 1010252,
"Amount": 1,
"StorageAmount": 1
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 25,
"InactiveAmount": 13
},
{
"Product": 1010366,
"Amount": 10
}
],
"region": 5000001,
"icon": "data:image/png;base64,i<KEY>DFG+nyM2VsX<KEY>
"locaText": {
"polish": "Plantacja tytoniu",
"english": "Tobacco Plantation",
"taiwanese": "菸草園",
"brazilian": "Tobacco Plantation",
"russian": "Плантация табака",
"chinese": "烟草园",
"portuguese": "Tobacco Plantation",
"french": "Plantation de tabac",
"korean": "담배 농장",
"japanese": "タバコ農園",
"italian": "Piantagione di tabacco",
"german": "Tabakplantage",
"spanish": "Plantación de tabaco"
}
},
{
"name": "Cotton Plantation",
"guid": 1010331,
"tpmin": 1,
"outputs": [
{
"Product": 1010253,
"Amount": 1,
"StorageAmount": 2
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 5,
"InactiveAmount": 3
},
{
"Product": 1010366,
"Amount": 10
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0<KEY>//<KEY>3Lg+gBvXB3DtWj/8/ZzxxuuvtPIsdYAl2VWcQCA2MDB4jpgOu389CZIgn6EoimZJcpXA0FDj4338XEO9CufONf9s8MOHE7h<KEY>
"locaText": {
"polish": "Plantacja bawełny",
"english": "Cotton Plantation",
"taiwanese": "棉花園",
"brazilian": "Cotton Plantation",
"russian": "Плантация хлопка",
"chinese": "棉花园",
"portuguese": "Cotton Plantation",
"french": "Plantation de coton",
"korean": "목화 농장",
"japanese": "綿花農園",
"italian": "Piantagione di cotone",
"german": "Baumwollplantage",
"spanish": "Plantación de algodón"
}
},
{
"name": "Cocoa Plantation",
"guid": 1010332,
"tpmin": 1,
"outputs": [
{
"Product": 1010254,
"Amount": 1,
"StorageAmount": 2
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 5,
"InactiveAmount": 3
},
{
"Product": 1010366,
"Amount": 10
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAVE0lEQVRoge2aZ1Cc57XHX1V22d53n7e/yzZg2V1YytJ7E6ItCFEkEK<KEY>3Z<KEY>2slsgSyBJbtONexk7n5cid37sfUm/h/PyxSosRJxiVOZnLPzJnhA8yc<KEY>2r2<KEY>2<KEY>i<KEY>i<KEY>VtR6eF/P0qn02kYhqElhvHSVmtHXrz55sYy429P1Gtxojoa/QXR2JyhwIY0BdanKrA+RYk1QSVWJSqxMqBEk0cNN228zRHSzdN0XgzHxVmtVhMVSb2/K8xkiqKitFqtVhAEgbWxWfGi5fL2WhteWWrGmXA0rs7TYV+xHGuTFVibrMC6ZAU2pimwNUuBnbly7Mi<KEY>
"locaText": {
"polish": "Plantacja kakaowców",
"english": "Cocoa Plantation",
"taiwanese": "可可園",
"brazilian": "Cocoa Plantation",
"russian": "Плантация какао",
"chinese": "可可园",
"portuguese": "Cocoa Plantation",
"french": "Plantation de cacao",
"korean": "코코아 농장",
"japanese": "ココア農園",
"italian": "Piantagione di cacao",
"german": "Kakaoplantage",
"spanish": "Plantación de cacao"
}
},
{
"name": "<NAME>antation",
"guid": 1010333,
"tpmin": 1,
"outputs": [
{
"Product": 1010255,
"Amount": 1,
"StorageAmount": 2
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 25,
"InactiveAmount": 13
},
{
"Product": 1010366,
"Amount": 10
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAU1klEQVRogdWad1SUZ9rGXzWJ2WRjYXGGefs7Q4ehDzA0KdKbCIjBBoiiggU1xoYoGiyxxGgEe4sk9gIi2ChiAVRs0d1NBBWjKFIGhqGZXN8fM7LJt99ucJPs7ned85zzzjnzx/s7133fz/3ez0MQv6/66Nb/G/UhCKIvQRD9CIJ4myCI/rr1rm71JwjiHYIg3tL9p+9/5jX/ufoRBNGf5/lBIpFILJVKWVbMSqVSqTEn4cx4kjeV0rQRJ+YEmqYpkiT19fX1PyC0gG8TWqj/mGt9XgNQH1B/ktK0ESMmw0iRQbqztcmXIUNtLy<KEY>",
"locaText": {
"polish": "Plantacja kauczuku",
"english": "Caoutchouc Plantation",
"taiwanese": "橡膠園",
"brazilian": "Caoutchouc Plantation",
"russian": "Плантация каучука",
"chinese": "橡胶园",
"portuguese": "Caoutchouc Plantation",
"french": "Plantation de latex",
"korean": "생고무 농장",
"japanese": "天然ゴム農園",
"italian": "Piantagione di caucciù",
"german": "Kautschuckplantage",
"spanish": "Plantación de caucho"
}
},
{
"name": "agriculture_colony01_06 (<NAME>)",
"guid": 101260,
"tpmin": 4,
"outputs": [
{
"Product": 120008,
"Amount": 1,
"StorageAmount": 8
}
],
"inputs": [],
"maintenances": [
{
"Product": 1010017,
"Amount": 10,
"InactiveAmount": 5,
"VectorElement": null
},
{
"Product": 1010366,
"Amount": 10,
"ShutdownThreshold": 0.2,
"VectorElement": null
}
],
"region": 5000001,
"locaText": {
"polish": "Chata drwala",
"english": "Lumberjack's Hut",
"taiwanese": "伐木工人棚屋",
"brazilian": "Lumberjack's Hut",
"russian": "Хижина лесоруба",
"chinese": "伐木工人棚屋",
"portuguese": "Lumberjack's Hut",
"french": "Cabane de bûcheron",
"korean": "벌목꾼의 오두막",
"japanese": "木こりの小屋",
"italian": "Capanno del taglialegna",
"german": "Holzfällerhütte",
"spanish": "Cabaña de leñador"
}
},
{
"name": "Coffee Plantation",
"guid": 101251,
"tpmin": 1,
"outputs": [
{
"Product": 120031,
"Amount": 1,
"StorageAmount": 2
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 25,
"InactiveAmount": 13
},
{
"Product": 1010366,
"Amount": 10
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYn0lEQVRoge2aZ3xVVdr2d3KSnJy+91prn5OT3ntCOklIgxSSQBISCRB6kV4DSO+C9I6ANBFUBiwMw6COis6IOhawoWLFNo7jq45tnhFF/b8fiPOo4zvleWae9/3wXr/f/nLOPnuv69zlutd9L037//i7CNA0LVDTtCBN04I1TbNqmmbTNM3xvcve9Zm16x5L12/+ryNAu7KYYE3T7IZheFwul1JKheu6HuPzeOJNtztJKZWslEo23e5Ej8cTJ4SIMh2OMLfbLZR<KEY>6fQqpcKVUn6Xy6XMK2obov0/Yo3/DRrwmbs2oH9AAAAAAElFTkSuQmCC",
"locaText": {
"polish": "Plantacja kawy",
"english": "Coffee Plantation",
"taiwanese": "咖啡園",
"brazilian": "Coffee Plantation",
"russian": "Кофейная плантация",
"chinese": "咖啡园",
"portuguese": "Coffee Plantation",
"french": "Plantation de café",
"korean": "커피 농장",
"japanese": "コーヒー農園",
"italian": "Piantagione di caffè",
"german": "Kaffeeplantage",
"spanish": "Plantación de café"
}
},
{
"name": "<NAME>",
"guid": 101263,
"tpmin": 2,
"outputs": [
{
"Product": 120041,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"VectorElement": {
"InheritanceMapV2": {
"Entry": {
"TemplateName": "FactoryBuilding7",
"Index": 0
}
}
},
"Product": 1010017,
"Amount": 5,
"InactiveAmount": 3
},
{
"VectorElement": {
"InheritanceMapV2": {
"Entry": {
"TemplateName": "FactoryBuilding7",
"Index": 1
}
}
},
"Product": 1010366,
"Amount": 10
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAX8UlEQVRogc2ad3SVVfrvX9CUU9+y<KEY>",
"locaText": {
"polish": "Plantacja bananów",
"english": "Plantain Plantation",
"taiwanese": "大蕉園",
"brazilian": "Banana Plantation",
"russian": "Банановая плантация",
"chinese": "大蕉园",
"portuguese": "Banana Plantation",
"french": "Plantation de bananes",
"korean": "플랜테인 농장",
"japanese": "バナナ農園",
"italian": "Piantagione di banane",
"german": "Bananenplantage",
"spanish": "Plantación de plátanos"
}
},
{
"name": "agriculture_colony01_09 (Cattle Farm)",
"guid": 101269,
"tpmin": 1,
"outputs": [
{
"Product": 1010193,
"Amount": 1,
"StorageAmount": 2,
"VectorElement": null
}
],
"inputs": [],
"maintenances": [
{
"Product": 1010017,
"Amount": 25,
"InactiveAmount": 13,
"VectorElement": null
},
{
"Product": 1010366,
"Amount": 20,
"VectorElement": null
}
],
"region": 5000001,
"locaText": {
"polish": "Farma bydła",
"english": "Cattle Farm",
"taiwanese": "牛牧場",
"brazilian": "Cattle Farm",
"russian": "Скотоферма",
"chinese": "牛牧场",
"portuguese": "Cattle Farm",
"french": "Élevage de gros bétail",
"korean": "가축 농장",
"japanese": "牛牧場",
"italian": "Allevamento di bestiame",
"german": "Rinderfarm",
"spanish": "Granja vacuna"
}
},
{
"name": "<NAME>",
"guid": 101270,
"tpmin": 1,
"outputs": [
{
"Product": 120034,
"Amount": 1,
"StorageAmount": 2
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 25,
"InactiveAmount": 13
},
{
"Product": 1010366,
"Amount": 10
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYjElEQVRogdV6d3hTV7b9pWNZuveec+6V5Cr3LluWXMHduBe5444bGBcMLoCNDdiAgdBMx3RCCZ0QJiGQEELCMBlmUkhhJi/MBJJMKpAGgQkYr/cHYlImgbxffW9/3/n0WdL1OWtr7b3PXudw3P89G/Kj8T/ShnAcN5TjuOEcx42wvA7l/gcCGsZx3CiO46w5jhsty7LS8vew/6+r+l+w0aIoilqJpOUUBoPjuNGEEIHjuJH/LyZ/QIcRlglHcj/QYhj327k+RJIkFbWystdo5KpNB2ohKFW9kkJhY8txikfMPdQy1/AfjWHcf4GWQywPKVUqlcQYsy<KEY>
"locaText": {
"polish": "Plantacja kukurydzy",
"english": "Corn Farm",
"taiwanese": "玉米農場",
"brazilian": "Corn Farm",
"russian": "Кукурузная ферма",
"chinese": "玉米农场",
"portuguese": "Corn Farm",
"french": "Exploitation de maïs",
"korean": "옥수수 농장",
"japanese": "トウモロコシ農場",
"italian": "Fattoria di mais",
"german": "Maisplantage",
"spanish": "Granja de maíz"
}
},
{
"name": "<NAME>",
"guid": 101272,
"tpmin": 2,
"outputs": [
{
"Product": 120036,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 5,
"InactiveAmount": 3
},
{
"Product": 1010366,
"Amount": 10
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAcBUlEQVRogc2ad1RW57buV5KdnYT2lbXWhyYxprhjjBqV9iFdeoePDtJ7E5DeEURQARFQLKigoGDBggUTuya22HuKxsSYYk0x3eR3/xBzcva9Y9x97z3nnjPHWP+9Y435vHO+75zvfB5B+I+3JwVBeEoQhGcEQdBXqVQKhUKhUigUKpVKpRAE4TlBEJ4eWvff1p4SBOEZlUql0NPTG65QKF5TqVTjZKVykqxUThQNDMao1eoRRkZGakEQnh1a/8R/rcuPHHhC+LcIPC0Igp6BgYFsZGT0D7VabSmpVF4aUbyjkaS7E8e9yXBj43uSUumgUqnGqdXqFxUKhUoWBAPhUZSeGfrP/7dIPSkIwt+ERztqoBQEpaGhoaivrz9MoVC8KikUphpJKihN86ctP5gr6ys42lfNBwM1nBhYjM7DEVkUV<KEY>//<KEY>",
"locaText": {
"polish": "Farma alpak",
"english": "Alpaca Farm",
"taiwanese": "羊駝牧場",
"brazilian": "Alpaca Farm",
"russian": "Ферма альпака",
"chinese": "羊驼牧场",
"portuguese": "Alpaca Farm",
"french": "Élevage d'alpagas",
"korean": "알파카 농장",
"japanese": "アルパカ牧場",
"italian": "Fattoria di alpaca",
"german": "Alpakafarm",
"spanish": "Granja de alpacas"
}
},
{
"name": "<NAME>",
"guid": 1010339,
"tpmin": 0.6666666666666667,
"outputs": [
{
"Product": 1010256,
"Amount": 1,
"StorageAmount": 1
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 25,
"InactiveAmount": 13
},
{
"Product": 1010366,
"Amount": 50
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAVWElEQVRoge1aaVRb55m+OHb22DEFJN1dwo2dpVnquHaWjrPHadJOkrZJ2zSZJk3qNGsdO47t2I7BCwaMWQwYEEisYhESSEKAEIhFiEVISAKxGWR2AzZmM9jG2DzzAzqTyaSO26aT/JjnnO/cc+6555773Pf93uV5P4L4f3zr8CIIYglBEEu/tK5bvPe9x18//gYfH5/bSJL0oWmaWkVRNE3TlFAo9F25cuUKgiBuIBZIfS/hRRDEDeyKFStZlpXwNL1RJBDsuvf++6U/Wf9QEi<KEY>jfQNL2KoqgfEAuEvlcWWkLT9E0k<KEY>0DjaIHK6kKOxY433vsYNEl/wdP0RpIkWYFAcAvxPSHjtUiCXSWRHK202TB8bgq2Tg8qXa2oau5AqbMV2loHVKU1yC6sQqrRgsee+dkJMcn+nKbpVSRJ3kx8x2S8CIK4gSRJRsJLwhsGBtHaN4AGmxP9A6cwNnIafUMjcA8MobC7H8o2D7IsDmSoSpGmLMXa9Q+fldD0yyKRiCMI4qbF9<KEY>AAAABJRU5ErkJggg==",
"locaText": {
"polish": "Hodowla perłopławów",
"english": "Pearl Farm",
"taiwanese": "珍珠養殖場",
"brazilian": "Pearl Farm",
"russian": "Жемчужная ферма",
"chinese": "珍珠养殖场",
"portuguese": "Pearl Farm",
"french": "Ferme perlière",
"korean": "진주 양식장",
"japanese": "真珠養殖場",
"italian": "Allevamento di perle",
"german": "Perlenfarm",
"spanish": "Cultivo de perlas"
}
},
{
"name": "Fish Oil Factory",
"guid": 101262,
"tpmin": 2,
"outputs": [
{
"Product": 120042,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"VectorElement": {
"InheritanceMapV2": {
"Entry": {
"TemplateName": "FarmBuilding",
"Index": 0
}
}
},
"Product": 1010017,
"Amount": 5,
"InactiveAmount": 3
},
{
"VectorElement": {
"InheritanceMapV2": {
"Entry": {
"TemplateName": "FarmBuilding",
"Index": 1
}
}
},
"Product": 1010366,
"Amount": 15
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYh0lEQVRogcWad3CV17X2XxMb67S37fc9qqiAJIR6lygS6l0gCRXUKyqAQE<KEY>",
"locaText": {
"polish": "<NAME>",
"english": "Fish Oil Factory",
"taiwanese": "魚油工廠",
"brazilian": "Fish Oil Factory",
"russian": "Фабрика рыбьего жира",
"chinese": "鱼油工厂",
"portuguese": "Fish Oil Factory",
"french": "Fabrique d'huile de poisson",
"korean": "어유 공장",
"japanese": "漁油工場",
"italian": "Fabbrica olio di pesce",
"german": "Fischölfabrik",
"spanish": "Fábrica de aceite de pescado"
}
},
{
"name": "coastal_colony01_02 (Niter Coast Building)",
"guid": 101303,
"tpmin": 0.5,
"outputs": [
{
"Product": 1010232,
"Amount": 1,
"StorageAmount": 1
}
],
"inputs": [],
"maintenances": [
{
"Product": 1010017,
"Amount": 250,
"InactiveAmount": 125,
"VectorElement": null
},
{
"Product": 1010367,
"Amount": 125,
"VectorElement": null
}
],
"region": 5000001,
"locaText": {
"polish": "Wytwórnia saletry",
"english": "Saltpetre Works",
"taiwanese": "硝石採石場",
"brazilian": "Saltpetre Works",
"russian": "Фабрика селитры",
"chinese": "硝石采石场",
"portuguese": "Saltpetre Works",
"french": "Salpêtrière",
"korean": "초석 작업장",
"japanese": "硝石の採石場",
"italian": "Salina",
"german": "Salpeterwerk",
"spanish": "Taller de salitre"
}
},
{
"name": "factory_colony01_01 (Timber Factory)",
"guid": 101261,
"tpmin": 4,
"outputs": [
{
"Product": 1010196,
"Amount": 1,
"StorageAmount": 8
}
],
"inputs": [
{
"Product": 120008,
"Amount": 1,
"StorageAmount": 8
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 10,
"InactiveAmount": 5,
"VectorElement": null
},
{
"Product": 1010366,
"Amount": 20,
"VectorElement": null
}
],
"region": 5000001,
"locaText": {
"polish": "Tartak",
"english": "Sawmill",
"taiwanese": "鋸木廠",
"brazilian": "Sawmill",
"russian": "Лесопилка",
"chinese": "锯木厂",
"portuguese": "Sawmill",
"french": "Scierie",
"korean": "제재소",
"japanese": "製材所",
"italian": "Segheria",
"german": "Sägewerk",
"spanish": "Serrería"
}
},
{
"name": "factory_colony01_02 (Sailcloth Factory)",
"guid": 101265,
"tpmin": 2,
"outputs": [
{
"Product": 1010210,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010240,
"Amount": 1,
"StorageAmount": 6,
"VectorElement": null
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 15,
"InactiveAmount": 8,
"VectorElement": null
},
{
"Product": 1010366,
"Amount": 20,
"VectorElement": null
}
],
"region": 5000001,
"locaText": {
"polish": "Warsztat żaglomistrza",
"english": "Sailmakers",
"taiwanese": "船帆製造廠",
"brazilian": "Sailmakers",
"russian": "Парусная фабрика",
"chinese": "船帆制造厂",
"portuguese": "Sailmakers",
"french": "Voilerie",
"korean": "돛 제작소",
"japanese": "帆布工場",
"italian": "Velai",
"german": "Segelweberei",
"spanish": "Fabricante de velas"
}
},
{
"name": "<NAME>",
"guid": 1010318,
"tpmin": 2,
"outputs": [
{
"Product": 1010240,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010253,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 10,
"InactiveAmount": 5
},
{
"Product": 1010366,
"Amount": 10
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAW8ElEQVRoge2aZ3RbVbbHbwoTAkziOFEk61bJnoQUHszQGQYCvEDoDCTwKBPIgwADIcVxirvl3uNe4pa4xL3IlizZsizJcou7497tuMiWLJeQngz/98EmA0PCm/kww7y13l7raN0lraV1fnef/977nH0I4pezJQRBLF0cy37wvOQXnNM/ZEsJgriLIIh71qxZs5patcqS/DW5llq1ynLNmjWrCYK4Z/H3pb/oLH/GlhAEsdzS0nIVRVEkzae3siz7pDXJPv8bhtluzbLPsyT7pDVNb6XWUqSlpeUqYgHo38pDy4RC4T07tm3jfvvA5pdfeXWHKjAqCpWdPWibnIauz4SC8ibYO3nhuWdeaKVJ8s8URT1OrV1LEgse+rfwzhI+n3/vN1989GBZWXrFhHEEw7NGdE5No33SjKrhOWh6TJBXtSO7oBypyQWICkuGlUDQyNH0SyyfFfEJ4l7iF4ZZQhHESoZhxLs/+q/iK9cv4MJVMwbNCyAtE2boBuZQ1jaOIm0zcqTlSE2RIibyDAJ94vG7hx7p42j6TXr<KEY>
"locaText": {
"polish": "Przędzalnia bawełny",
"english": "Cotton Mill",
"taiwanese": "棉紡織廠",
"brazilian": "Cotton Mill",
"russian": "Хлопкопрядильная фабрика",
"chinese": "棉纺织厂",
"portuguese": "Cotton Mill",
"french": "Filature de coton",
"korean": "방적 공장",
"japanese": "紡績工場",
"italian": "Cotonificio",
"german": "Baumwollweberei",
"spanish": "Molino de algodón"
}
},
{
"name": "factory_colony01_04 (Clay Pit)",
"guid": 101267,
"tpmin": 2,
"outputs": [
{
"Product": 1010201,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [],
"maintenances": [
{
"Product": 1010017,
"Amount": 10,
"InactiveAmount": 5,
"VectorElement": null
},
{
"Product": 1010367,
"Amount": 100,
"VectorElement": null
}
],
"region": 5000001,
"locaText": {
"polish": "Wyrobisko gliny",
"english": "Clay Pit",
"taiwanese": "陶土礦場",
"brazilian": "Clay Pit",
"russian": "Глиняный карьер",
"chinese": "陶土矿场",
"portuguese": "Clay Pit",
"french": "Carrière d'argile",
"korean": "점토 채취장",
"japanese": "粘土穴",
"italian": "Cava di argilla",
"german": "Lehmgrube",
"spanish": "Cantera de arcilla"
}
},
{
"name": "factory_colony01_05 (Brick Factory)",
"guid": 101268,
"tpmin": 1,
"outputs": [
{
"Product": 1010205,
"Amount": 1,
"StorageAmount": 2
}
],
"inputs": [
{
"Product": 1010201,
"Amount": 1,
"StorageAmount": 4
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 20,
"InactiveAmount": 10,
"VectorElement": null
},
{
"Product": 1010367,
"Amount": 50,
"VectorElement": null
}
],
"region": 5000001,
"locaText": {
"polish": "Cegielnia",
"english": "Brick Factory",
"taiwanese": "磚塊工廠",
"brazilian": "Brick Factory",
"russian": "Кирпичный завод",
"chinese": "砖块工厂",
"portuguese": "Brick Factory",
"french": "Briqueterie",
"korean": "벽돌 공장",
"japanese": "レンガ工場",
"italian": "Fabbrica di mattoni",
"german": "Ziegelei",
"spanish": "Fábrica de ladrillos"
}
},
{
"name": "<NAME>",
"guid": 101415,
"tpmin": 2,
"outputs": [
{
"Product": 120044,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 120036,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 10,
"InactiveAmount": 5
},
{
"Product": 1010366,
"Amount": 10
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAY8klEQVRogdWaeVS<KEY>
"locaText": {
"polish": "Wytwórca filcu",
"english": "Felt Producer",
"taiwanese": "毛氈製造廠",
"brazilian": "Felt Producer",
"russian": "Войлочная фабрика",
"chinese": "毛毡制造厂",
"portuguese": "Felt Producer",
"french": "Producteur de feutre",
"korean": "펠트 공장",
"japanese": "フェルト生産所",
"italian": "Produttore di feltro",
"german": "Filzfabrik",
"spanish": "Productor de fieltro"
}
},
{
"name": "<NAME>",
"guid": 101273,
"tpmin": 2,
"outputs": [
{
"Product": 120037,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010240,
"Amount": 1,
"StorageAmount": 6
},
{
"Product": 120044,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 50,
"InactiveAmount": 25
},
{
"Product": 1010367,
"Amount": 20
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAT+0lEQVRoge2aeVCUd5rH32Qmm8MGmks6xhhIvBq5GqGhuYQXuhuau6GB5obmUG5RQUAFheABqEREURAv0KDGI5Jo4pWYoIl3UDQzo8ZkJuaaJJXNjFszs/3ZP9p1NjO1u1MbZ3arNt+qp95/ut76ffp5fs/x+72C8JN+0k/6R+kRQRB+JgjCU7a2tjYSicRRIpGMl0gk462srOytra3t7Oz<KEY>//aR/80F/0c9IgjCPwmC8JSjo6NMZm3d5OwkPZEcMYPSTJHS9CBKjSpyEpToIzzMKs/n/ujnPfmmk5PTUSdr67WOjrZBDg5WU8ePG+8kCILk/rt+9o8GeMLKyspeZm9dOn3aCwy2Z/D1+Xp++/ZCfvv2Qj59Yy53hyv46mgVnx4u4fbLJu7sKu<KEY>",
"locaText": {
"polish": "Wytwórca kapeluszy",
"english": "Bombín Weaver",
"taiwanese": "圓頂硬禮帽編織廠",
"brazilian": "Bombín Weaver",
"russian": "Фабрика котелков",
"chinese": "圆顶硬礼帽编织厂",
"portuguese": "Bombín Weaver",
"french": "Fabricant de chapeaux melon",
"korean": "봄빈 직조소",
"japanese": "ボンビンハット職人",
"italian": "Produttore di bombette",
"german": "Hutmacherei",
"spanish": "<NAME>"
}
},
{
"name": "<NAME>",
"guid": 1010340,
"tpmin": 2,
"outputs": [
{
"Product": 1010257,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 120008,
"Amount": 1,
"StorageAmount": 8
},
{
"Product": 1010251,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 50,
"InactiveAmount": 25
},
{
"Product": 1010366,
"Amount": 30
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAXEklEQVRoge2aeXCc93nfX5KyLEuUcBCLxb77HnvhxmIXuwvsfQNYYHHfx+K+dnEDPEQQF0+Dp0iKpEiJkihLlW1ZkhU7lq2xHddunNitndqJM+m0aZyr8dRxasdJ2ridNP70D0COJzMR6SNN/+h35p2deWf3nd9nn+N9fs/zE4T/r/tqnyAI+wVBeGjvet/e54G9+/v2rv/n9NMLf39eXt7jer3+kCzLolkUZaPOqJpEUTFoNAV6vf5QXl7e45IkfUAQhPcL/wD4Lwb27sIf0Wg0B/V6/SF<KEY>
"locaText": {
"polish": "Destylarnia rumu",
"english": "Rum Distillery",
"taiwanese": "蘭姆酒工廠",
"brazilian": "Rum Distillery",
"russian": "Фабрика рома",
"chinese": "兰姆酒工厂",
"portuguese": "Rum Distillery",
"french": "Rhumerie",
"korean": "럼주 양조장",
"japanese": "ラム酒蒸留所",
"italian": "Distilleria di rum",
"german": "Rumbrennerei",
"spanish": "Destilería de ron"
}
},
{
"name": "Chocolate Factory",
"guid": 1010341,
"tpmin": 2,
"outputs": [
{
"Product": 1010258,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010254,
"Amount": 1,
"StorageAmount": 6
},
{
"Product": 1010239,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 50,
"InactiveAmount": 25
},
{
"Product": 1010367,
"Amount": 100
}
],
"region": 5000001,
"icon": "data:image/png;base64,i<KEY>NB<KEY>
"locaText": {
"polish": "<NAME>",
"english": "Chocolate Factory",
"taiwanese": "巧克力工廠",
"brazilian": "Chocolate Factory",
"russian": "Шоколадная фабрика",
"chinese": "巧克力工厂",
"portuguese": "Chocolate Factory",
"french": "Chocolaterie",
"korean": "초콜릿 공장",
"japanese": "チョコレート工場",
"italian": "Fabbrica di cioccolato",
"german": "Schokoladenfabrik",
"spanish": "Fábrica de chocolate"
}
},
{
"name": "Coffee Roaster",
"guid": 101252,
"tpmin": 2,
"outputs": [
{
"Product": 120032,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 120031,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 150,
"InactiveAmount": 75
},
{
"Product": 1010367,
"Amount": 150
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAXtElEQVRoge2ad1RU6Zb2j1mg0glVoIgKhlYUMNCKOeeAiiiCCAYQRbKIREmiKCi2iqEVMGftVttsKza2ObSiKAYMCIpIEEPH+5s/oG/313PnznfnhllrZp619qpatWrVOc+7937ODiUI/4f/2aglCELtGqv7B/v181r/bXf3V/DrjdcTBKGhIAgmgiBo1Wq1rFKpDCYmJqYmJiamKpXKoFarZUEQtDXfaSD8Ru6/ldivJ95QFEWtSqUyiKLYVFGrW4uiaKMoSmdJkhwMotjDIIo9JElyUBSlsyiKNnqNppUkSRYqlUovSZJGqD6Auv9qQrVqLmqk0WgkURSbSpLUTpKkbpIkDVIUxU<KEY>quo<KEY>
"locaText": {
"polish": "Palarnia kawy",
"english": "Coffee Roaster",
"taiwanese": "咖啡烘焙廠",
"brazilian": "Coffee Roaster",
"russian": "Фабрика обжарки кофе",
"chinese": "咖啡烘焙厂",
"portuguese": "Coffee Roaster",
"french": "Brûlerie de café",
"korean": "커피 제조소",
"japanese": "コーヒー焙煎場",
"italian": "Torrefazione",
"german": "Kaffeerösterei",
"spanish": "Tostador de café"
}
},
{
"name": "<NAME>",
"guid": 101264,
"tpmin": 2,
"outputs": [
{
"Product": 120033,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 120042,
"Amount": 1,
"StorageAmount": 6
},
{
"Product": 120041,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 15,
"InactiveAmount": 8
},
{
"Product": 1010366,
"Amount": 25
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAZDElEQVRoge2ad3SU19Wvz4xG0mjqW2dGXUhCXUINCUmgLgGSML0I0UFYoghZNNGLhOgSMpjeTMdg022MbWzAjrENGOOGHQx2CIlxQhLbsePvu99dz/0Dkdj5bnKzVtbNLevba50/ZmbNe87z/vbZp+wtxH/Zf9n/E2YQQhiFEF4/ao8+m4QQPkIIsxDCTwjh2/GdseN//8ft0eC9hRAWWZaddrtdtdvtqtPplGVZdkqSJNntdk3TtABJkkIlSQrVLJYAh8OhCCEs4iHQvwzGIH76xk0dzSdACIvdbldlWQ7xKEq8pmlpmqal67qe4pblRLcsJ6qq2lVX1V0uVX3WparP6pp2WJblBE3TAjQh7B0v4lEff6+/Ryr/Q+CPHmASD13ATwhhk2XZ6XA4FJvN5rJarR6LxeKvqmqg0+kM1yUpWZ<KEY>
"locaText": {
"polish": "Kuchnia pieczonych bananów",
"english": "Fried Plantain Kitchen",
"taiwanese": "炸大蕉餅店",
"brazilian": "Fried Banana Kitchen",
"russian": "Кухня для поджарки бананов",
"chinese": "炸大蕉饼店",
"portuguese": "Fried Plantain Kitchen",
"french": "Cuisine de plantains frits",
"korean": "플랜테인 튀김 주방",
"japanese": "フライドバナナキッチン",
"italian": "Cucina banane fritte",
"german": "Küche",
"spanish": "Freiduría de plátano"
}
},
{
"name": "<NAME>",
"guid": 101271,
"tpmin": 2,
"outputs": [
{
"Product": 120035,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010193,
"Amount": 1,
"StorageAmount": 6
},
{
"Product": 120034,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 100,
"InactiveAmount": 50
},
{
"Product": 1010367,
"Amount": 100
}
],
"region": 5000001,
"icon": "data:image/png;<KEY>
"locaText": {
"polish": "Wytwórca tortilli",
"english": "Tortilla Maker",
"taiwanese": "製玉米餅店",
"brazilian": "Burrito Maker",
"russian": "Печь для тортильи",
"chinese": "制玉米饼店",
"portuguese": "Tortilla Maker",
"french": "Fabricant de tortillas",
"korean": "토르티야 가게",
"japanese": "トルティーヤ製造会社",
"italian": "Produttore di tortillas",
"german": "Tortilla-Bäckerei",
"spanish": "Máquina tortilladora"
}
},
{
"name": "heavy_colony01_01 (Oil Heavy Industry)",
"guid": 1010561,
"tpmin": 4,
"outputs": [
{
"Product": 1010566,
"Amount": 1,
"StorageAmount": 200
}
],
"inputs": [],
"maintenances": [
{
"Product": 1010017,
"Amount": 250,
"InactiveAmount": 125,
"VectorElement": null
},
{
"Product": 1010367,
"Amount": 75,
"VectorElement": null
}
],
"region": 5000001,
"locaText": {
"polish": "Rafineria",
"english": "Oil Refinery",
"taiwanese": "煉油廠",
"brazilian": "Oil Refinery",
"russian": "Нефтяной завод",
"chinese": "炼油厂",
"portuguese": "Oil Refinery",
"french": "Raffinerie de pétrole",
"korean": "정유 공장",
"japanese": "石油精製所",
"italian": "Raffineria petrolifera",
"german": "Ölraffinerie",
"spanish": "Refinería de petróleo"
}
},
{
"name": "mining_colony01_01 (Gold Ore Mine)",
"guid": 101311,
"tpmin": 0.4,
"outputs": [
{
"Product": 1010233,
"Amount": 1,
"StorageAmount": 1
}
],
"inputs": [],
"maintenances": [
{
"Product": 1010017,
"Amount": 250,
"InactiveAmount": 125,
"VectorElement": null
},
{
"Product": 1010367,
"Amount": 100,
"VectorElement": null
}
],
"region": 5000001,
"locaText": {
"polish": "Kopalnia złota",
"english": "Gold Mine",
"taiwanese": "金礦",
"brazilian": "Gold Mine",
"russian": "Золотая шахта",
"chinese": "金矿",
"portuguese": "Gold Mine",
"french": "Mine d'or",
"korean": "금광",
"japanese": "金鉱",
"italian": "Miniera d'oro",
"german": "Goldmine",
"spanish": "Mina de oro"
}
},
{
"name": "Sugar Refinery",
"guid": 1010317,
"tpmin": 2,
"outputs": [
{
"Product": 1010239,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 1010251,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 10,
"InactiveAmount": 5
},
{
"Product": 1010367,
"Amount": 50
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAATvklEQVRogc1aaVCU17b9RBNvNOEiAbr7m7tBELqbqWmgmYVmHkQEQXFE44AScZ6vE4maRFFQFBWvig/ngUYEHBAEBDQIMsisiCAKzkavMbl3vR9NfNat1KuKYiqrav/4qruqv9Vr7bP32ecQxPuhP0EQnxAEMZAgiE97n/sa/XrjT0Ff/lg/QvuHfEoQxCCBQDBYIBAMJgjib4T2T9Ppo9/5qNDhef5vtK6uPi/keZZlpSYcZ8NTlLWYJM0YhiENDAy+IAhiAPEnqvRHoWNoaPg5y7ISlibjvooKupWyNhbJ/5iKlTNHwd/FupUWieYwDGMnNhILCK1Cfzky/QQCwWBjmjYx4dmm+otpqMrehrxdi5G6PBo7F4/GxhkBWBHtAZHA8BJLki48zwsJrf3+UviUoijaWmaWXnthD6rO7kDRwdVIXRqFvStGY+N0Pywf64b4kY74ytcGLCnaJaZpe16P1yP+Q<KEY>
"locaText": {
"polish": "Cukrownia",
"english": "Sugar Refinery",
"taiwanese": "製糖廠",
"brazilian": "Sugar Refinery",
"russian": "Сахарный завод",
"chinese": "制糖厂",
"portuguese": "Sugar Refinery",
"french": "Raffinerie de sucre",
"korean": "제당소",
"japanese": "砂糖精製工場",
"italian": "Raffineria di zucchero",
"german": "Zuckerraffinerie",
"spanish": "Refinería de azúcar"
}
},
{
"name": "<NAME>",
"guid": 101266,
"tpmin": 2,
"outputs": [
{
"Product": 120043,
"Amount": 1,
"StorageAmount": 4
}
],
"inputs": [
{
"Product": 120036,
"Amount": 1,
"StorageAmount": 6
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 15,
"InactiveAmount": 8
},
{
"Product": 1010366,
"Amount": 30
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAZYUlEQVRogcWad3hVBdavN6iE08+u5yTnJKftc04IhAQQEqo0ASnSpEhRLPRe0hMSSgKBJISETuglCaGF3kF6ERBRBBXFMjMyIzN+fjOO44y+9w/ivd75vrl3+reeZ/+7n+fda+1VfmsJwj9u9QRBeFIQBKPNZhMVRYlSrVbdIYrxsiy31CSpjSaKbSVJSlZVNVFRlJAkSW6r1SpFCYJREISnBEGoX/ee/zF7QhCECLsg2CVJihZFMV612zuosjxRU5SSpuEmPNexO4OfH0S3dl2JVNUKVZanKIrSSbXbm9lsNp/FYlGEx0BP/k/A1KuDMDrMZk2W5VhFUZ7RZPnLF7sP5LOPP+LrLz7n+rk3KC5cRFZaJmNHj2f7uvX87MMP6N2++w+aLD/SJKm7YrM1d9rtXqvVKgmCYPh3AtUXBOEpSZKskiS5FZutuaIor7dJbMnZQ8coyJtDcqt2dH6mK/37vcCk8ZOYNXMmkyZOZtCAISS1bEOPbr147+YtenXrhaYoWzVJ6qbZ7QmiKMbY7Xa7IAgN6z7UvwzoCUEQDFarVVJVVVdFsZ0<KEY>
"locaText": {
"polish": "Wytwórca poncz",
"english": "<NAME>",
"taiwanese": "斗篷縫補廠",
"brazilian": "<NAME>",
"russian": "Фабрика пончо",
"chinese": "斗篷缝补厂",
"portuguese": "<NAME>",
"french": "Fabricant de ponchos",
"korean": "판초 제작소",
"japanese": "ポンチョ修繕場",
"italian": "Rammendatore di poncho",
"german": "Ponchoweberei",
"spanish": "Tejedor de ponchos"
}
},
{
"name": "processing_colony01_03 (Inlay Processing)",
"guid": 101296,
"tpmin": 1,
"outputs": [
{
"Product": 1010242,
"Amount": 1,
"StorageAmount": 2
}
],
"inputs": [
{
"Product": 120008,
"Amount": 1,
"StorageAmount": 8
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 100,
"InactiveAmount": 50,
"VectorElement": null
},
{
"Product": 1010367,
"Amount": 100,
"VectorElement": null
}
],
"region": 5000001,
"locaText": {
"polish": "Zakład snycerski",
"english": "Marquetry Workshop",
"taiwanese": "鑲嵌工作坊",
"brazilian": "Marquetry Workshop",
"russian": "Деревообрабатывающий завод",
"chinese": "镶嵌工作坊",
"portuguese": "Marquetry Workshop",
"french": "Atelier de marqueterie",
"korean": "고급 가구 제작소",
"japanese": "寄せ木工房",
"italian": "Laboratorio di intarsi",
"german": "Kunstschreinerei",
"spanish": "Taller de marquetería"
}
},
{
"name": "<NAME>",
"guid": 1010342,
"tpmin": 2,
"outputs": [
{
"Product": 1010259,
"Amount": 1,
"StorageAmount": 2
}
],
"inputs": [
{
"Product": 1010252,
"Amount": 1,
"StorageAmount": 3
},
{
"Product": 1010242,
"Amount": 1,
"StorageAmount": 3
}
],
"maintenances": [
{
"Product": 1010017,
"Amount": 250,
"InactiveAmount": 125
},
{
"Product": 1010367,
"Amount": 175
}
],
"region": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAASa0lEQVRoge2ZaVCVV5qAb3rJakfZLnD57sLdWC7bZZF9uwqKICD7jiDIJovIJooEEHFDQBFFQEHFPa4Rjai4QBSXmMR9TUzS3enp6Z6eqXRNT5KeZ36YTvV0T02NhulM1fRTdX59VV+9z3fec973O0ck+jv/z7DRKLNykiN+Y2Zisl88ZYrzDx3Pf8dL346/QmxsPOPS4Q4+PNzMZ1d3cX9kM6OHOli7rIDc1Igxdyf7WrGxsc/fON7/xEsikegnIpHoVTMzs0nm5uZviESil0Ui0Y+/fSYShDeN39m+kr4CA2eWx/CLG3<KEY>=",
"locaText": {
"polish": "Fabryka cygar",
"english": "Cigar Factory",
"taiwanese": "雪茄工廠",
"brazilian": "Cigar Factory",
"russian": "Фабрика сигар",
"chinese": "雪茄工厂",
"portuguese": "Cigar Factory",
"french": "Usine de cigares",
"korean": "시가 공장",
"japanese": "葉巻工場",
"italian": "Fabbrica di sigari",
"german": "Zigarren-Manufaktur",
"spanish": "Fábrica de puros"
}
}
],
"populationLevels": [
{
"name": "Farmers",
"guid": 15000000,
"workforce": 1010052,
"fullHouse": 10,
"order": 1,
"needs": [
{
"tpmin": null,
"guid": 120020
},
{
"tpmin": 0.0025000002,
"guid": 1010200
},
{
"tpmin": 0.0033333333,
"guid": 1010216,
"happiness": 8
},
{
"tpmin": 0.003076926,
"guid": 1010237
},
{
"tpmin": null,
"guid": 1010349,
"happiness": 12
}
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAU/0lEQVRogc1aaVhUV5o+Gk0Uqqh7zzn3FkUVUOw7siOb7HsBAoIsIoqCIgqCsgkCKojgBq7tgsoSFOMSdw3uGxr3LX<KEY>
"locaText": {
"polish": "Farmerzy",
"english": "Farmers",
"taiwanese": "農夫",
"brazilian": "Farmers",
"russian": "Фермеры",
"chinese": "农夫",
"portuguese": "Farmers",
"french": "Fermiers",
"korean": "농부",
"japanese": "農家",
"italian": "Contadini",
"german": "Bauern",
"spanish": "Granjeros"
}
},
{
"name": "Workers",
"guid": 15000001,
"workforce": 1010115,
"fullHouse": 20,
"order": 3,
"needs": [
{
"tpmin": null,
"guid": 120020
},
{
"tpmin": 0.0025000002,
"guid": 1010200
},
{
"tpmin": 0.003333333,
"guid": 1010216,
"happiness": 4
},
{
"tpmin": 0.003076926,
"guid": 1010237
},
{
"tpmin": null,
"guid": 1010349,
"happiness": 6
},
{
"tpmin": 0.001000002,
"guid": 1010238
},
{
"tpmin": 0.0009090899999999999,
"guid": 1010213
},
{
"tpmin": null,
"guid": 1010350,
"happiness": 7
},
{
"tpmin": 0.000416667,
"guid": 1010203
},
{
"tpmin": 0.00076923,
"guid": 1010214,
"happiness": 3
},
{
"tpmin": null,
"guid": 1010351
}
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAUXElEQVRogcWaaXRT55nHL9AQwJbu8r73SvIi2ZIlW5styZJl7bItW5Zsy5JXvGMweME22NisDoQtYQkQEkIIWwiEQCE0TcJka/alzaQJWZo2ZZqtPZmeJG3TmQ9zeuacpv/5gMLMnPnQnNRknnPu13vP7z7v8zz/538vw/zjMYdhmLkMw8ynlMoUmZkSz/NqURT1lFKDxLI6QRByxYwMpUwmo3K5XGBZlud5nqWUyhiGWcgwzE3<KEY>
"locaText": {
"polish": "Robotnicy",
"english": "Workers",
"taiwanese": "工人",
"brazilian": "Workers",
"russian": "Рабочие",
"chinese": "工人",
"portuguese": "Workers",
"french": "Ouvriers",
"korean": "노동자",
"japanese": "労働者",
"italian": "Lavoratori",
"german": "Arbeiter",
"spanish": "Trabajadores"
}
},
{
"name": "Artisans",
"guid": 15000002,
"workforce": 1010116,
"fullHouse": 30,
"order": 4,
"needs": [
{
"tpmin": 0.001333334,
"guid": 1010238
},
{
"tpmin": 0.001212122,
"guid": 1010213
},
{
"tpmin": null,
"guid": 1010350,
"happiness": 7
},
{
"tpmin": 0.000555556,
"guid": 1010203
},
{
"tpmin": 0.001025642,
"guid": 1010214,
"happiness": 3
},
{
"tpmin": null,
"guid": 1010351
},
{
"tpmin": 0.00034188,
"guid": 1010217
},
{
"tpmin": 0.00095238,
"guid": 1010206
},
{
"tpmin": null,
"guid": 1010352,
"happiness": 6
},
{
"tpmin": 0.001904762,
"guid": 1010257,
"happiness": 4
},
{
"tpmin": 0.0008888879999999999,
"guid": 1010247
},
{
"tpmin": null,
"guid": 1010353
}
],
"icon": "data:image/png;base64,i<KEY>
"locaText": {
"polish": "Rzemieślnicy",
"english": "Artisans",
"taiwanese": "工匠",
"brazilian": "Artisans",
"russian": "Ремесленники",
"chinese": "工匠",
"portuguese": "Artisans",
"french": "Artisans",
"korean": "직공",
"japanese": "職人",
"italian": "Artigiani",
"german": "Handwerker",
"spanish": "Artesanos"
}
},
{
"name": "Engineers",
"guid": 15000003,
"workforce": 1010117,
"fullHouse": 40,
"order": 6,
"needs": [
{
"tpmin": 0.00051282,
"guid": 1010217
},
{
"tpmin": 0.0014285715,
"guid": 1010206
},
{
"tpmin": null,
"guid": 1010352,
"happiness": 6
},
{
"tpmin": 0.002857143,
"guid": 1010257,
"happiness": 4
},
{
"tpmin": 0.0013333335,
"guid": 1010247
},
{
"tpmin": null,
"guid": 1010353
},
{
"tpmin": 0.000222222,
"guid": 120030
},
{
"tpmin": 0.0006250005000000001,
"guid": 1010245,
"happiness": 5
},
{
"tpmin": 0.0011764710000000001,
"guid": 120032
},
{
"tpmin": 0.0001960785,
"guid": 1010246,
"happiness": 3
},
{
"tpmin": null,
"guid": 1010354
},
{
"tpmin": 0.0003124995,
"guid": 1010208
},
{
"tpmin": null,
"guid": 1010356,
"happiness": 2
}
],
"icon": "data:image/png;base64,i<KEY>agon<KEY>",
"locaText": {
"polish": "Inżynierowie",
"english": "Engineers",
"taiwanese": "工程師",
"brazilian": "Engineers",
"russian": "Инженеры",
"chinese": "工程师",
"portuguese": "Engineers",
"french": "Ingénieurs",
"korean": "기술자",
"japanese": "技師",
"italian": "Ingegneri",
"german": "Ingenieure",
"spanish": "Ingenieros"
}
},
{
"name": "Investors",
"guid": 15000004,
"workforce": 1010128,
"fullHouse": 50,
"order": 7,
"needs": [
{
"tpmin": 0.0003555552,
"guid": 120030
},
{
"tpmin": 0.0009999995999999999,
"guid": 1010245,
"happiness": 4
},
{
"tpmin": 0.0018823524,
"guid": 120032
},
{
"tpmin": 0.0003137256,
"guid": 1010246,
"happiness": 3
},
{
"tpmin": null,
"guid": 1010354
},
{
"tpmin": 0.0005000004,
"guid": 1010208
},
{
"tpmin": null,
"guid": 1010356,
"happiness": 2
},
{
"tpmin": 0.0004704,
"guid": 120016
},
{
"tpmin": 0.000444444,
"guid": 1010259
},
{
"tpmin": null,
"guid": 1010355,
"happiness": 5
},
{
"tpmin": 0.0010666668,
"guid": 1010258
},
{
"tpmin": 0.00042105239999999997,
"guid": 1010250,
"happiness": 2
},
{
"tpmin": 0.00010524,
"guid": 1010248,
"happiness": 4
},
{
"tpmin": 0.00013333319999999998,
"guid": 1010225
}
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAUHklEQVRogcWaeXhU9bnHD9iCWWbO9juTfV9nSWYm+05CEpJAEhJElhAJSSCAIeybEAJh30X2XVaVTZBNFLQqBbSALYJttWrrim1BLJRSUfjcPxLuvf3jett7jX2fZ/6beeb5nHc533eRpB/GOkmS1FmSpJ9IktRVkiQvTdPMsiyrZrNZM5lMutls1lRVlQ1J8pYk6eH273b+gf7/B7HOkiT9VJIkL5PJpGseHoFmszlKVVWHoShuIctJ7Z8EVVXjzWZzlIeHR4Asy6<KEY>
"locaText": {
"polish": "Inwestorzy",
"english": "Investors",
"taiwanese": "投資人",
"brazilian": "Investors",
"russian": "Инвесторы",
"chinese": "投资人",
"portuguese": "Investors",
"french": "Investisseurs",
"korean": "투자가",
"japanese": "投資家",
"italian": "Investitori",
"german": "Investoren",
"spanish": "Inversores"
}
},
{
"name": "Jornaleros",
"guid": 15000005,
"workforce": 1010366,
"fullHouse": 10,
"order": 2,
"needs": [
{
"tpmin": null,
"guid": 120020
},
{
"tpmin": 0.00285714,
"guid": 120033
},
{
"tpmin": 0.00142857,
"guid": 1010257,
"happiness": 6
},
{
"tpmin": 0.0025000020000000003,
"guid": 120043
},
{
"tpmin": null,
"guid": 120050,
"happiness": 14
}
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAPBUlEQVRoge3Zx2+c+XnAceZgx213tVppJUoUxSbWmeH03nuvnMLpMxxyhhxyODPsvauQKiut19La692VSxZ23J3Y8WGdGAgC5Bzk4nsOueQUwA6M6JubEcSOsXZi0wd//4Lng+cHPC/<KEY>
"locaText": {
"polish": "Jornaleros",
"english": "Jornaleros",
"taiwanese": "計日工人",
"brazilian": "Jornaleros",
"russian": "Хорналеро",
"chinese": "计日工人",
"portuguese": "Jornaleros",
"french": "Jornaleros",
"korean": "식민지 노동자",
"japanese": "ジョルナレロス",
"italian": "Jornaleros",
"german": "Jornaleros",
"spanish": "Jornaleros"
}
},
{
"name": "Obreros",
"guid": 15000006,
"workforce": 1010367,
"fullHouse": 20,
"order": 5,
"needs": [
{
"tpmin": null,
"guid": 120020
},
{
"tpmin": 0.002857143,
"guid": 120033
},
{
"tpmin": 0.001428573,
"guid": 1010257,
"happiness": 3
},
{
"tpmin": 0.002499999,
"guid": 120043
},
{
"tpmin": null,
"guid": 120050,
"happiness": 7
},
{
"tpmin": 0.00142857,
"guid": 120035
},
{
"tpmin": 0.0005882369999999999,
"guid": 120032
},
{
"tpmin": null,
"guid": 1010348,
"happiness": 4
},
{
"tpmin": 0.001333332,
"guid": 120037
},
{
"tpmin": 0.001333332,
"guid": 1010214,
"happiness": 4
},
{
"tpmin": 0.000555555,
"guid": 1010259,
"happiness": 2
},
{
"tpmin": 0.0012500010000000002,
"guid": 1010206
}
],
"icon": "data:image/png;base64,iVBORw0<KEY>0tLS0mKaLvlUhmalSDGdor9eo7NYJJvw6MgE/Om5Jb52Yx9//tgePnFsnnqlxMRAD77rEAQBqmIxOTr6k/uKqFS60ppqkUukkIQYqbjHaHeDQsLDNXXePLyZbz/1EN978QTfefE<KEY>
"locaText": {
"polish": "Obreros",
"english": "Obreros",
"taiwanese": "勞工",
"brazilian": "Obreros",
"russian": "Обреро",
"chinese": "劳工",
"portuguese": "Obreros",
"french": "Obreros",
"korean": "식민지 직공",
"japanese": "オブレロス",
"italian": "Obreros",
"german": "Obreros",
"spanish": "Obreros"
}
}
],
"products": [
{
"name": "Coins",
"guid": 1010017,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAANY0lEQVRoge2aaXRUVb7FTwIBRCCpWJVK7j3zrSSEDFVBEwREEBWFliQkIC<KEY>QYJIg<KEY>IDgz<KEY>2<KEY>//1eood1uby7s9gTudGrTNJM0<KEY>sWebGuzPdWFGUBk+y3CEMo52Ki3OS4Fb7QyiSEBLlcDiacc615nJKXZAxOSZKR7ZB9T92ovq7N1H97Ruo/nYbFOdDOeetDMNoSn7nVYkkhETVmpvzVoqxLhYXT1wOko3q<KEY>
"locaText": {
"polish": "Monety",
"english": "Coins",
"taiwanese": "錢幣",
"brazilian": "Credits",
"russian": "Монеты",
"chinese": "钱币",
"portuguese": "Credits",
"french": "Pièces",
"korean": "코인",
"japanese": "コイン",
"italian": "Monete",
"german": "Münzen",
"spanish": "Monedas"
}
},
{
"name": "Influence",
"guid": 1010190,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAO+0lEQVRoge2ad1RU19rGXwJTMCZiQ8UyDDBDc+YcosZcY001egOiFEMTARUbHRVRRBAVFZQYRbHHgprcAEqTCIgtkRgbqKioqKhRUawRpz33j2FOOCqW5N7cfOvLu9b+h<KEY>
"locaText": {
"polish": "Wpływ",
"english": "Influence",
"taiwanese": "影響力",
"brazilian": "Influence",
"russian": "Влияние",
"chinese": "影响力",
"portuguese": "Influence",
"french": "Influence",
"korean": "영향력",
"japanese": "影響力",
"italian": "Influenza",
"german": "Einfluss",
"spanish": "Influencia"
}
},
{
"name": "Coal",
"guid": 120021,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAU2UlEQVRoge2aZ5BU15XHHyCBkYRgRj3T3e/de1/oHF6H6dwzPUykYTJxmDwDE2GiJicYwsCQRBBJgATCgAICWQFJZWXJyHKQLGtle7HlKltru1yqsr221pbsWu9/P/SIFVuWbCHkD1t7qv7V1eF139+755x7zr3Ncf9v//dtJsdxN3McN2daN0+/NuPL/uEb9QMzOI67OTk5+XZyBxFknrfIvGzheZ4JgnCHluNu5f4H6kuxWV/w+hkcx83SarW3Uo2GlwkJ2u3qT848fBkeT+AjqtdvlSiNS5Lk4XmeKklJ87kE0A2foZu+wLUzOI6bzRhLknnewgjZMTl1D578+jsYGD+K3pGD6Ozfg+KyMqSluX9C9UIrY8wniqKe5/lbuMRNvGFA1wsyk+O4uVJKio7qaWbQH33/ldd+hmdffhcXnnwLLV1TaGqfxNp1m1DfMo61rW1obW+GSIVnZUoXKYJgXrBgwQIuEUc3xN2ux7VmaTSaeQZCjHqtdvL+00/89flX3sXhUy9jy97HsWn3RYxMnkXj+q1o79+H8R0Pob55DI2tbcjKykL+opwPGM9vVBjLMDOmsPnzkz4BdN0z9HkvnJWcnHw70+nssfSFr/3<KEY>",
"locaText": {
"polish": "Węgiel",
"english": "Coal",
"taiwanese": "煤",
"brazilian": "Coal",
"russian": "Уголь",
"chinese": "煤",
"portuguese": "Coal",
"french": "Charbon",
"korean": "석탄",
"japanese": "石炭",
"italian": "Carbone",
"german": "Steinkohle",
"spanish": "Carbón"
}
},
{
"name": "Oil",
"guid": 1010566,
"producers": [
101331
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAR5ElEQVRogc2aZ3Ac53nH<KEY>Ym<KEY>545uvHb1OYTDEZCksBSUXARFSaAoaek3pbIA0Wg75ubm8c6119EYi4KRy1+WOK6Cp6g8hmHopKSkR4mFMv2TZeihJIJ4lOM4iZHJRsbGBv<KEY>
"locaText": {
"polish": "Ropa",
"english": "Oil",
"taiwanese": "原油",
"brazilian": "Oil",
"russian": "Нефть",
"chinese": "原油",
"portuguese": "Oil",
"french": "Pétrole",
"korean": "석유",
"japanese": "石油",
"italian": "Petrolio",
"german": "Öl",
"spanish": "Petróleo"
}
},
{
"name": "Electricity",
"guid": 120022,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAJw0lEQVRoge2Za3BU5RnHwx3kIrehoi1FVCxEQIyKISGc264gimJLFRCqU6jKBwtatNoBUxWsFkasl0oRqQ5DNdaqXAVJNglJSMgSspucvZ0NgRBI9pLsJbvZ7Gb3/PqBonbaah1<KEY>",
"locaText": {
"polish": "Elektryczność",
"english": "Electricity",
"taiwanese": "電力",
"brazilian": "Electricity",
"russian": "Электричество",
"chinese": "电力",
"portuguese": "Electricity",
"french": "Électricité",
"korean": "전기",
"japanese": "電気",
"italian": "Elettricità",
"german": "Elektrizität",
"spanish": "Electricidad"
}
},
{
"name": "Market",
"guid": 120020,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAWz0lEQVRogcWad3hUxb+Hj1hRUeBm29nTtmZ7S91N7z3ZTdmEhBZqKFKkiaA0EQRRlI4oXTDSUXoVkBCSUBI6iPSSDUlIIAKSz/1jN/kBwr2g3ud+n+d9dmf3PPPMe2b<KEY>
"locaText": {
"polish": "Rynek",
"english": "Market",
"taiwanese": "市場",
"brazilian": "Market",
"russian": "Рынок",
"chinese": "市场",
"portuguese": "Market",
"french": "Économie",
"korean": "시장",
"japanese": "市場",
"italian": "Mercato",
"german": "Markt",
"spanish": "Mercado"
}
},
{
"name": "Pub",
"guid": 1010349,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAZQUlEQVRogcWad3QUZdv/Vx996CWwdXZnZ3eT0MPOLNIh9ISQ3kN6AiEFAqEGEKXYEAQBEWkCglQpEgVpEop0QUBC7y0JSQiho8Dn98cuqKjvI+/vfc97nXOdPWf2nDnzme9V7vueS6V6OXtFpVL9y+WvuX5fdV1/9t/rGo2munfz5uLwoVk+3u1ajNZrdNu0Gs1Bo073ntls7mIxWmSL3mLR6XRajUZTXaVS/dt1n2f3fe139/<KEY>",
"locaText": {
"polish": "Karczma",
"english": "Pub",
"taiwanese": "酒吧",
"brazilian": "Community",
"russian": "Паб",
"chinese": "酒吧",
"portuguese": "Community",
"french": "Pubs",
"korean": "선술집",
"japanese": "パブ",
"italian": "Pub",
"german": "Wirtshaus",
"spanish": "Pub"
}
},
{
"name": "Church",
"guid": 1010350,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYvUlEQVRogbWad3SVVdaHr+IoOjKIk+Te3PK+771JKBIS0usN6b23mwoppIcQpEkNIZQAgnQQVIrYAAtdBOlIkQGkCAh+CiEJ6SGUEDB5vj8SGRzBkfm+<KEY>",
"locaText": {
"polish": "Kościół",
"english": "Church",
"taiwanese": "教堂",
"brazilian": "Faith",
"russian": "Церковь",
"chinese": "教堂",
"portuguese": "Faith",
"french": "Églises",
"korean": "교회",
"japanese": "教会",
"italian": "Chiesa",
"german": "Kirche",
"spanish": "Iglesia"
}
},
{
"name": "School",
"guid": 1010351,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAaNklEQVRogcWad1RV19a3d3Kj9CqnsE9HjEZNjBq7WJAqcCiKIKAgNkBQ7EFNjEZRUWPvDbtiREXBhiBqxIaIDTs2QMoB7CXq8/0B8abc+934vvcb3xzjN/YY5+yxxnr2nGuuveaegvBx9okgCP+o02d110/rfv/f2Ce/G/uzOv03xv3D4L/pM1EQTEVRtFOpVKJKpRL<KEY>9R0AAAAASUVORK5CYII=",
"locaText": {
"polish": "Szkoła",
"english": "School",
"taiwanese": "學校",
"brazilian": "Education",
"russian": "Школа",
"chinese": "学校",
"portuguese": "Education",
"french": "Écoles",
"korean": "학교",
"japanese": "学校",
"italian": "Scuola",
"german": "Schule",
"spanish": "Escuela"
}
},
{
"name": "Variety Theatre",
"guid": 1010352,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYkUlEQVRogcWad3RU5daHRyFlkplkJsm0M3POmZkECASQolRDC2mkh0BCKgktodfQpAUQCKH3ooCiKB1CkRYEhCsIokgRAb209EKTJtzn+yPRhV7vveD9vvXttX5r1jrlXfs5+5237HcrFK9mrykUilo1ql3z+3rN9f/GXnuh7f/Ndn/X+K+qbVAYXAVB8BJFUbBYLGaj0ajTarXuCoXCWaFQOPzBgX/lxK/3Xq953kFQKFw0Go3G22DQi6IoyLJsslgsHhaLRVnzzB99eSnnaysUCmdBIbgICsGlpjGlWa32tAqCr8lgGGrS6VYJemOuVRSDrRZLS0EQ6pnNZosgCF4eHh5uBoXCVaFQOPv4+DgpFIrf5OPj42SxWJQGg8FVq9W6G41GnSAIoiRJfpIgtRX0+kkmnWG1YDDMsEvS26Ioer/<KEY>
"locaText": {
"polish": "Rewia",
"english": "Variety Theatre",
"taiwanese": "綜藝劇場",
"brazilian": "Entertainment",
"russian": "Театр Варьете",
"chinese": "综艺剧场",
"portuguese": "Entertainment",
"french": "Cabarets",
"korean": "보드빌 극장",
"japanese": "多目的劇場",
"italian": "Teatro di varietà",
"german": "Varieté",
"spanish": "Teatro de variedades"
}
},
{
"name": "University",
"guid": 1010353,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYaElEQVRoga3ad1<KEY>ewL8K4IiiPf4fL6AI0kZLRKZSWnaXEJRRgzD6DNi8ZRCZWBfy4nDaDp2EHd2bMKRhWVIcpvSocvShyihsISlKH9WLHbgKMqSE4<KEY>
"locaText": {
"polish": "Uniwersytet",
"english": "University",
"taiwanese": "大學",
"brazilian": "Graduation",
"russian": "Университет",
"chinese": "大学",
"portuguese": "Graduation",
"french": "Universités",
"korean": "대학",
"japanese": "大学",
"italian": "Università",
"german": "Universität",
"spanish": "Universidad"
}
},
{
"name": "Electricity",
"guid": 1010354,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYiklEQVRogcWad3hUZdr/x7Ir664Qkkw7c+rMZCaTmUmbFNKH9JAy6QnpJHQUKaLSpK1KWVxkEREBEcWCshaEFUGBVXdt6<KEY>",
"locaText": {
"polish": "Elektryczność",
"english": "Electricity",
"taiwanese": "電力",
"brazilian": "Electricity",
"russian": "Электричество",
"chinese": "电力",
"portuguese": "Electricity",
"french": "Électricité",
"korean": "전기",
"japanese": "電気",
"italian": "Elettricità",
"german": "Elektrizität",
"spanish": "Electricidad"
}
},
{
"name": "Members Club",
"guid": 1010355,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAWzUlEQVRogcWad1RUZ/rHb7LJmkQQGOaWuf0OQ0d6hwGkI1KlqCAIigWNMdaYxKiYrFFjooktNtDYSzQmulFRYzSJNRYsaKxrlCKgQKTj9/fHDFbcaHb3/N5zvmfOmXnPPe/nPu3OfR6CeLH1EkEQfzPqFePny8bv/5P10iPXfsWo/8Z1H7t4h15hCeINlmXVgiCwPM9zNE1TFhYWZgRBvE4QxKvE42DPOkTHby8b97/KE8TrFhYWZlY0TQmCwAqCwHIcZ0kQxBvGPU+e5bkO/wpBEK+xBPsGS7<KEY>oAAAAASUVORK5CYII=",
"locaText": {
"polish": "Elitarny klub",
"english": "Members Club",
"taiwanese": "會員俱樂部",
"brazilian": "Leisure",
"russian": "Клуб",
"chinese": "会员俱乐部",
"portuguese": "Leisure",
"french": "Foyers",
"korean": "회원제 클럽",
"japanese": "会員制クラブ",
"italian": "Club esclusivo",
"german": "Clubhaus",
"spanish": "Club privado"
}
},
{
"name": "Bank",
"guid": 1010356,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYzklEQVRogcWad1BV196wd3Jzb0yxQDiFfXY551AFKYpIL9K7gnSUpiAKKooidkGNKBqxKxpbiomptyQ3MWpiNMVYUkxVE0uUKlbEzvP9AZqoud+b5L3ffGvmmT1zYNasZ6/fqvsnCH+sPCQIwl+6eKTr+XDX7/+b8tCv6n6ki/9GvfdUfodHREF4XBRFK1mWRVmWRb1er7GwsOgpCMJjgiD8VbhX7D814s7fHu76/79KgvCYhYVFTxudTitJkkGWZdFgMDwlCMLjXVL3t+V3Nf4RQRC6iaL4uCiIjwuC0E0QhG5Sjx6WJlF0EHW6sdYazTpRq19olKQoo8HgbRRFR4PBIImiaGVpadlDJwhPCILQzdbW9lFBEO5ia2v7qCRJj+l0uicsLCx66vV6jSiKsqLXO6kG<KEY>O5lAY2omWQAAAAASUVORK5CYII=",
"locaText": {
"polish": "Bank",
"english": "Bank",
"taiwanese": "銀行",
"brazilian": "Banking",
"russian": "Банк",
"chinese": "银行",
"portuguese": "Banking",
"french": "Banques",
"korean": "은행",
"japanese": "銀行",
"italian": "Banca",
"german": "Bankhaus",
"spanish": "Banca"
}
},
{
"name": "Chapel",
"guid": 120050,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYvUlEQVRogbWad3SVVdaHr+IoOjKIk+Te3PK+771JKBIS0usN6b23mwoppIcQpEkNIZQAgnQQVIrYAAtdBOlIkQGkCAh+CiEJ6SGUEDB5vj8SGRzBkfm+2Wv91nrXuu08d599ztlnb5ns6ewZmUz2rEwm6/aInn3M+54zMjLqYWlmphEEob9Wq7XWKpV9JGNJoZTJX<KEY>885f<KEY>ia<KEY>ZIUkiQplD2URq+++urfZDJZ967Xu8lksueEnkKv0snFIbu++rRy1+5P2bDpQ/wC/E4JKiFUbaw2l8tkf31kwH+RyWQv9urVq6dSqTSSJEmhNTGRCz2FXjKZ7MV/gX50TP928M/JZLLucrn8r3K5/K+STOouSVJ3oWfPXjq12kKpUBSampi8bSqXz9QJgq9Oo3FQqVS9NU<KEY>",
"locaText": {
"polish": "Kaplica",
"english": "Chapel",
"taiwanese": "小禮拜堂",
"russian": "Часовня",
"chinese": "小礼拜堂",
"portuguese": "Chapel",
"french": "Chapelle",
"korean": "예배당",
"japanese": "礼拝堂",
"italian": "Cappella",
"german": "Kapelle",
"spanish": "Capilla"
}
},
{
"name": "Boxing Arena",
"guid": 1010348,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYdklEQVRogcXad3CUVdv48dVHIYTU7bnr7iY0EZEHERQpQkIa2RRCEhJS6SAtCSDSQxAIHUJ5gkjvvYQuiIJIFxApYqGl0hMCSUi+7x9EBhR98fH9ze/MXLMzuzv3XJ/7OufcM/d1NJq/N17RaDT/qorXqj5frfr+n4xXnrn2a1Xxf3Hd5y7+W7wmaDSOgiDoZVkWJEkSTSaT0d3d3VWj0dTQaDSva56H/VkSv/32atX/X5c0mhru7u6uniaTUZZlQZZlQRRFnUajcaz6z+9zeankX9NoNA6CRnAUNIKjJEk1LBaLg+TiorVarXUEk6mfh8EwXzCaJ6mS5K+K6nuqh0c9URQls9ls0Gq1LiaNpqZGo3Hw8vKqrtFonoaXl1d1SZJqmEymmlqt1kUQBL0oipKiKG+oqvq+YDSO9DCYPhNM5glW2drSJoq1LRaLm0ajcdBoNDUEQXAUBMHRS+NVvSrPF6Je0Wg0DmYns8EqCHUUD4/GNrPcxCpJbymK8oYqim<KEY>
"locaText": {
"polish": "Ring bokserski",
"english": "Boxing Arena",
"taiwanese": "拳擊館",
"brazilian": "Hygiene",
"russian": "Боксерский ринг",
"chinese": "拳击馆",
"portuguese": "Hygiene",
"french": "Salle de boxe",
"korean": "권투 경기장",
"japanese": "格闘アリーナ",
"italian": "Arena di pugilato",
"german": "Boxkampfarena",
"spanish": "Estadio de boxeo"
}
},
{
"name": "Grain",
"guid": 1010192,
"producers": [
1010262
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAVZUlEQVRogdVad1TV57IdRVSkiBVp5wDCoXc49I70LkUpgvReBKQ3ISKIgChFqoAUaSoodgPBhg0VuyYajSVGY0xubnKj1/3++MEza90kN8lNct+btb4FCzhrfTOzZ2Z/eyD6v2szps5MIpr1ozNz6sz4712NsenL8dBPX2jagVlExEdEQkS0mIiWENECIhKc+vmsn/jsX2YziIiXiOYRkcDU11nEOMUz9f2cqd8tISKZpYuWRrlZG31RmOD7dyLS5OXl1RBZLOI89Tf/FWdmTl1ygcgiEWsXS4O3RLSMmIgLEhPtJUQkPn/+fEtXK6Oj5ZmhyIn1A1eF88bbVOHzdW4aiHZQ/YElJpZORAuJCcpf5sgMYqI9l4iWSIiIxR3YFguxJcvSiEiBiKTn8fJq6ijLv54zZ84KQy21N6e6P4CBlhrWe2iiOpT7zlKL83bZ0qVtRGRLRNpEJDUVgD8tI9P4n8b+NNYFiYhtZ2l8oiHTG8sWL95CRFYCfHyeK611J9N9jeBppoKmZBu0xBlhnbsmuAqSl4UEBLYSURARuRKR<KEY>
"locaText": {
"polish": "Zboże",
"english": "Grain",
"taiwanese": "穀物",
"brazilian": "Grain",
"russian": "Зерно",
"chinese": "谷物",
"portuguese": "Grain",
"french": "Blé",
"korean": "곡물",
"japanese": "穀物",
"italian": "Grano",
"german": "Getreide",
"spanish": "Trigo"
}
},
{
"name": "Beef",
"guid": 1010193,
"producers": [
1010263,
101269
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAU3klEQVRoge2aeVwUZ5rHC2jOhr6rq7vqrbObhm5o6Ibmvm8QlcNbDOKtaFRULlEBUUSN4BGvxCuZMR6JJ9EYjRqNRqNRUSezk83c97k7mcNkd2b2t3+IxmTcSTKbzMwf+X0+z39d1fWt97nep16K+kpf6Sv9K8qPoqgAiqKCGYpSMxSlZlk2jGXZMIqiQiWKCqEoSjX4u3+6/AbNf9ACBk1FCAnlOM5ICLFLnOQRWTFB4iSPzHHxCiFujuMcvMnEKnq9lqKo4MHr/ikKoCgq2GQyRRCNxsAwjFmSJAvP8yzLsoJotTp5lq1cne5DZ2IMKu0iskUOy0aX49kpo2Fj6OsyJ9TaBCFDEARFo<KEY>
"locaText": {
"polish": "Wołowina",
"english": "Beef",
"taiwanese": "牛肉",
"brazilian": "Beef",
"russian": "Говядина",
"chinese": "牛肉",
"portuguese": "Beef",
"french": "Bœuf",
"korean": "소고기",
"japanese": "牛肉",
"italian": "Manzo",
"german": "Rindfleisch",
"spanish": "Ternera"
}
},
{
"name": "Hops",
"guid": 1010194,
"producers": [
1010264
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAU9ElEQVRogc1aZ3Rc5Zm+cgWMsSVrdGfu/dq9d5<KEY>2<KEY>13eKW3DfmVvo+WHqgC727mlAzWICSrnTEue1vckIqCSExTGY6Y8ylqWoc51wLWmuadHkW+sZWnWYymcxc5V5DiAfHz45i83<KEY>",
"locaText": {
"polish": "Chmiel",
"english": "Hops",
"taiwanese": "啤酒花",
"brazilian": "Hops",
"russian": "Хмель",
"chinese": "啤酒花",
"portuguese": "Hops",
"french": "Houblon",
"korean": "홉",
"japanese": "ホップ",
"italian": "Luppoli",
"german": "Hopfen",
"spanish": "Lúpulo"
}
},
{
"name": "Potatoes",
"guid": 1010195,
"producers": [
1010265
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAUNklEQVRoge2Zd3RU95n3L+ACqEtz587cuffOnZGEhEQRRQgsJFHUUe8NgShCdAGim2CDABtM78UUgWgChAVCwiBA9F4EEdUmhGLHODbZN+vNbjb72T8k+2SzSd6QxPvuOW++5zznzNz7z3zmKb/neX6C8A/9Q//QP/Q3qsXv2R8+aykIQitBEN4QBOGt37M3mt/9P9P3P+4Nf3//t3Rdb60oSpvvzcvL620vL6+3dV1vLQiCo4uLi5suiiabzWa12+3esiz7KKLipXh4WHRdd22G+h8FaikIwluSJDkoiuKuKIpFVVVPTdP8dYseYLVau9gsls6<KEY>
"locaText": {
"polish": "Ziemniaki",
"english": "Potatoes",
"taiwanese": "馬鈴薯",
"brazilian": "Potatoes",
"russian": "Картофель",
"chinese": "马铃薯",
"portuguese": "Potatoes",
"french": "Pommes de terre",
"korean": "감자",
"japanese": "ジャガイモ",
"italian": "Patate",
"german": "Kartoffeln",
"spanish": "Patatas"
}
},
{
"name": "Wood",
"guid": 120008,
"producers": [
1010266,
101260
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAQ/0lEQVRoge3ZaVCU+Z3A8c4mla2t1Ax90N0cfUHTNN2AIMjZnIIICsgtiCiIHA5yKSiIoIIgciOoICqi3LcICh7oeDujouMxmcxkpyZbmdkjtbVbm1TtZpL57otJUtk3WU2czG7VfN8+z4vfp57n/3+epx6B4Lu+67v+v/U3CoXCztFR8EOpVOqqUCjEAoHge9/2UK+VTCz2Hepr/s318Ua++PgST270cv5UBWX5qb92dzHUf9vz/am+9/bbb4vdXJ32jQ+08/7lbsaO7eHEvk08u9bGQEM2C6dLOLV/I4074lkd6IlcLvf6tof+H5mbm0dfnjv35SfPLlCVGsT82YM0F8bRW5PBRFseTdvXULM1lP2bAylJ8CAj1Mju+OVELFf/Vm5unv2NDicWi99eE2Lq1Gs14X/qnPLSXB5f6eXjB32c2reJT5fO88H<KEY>
"locaText": {
"polish": "Drewno",
"english": "Wood",
"taiwanese": "原木",
"brazilian": "Wood",
"russian": "Древесина",
"chinese": "原木",
"portuguese": "Wood",
"french": "Bois",
"korean": "나무",
"japanese": "丸太",
"italian": "Legno",
"german": "Holz",
"spanish": "Madera"
}
},
{
"name": "Wool",
"guid": 1010197,
"producers": [
1010267
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAXL0lEQVRogdVad1RUeZZ+ajvTYexGG6iqVy9VldNtt63dtvY4drc5oA1GBEQUAVEJCoJEyTlJzhQ5SZFBJEiSXEXOSlYRMSBM2t3Zmd759g+wd/ac3ekwPb2z95z7R51TVed9797v/u797o8g/jlsGUEQr1EE8caaNWveVlJSUuKUlJTWrFnzNkEQbxAEsXLpO/9vbNmSL1/y<KEY>
"locaText": {
"polish": "Wełna",
"english": "Wool",
"taiwanese": "羊毛",
"brazilian": "Wool",
"russian": "Шерсть",
"chinese": "羊毛",
"portuguese": "Wool",
"french": "Laine",
"korean": "양모",
"japanese": "羊毛",
"italian": "Lana",
"german": "Wolle",
"spanish": "Lana"
}
},
{
"name": "Pigs",
"guid": 1010199,
"producers": [
1010269
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAV7klEQVRoge2aZ1RVZ9bHj1GjSWZEiXC5555670UFLr0ISu+9iPQiCBawIVWKSld6EQRFEBREERsgFlTUGE0gKhaMXbAlmpioo4kN/+8H0Mwk82YmbSYfZq/1X+veL2c9v7PL8+xnH4L4n/1mG0YQxDs/0rD/6or+TXuz8OEEQYwSCAQfiMeJ5UQi0YcikehDjuPGKigo/IUgiHeJPyn<KEY>
"locaText": {
"polish": "Prosięta",
"english": "Pigs",
"taiwanese": "豬隻",
"brazilian": "Pigs",
"russian": "Свиньи",
"chinese": "猪只",
"portuguese": "Pigs",
"french": "Porcs",
"korean": "돼지",
"japanese": "豚",
"italian": "Maiali",
"german": "Schweine",
"spanish": "Cerdos"
}
},
{
"name": "Furs",
"guid": 1010209,
"producers": [
1010558
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAXV0lEQVRogc16eVhUZ57u0WiWTqJCKM6ps58qdpClKKD2hSoKqliLYl9ll02RRRRBQRDBBVTc0KCCCGLUEMGoHTVqOqt2Z+mklyTT6e7Y6cw8PXPvzJ2+me4nM+/8Iel2+qYTk3tzp9/nOf/Ueer5zvu9v++3fgTx3WIRQRCL73sWfcfr/T/HIoIglhAE8ZiXl9dyhmGeElesWEES5OMEQTx837OUIIiH/hu/8<KEY>GcVTVAjHcUZ<KEY>XF<KEY>chxHe3t7LyPukf7/hgcxi8UkQTwuyOXB2<KEY>8bXZOGfWU2pIZL4CjqGEPRu1yGiB9Upmg/E2j5UZZlV3p5eS0nvmNlFi0s8ChLsI8RBPEIcW/3/hqppYIgyAtSDHdePViLIzkJGEo2oNUcBU8oD4c/iVprBHY4tZguSkZfWvwfFKzgoWmaJ+6Z2neGJaIorqAoKoShqBwFy/rTNO2zsOhfkllEEsTjSpIL297kxs2d5ThTmoaD7njscumRu1JERXQAuixqnMh2YLYqCzOVHggM18vzfPSCiS3+Lkgs9vHxeZKm6ahV7vj/<KEY>
"locaText": {
"polish": "Futra",
"english": "Furs",
"taiwanese": "毛皮",
"brazilian": "Furs",
"russian": "Меха",
"chinese": "毛皮",
"portuguese": "Furs",
"french": "Fourrures",
"korean": "모피",
"japanese": "毛皮",
"italian": "Pellicce",
"german": "Felle",
"spanish": "Pieles"
}
},
{
"name": "Grapes",
"guid": 120014,
"producers": [
100655
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAUTElEQVRogc1aZ3Bb15l9lCwpclRpQgDfu+++AoJgbwABsIAVIAkC7L33IooiKUosYhF7E4tIqpNUoUhJliVZtCVLsmQ5juPYzmyySRzH69nZ7CTjzY7/bCaZeNZxyp79QTrJZta2ih3nzNyZNxi8uffM952v3ccwTwanz1<KEY>GJYZj<KEY>G<KEY>i<KEY>j<KEY>3<KEY>zg<KEY>J<KEY>2<KEY>ispX5<KEY>ZlXUSOC6Cs6lBSvxZF877YezEKndfTkD4ZgN6VQjSeTYa3QUDrc0lIOeyLpLLwjyRKM1mWpcyqKz7qvl+qxtaTbcSZExVnfe38h0GZ/B+j291g7dcgftAd9mFPJA/7In00CMXHwrHnQizankuBrV+LlsUMsCrVHYkQw5qLrXu<KEY>",
"locaText": {
"polish": "Winogrona",
"english": "Grapes",
"taiwanese": "葡萄",
"brazilian": "Grapes",
"russian": "Виноград",
"chinese": "葡萄",
"portuguese": "Grapes",
"french": "Raisin",
"korean": "포도",
"japanese": "ブドウ",
"italian": "Uva",
"german": "Trauben",
"spanish": "Uvas"
}
},
{
"name": "<NAME>",
"guid": 1010198,
"producers": [
100654
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAVtUlEQVRoge2aeXBUZdr2D+<KEY>
"locaText": {
"polish": "Czerwona papryka",
"english": "Red Peppers",
"taiwanese": "紅椒",
"brazilian": "Red Peppers",
"russian": "Перец",
"chinese": "红椒",
"portuguese": "Red Peppers",
"french": "Poivrons rouges",
"korean": "피망",
"japanese": "赤トウガラシ",
"italian": "Peperoncini",
"german": "Paprika",
"spanish": "Pimientos rojos"
}
},
{
"name": "Fish",
"guid": 1010200,
"producers": [
1010278
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAATtElEQVRogeVaaXRb5Zm+zgJhC7YrR/bVvd93dWWyx/Juy7IlW/Iu25JXWbJsLdbiRbZleYvsOHHs7CQQnMQhOwRMEpKQhiUQCCRAKGQhC4Yk7JnOcs5MO+2hQ09bBnjmR0x/dFoI01DaM8853zn6dc999H7PuzzvZZh/HIRNnn9oTI1lmNuZG2fqj/0y/xeEMQwzVRCEcI7jZIIgREdFRd3N/IORCWMY5jZBEMJ5Kb+wID//XwWeL2BZlmduROZvginMjX9t6uTv73O/wxiGmcoy7J08z<KEY>
"locaText": {
"polish": "Ryby",
"english": "Fish",
"taiwanese": "魚",
"brazilian": "Fish",
"russian": "Рыба",
"chinese": "鱼",
"portuguese": "Fish",
"french": "Poisson",
"korean": "생선",
"japanese": "魚",
"italian": "Pesce",
"german": "Fische",
"spanish": "Pescado"
}
},
{
"name": "Saltpeter",
"guid": 1010232,
"producers": [
1010310
],
"icon": "data:image/png;base64,iVBOR<KEY>
"locaText": {
"polish": "Saletra",
"english": "Saltpetre",
"taiwanese": "硝石",
"brazilian": "Saltpetre Works",
"russian": "Селитра",
"chinese": "硝石",
"portuguese": "Saltpetre Works",
"french": "Salpêtre",
"korean": "초석",
"japanese": "硝石",
"italian": "Salnitro",
"german": "Salpeter",
"spanish": "Salitre"
}
},
{
"name": "<NAME>",
"guid": 1010228,
"producers": [
1010560
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAARHklEQVRo<KEY>
"locaText": {
"polish": "Piasek kwarcowy",
"english": "Quartz Sand",
"taiwanese": "石英沙",
"brazilian": "Quartz Sand",
"russian": "Кварцевый песок",
"chinese": "石英沙",
"portuguese": "Quartz Sand",
"french": "Sable de quartz",
"korean": "규사",
"japanese": "けい砂",
"italian": "Sabbia di quarzo",
"german": "Quarzsand",
"spanish": "Arena de cuarzo"
}
},
{
"name": "Reinforced Concrete",
"guid": 1010202,
"producers": [
1010280
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAARSklEQVRoge2ZeXCT952HlaTd2Z0pmxjJJg<KEY>zM6+Tfl624+tVrzZ41a6O7ULjVUDXKvHlP5X5npkUi0cKUrLKbnr5i62NPPJXg4eb20vaAbSdGR22cOjXB+fNnae0fZePOVBoba3C5+rlw4U/U<KEY>
"locaText": {
"polish": "<NAME>",
"english": "Reinforced Concrete",
"taiwanese": "鋼筋混凝土",
"brazilian": "Reinforced Concrete",
"russian": "Железобетон",
"chinese": "钢筋混凝土",
"portuguese": "Reinforced Concrete",
"french": "Béton renforcé",
"korean": "강화 콘크리트",
"japanese": "鉄筋コンクリート",
"italian": "Cemento armato",
"german": "Stahlbeton",
"spanish": "Hormigón armado"
}
},
{
"name": "Soap",
"guid": 1010203,
"producers": [
1010281
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAUzklEQVRoge2aeViU5frHX22xOllqDAzvvO877wxUp0OL<KEY>
"locaText": {
"polish": "Mydło",
"english": "Soap",
"taiwanese": "肥皂",
"brazilian": "Soap",
"russian": "Мыло",
"chinese": "肥皂",
"portuguese": "Soap",
"french": "Savon",
"korean": "비누",
"japanese": "石鹸",
"italian": "Sapone",
"german": "Seife",
"spanish": "Jabón"
}
},
{
"name": "Timber",
"guid": 1010196,
"producers": [
100451,
101261
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAASi0lEQVRoge2ad2yVZ5bGT2BMKAlMaDbGtJBACMUY0zHNNrj3XnHvDXcb425j4wruvXCvu7FxrzQnBAgJSXZnd3Z2NRqtRiNN2aKd1c5qNclv//jsxBNtNskMjOaPOdKrT/de6X7neZ9TnvN+n8hf7a/2dXtlfi2dXz+Yvy5Z9Nvi9RdnC84vE5GVIvJDEVk3v94QkTUi8tr8b8tF5FUR0ZA/BLoA9s/u+CvzN9eQr5zXFpHd27dsaX1r29Zn23R0GtauWeOkIXJIRPaJyC4R2SEiW0Rkk4hskK+ArhIF4NI/h/NL5KudXyUia0Vk88qVKw+/tWNLY3yA6W86y/yYbA5nujWCscZQppojGKoNQVXsQ02mG+nhVoS4n/+Fm+XJZycO7hncrKVdrLVhQ/ja1WtN58GtetkANERkhSg7v2nlypWH9r69I83B9DiTzRGM1IcxXBfKVEskIw2hDNeFMlKvXGfbIxlrDGWkLoTR+hCmW8KZaQ1ntjWcicZQRuuCiPUyYMWKFQbzm/PCHF+I+a+HzTtbNm0uy0/2/XlHeQD31DE86IhhqjWS0YZw7tQqzk+3RXFXfZmJ5ghG6kOYao5goimMmdYIZlsjmG4JZ7IpjNH6INICzxPscJjjB3b9qyghuO5FAFgiSgIuF5HVIqK1bNmy<KEY>
"locaText": {
"polish": "Deski",
"english": "Timber",
"taiwanese": "木材",
"brazilian": "Timber",
"russian": "Доски",
"chinese": "木材",
"portuguese": "Timber",
"french": "Planches",
"korean": "목재",
"japanese": "木板",
"italian": "Legname",
"german": "Bretter",
"spanish": "Tablones"
}
},
{
"name": "Bricks",
"guid": 1010205,
"producers": [
1010283,
101268
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADI<KEY>4ixAAARHElEQ<KEY>2<KEY>elf<KEY>1+PDh1GiUNVm2q4risTJ155MNub97Ye5o/G7FBHy05n5cWFuG3y4bh+en5117ps53fn9F+jsTHDH/pjF+RGdskcZYvkqIW5NluyRJJkEQ7g79jb9LhAuCcGeoLIaTEURRVTVaJ2RUYaK9qzoz8Q9XdjQCe1uBPS3AwzNxcVMVLqydjAtry/DR6kn4w6qJ+HDleJxfUYpzD4zDueVj8f7SErzbXoxVYxwYlxp9hCuKX5dlFsL8TTITLgjCnTe+dVVVJUJIpEaIS+d8tM7UU68uGPvx+e5qXN5Wi<KEY>",
"locaText": {
"polish": "Cegły",
"english": "Bricks",
"taiwanese": "磚塊",
"brazilian": "Bricks",
"russian": "Кирпичи",
"chinese": "砖块",
"portuguese": "Bricks",
"french": "Briques",
"korean": "벽돌",
"japanese": "レンガ",
"italian": "Mattoni",
"german": "Ziegelsteine",
"spanish": "Ladrillos"
}
},
{
"name": "<NAME>",
"guid": 1010247,
"producers": [
1010325
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAVRElEQVRogc1aZ3BUV5p9YIMBmySkDu/e+0KrlWMrILViS2<KEY>//<KEY>5Zmdn9wrHcS/81JP/Dn8lIamoobej7qsvP7qIx2+dwgfX9+Pzt/bh01sjuPvaOO5fP46e5lXwdnO6<KEY>
"locaText": {
"polish": "Płaszcze futrzane",
"english": "Fur Coats",
"taiwanese": "皮草大衣",
"brazilian": "Fur Coats",
"russian": "Шубы",
"chinese": "皮草大衣",
"portuguese": "Fur Coats",
"french": "Manteaux de fourrure",
"korean": "모피 코트",
"japanese": "毛皮のコート",
"italian": "Abiti di pelliccia",
"german": "Pelzmäntel",
"spanish": "Abrigos de piel"
}
},
{
"name": "Windows",
"guid": 1010207,
"producers": [
1010285
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAV5ElEQVRogc2aeVRU55rut2by5CRRDEUVe6oBjcY4IjgwiMyjilAyU0xFMRfFVFAFBQVVzPMoUyEziICoQaQYFI3GxBg1gxlP+pihT+ecpLNudxI7Tk//ATmn+65e597TcO7tZ63vn713rb1/663vfb73+16C+Ptp1dJYvTSe+t/Gr9d/fe5/jH796KcJgniOy+X+dv369S/RNL1+A4/HEZoJuUL<KEY>+++<KEY>",
"locaText": {
"polish": "Okna",
"english": "Windows",
"taiwanese": "窗戶",
"brazilian": "Windows",
"russian": "Окна",
"chinese": "窗户",
"portuguese": "Windows",
"french": "Fenêtres",
"korean": "창문",
"japanese": "窓",
"italian": "Finestre",
"german": "Fenster",
"spanish": "Ventanas"
}
},
{
"name": "<NAME>",
"guid": 1010208,
"producers": [
1010286
],
"icon": "data:image/png;base64,i<KEY>//<KEY>4yzHOkGh2KQWxXepQqEV<KEY>LsGq<KEY>DdPrNIAghXSQjIwVRKodP9ByE5+Un8aL6Aloa0tF<KEY>
"locaText": {
"polish": "Żarówki",
"english": "Light Bulbs",
"taiwanese": "燈泡",
"brazilian": "Light Bulbs",
"russian": "Электролампы",
"chinese": "灯泡",
"portuguese": "Light Bulbs",
"french": "Ampoules",
"korean": "전구",
"japanese": "電球",
"italian": "Lampadine",
"german": "Glühbirnen",
"spanish": "Bombillas"
}
},
{
"name": "Sails",
"guid": 1010210,
"producers": [
1010288,
101265
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAXcElEQVRogc16d1iUZ772q8aY5MSGDDPz9pmxxBSTnGTTNs1NNTFZV0MsYAEVpSN9hs4w9CoovYMN6SCgVB36CIj0MhSp1hAlak527/MH5Jyc79ucL6bs9d3XNX/NvHM993s/v/4jiD8OiwiCeJwgiCUEQTxGEMSCR3h2AUEQC+f/Y+EjPvu7YrGOjs4yiZ6eUKKnJ9TV1V1KEMTin/ntj4deSMwRXiIUCv9t5cqVy+lltI505crlBEE8Mf/9vxQLdXR0lokEAv03N0hvkXp63iRJPiOVSpcT//2GF/300Do6OssoilpFr6IpKU2v4UjuZV5Mf0rp6R3mafp1kiRZkiSfIv7FyjxGr6Kpz95cjwIffVj/9U/3JQzzJaPHyFbMQyQSCSiKoimKWsuy7CsShnmHEYmMeIZJcrLY92DPhy/N1Kd7ofFsEHZ/sGGWo7iNenp6wnnyfzgWEASxkCTJp3iSf+bjP62Dw99eheHG5x7KGM5eyrIfMgzzKk/T73M0/RkjFqs+fPcNjDTn4YRiG3IUW5Bh9znyQy0QbPoZnHa8g4p0NwgFgmkJxx3gSfIZYu6K/W6qLCD+571ezPP8Ezo6OstIktTlhEKJlGI/+PhP62C/5RUc+vw1sDTd/Pa<KEY>",
"locaText": {
"polish": "Żagle",
"english": "Sails",
"taiwanese": "船帆",
"brazilian": "Sails",
"russian": "Паруса",
"chinese": "船帆",
"portuguese": "Sails",
"french": "Voiles",
"korean": "돛",
"japanese": "帆布",
"italian": "Vele",
"german": "Segel",
"spanish": "Velas"
}
},
{
"name": "Chassis",
"guid": 1010211,
"producers": [
1010289
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAW1UlEQVRoge16aXRc5ZnmNWY1IFmi6q7fcpfaF1VZu0pVpZJU2q3dWqzNkrVZsjYv8oY3bGOMbSAGYmwDBmJMSBPAQENnacgE+hCYId2ZhoQDaUI2YJoA6QBhMbae+SGRYGLSQDgzPefMc879VefcW8/37s/7CcL/x//bmCcIwnxBEM4ngnCRKqgLVFVdIAjC+YIgnDv3+395zBcEYYEsy3bOucEY8+uaFiaEBBljpiRJ4hyp+cJXR+icTzx/M+YJgnBeSkpKOlcUr05pu89j/fGK7Stx08EtqKqMQZPlo5yQasaYn6SQdEEQzhO+PJlzBEE4jxBykSM9PWXhwoUL09PTU4ggXCT8jYd0vqqqNqoosb5lTT9/5plv4Zt378KOK4ewYboN69a0YN2mTtTURk9RRbncICRXkiTxS5KZb7fbL<KEY>
"locaText": {
"polish": "Podwozia",
"english": "Chassis",
"taiwanese": "底盤",
"brazilian": "Chassis",
"russian": "Шасси",
"chinese": "底盘",
"portuguese": "Chassis",
"french": "Châssis",
"korean": "차체",
"japanese": "シャーシ",
"italian": "Telaio",
"german": "Fahrgestelle",
"spanish": "Chasis"
}
},
{
"name": "Clay",
"guid": 1010201,
"producers": [
100416,
101267
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAX60lEQVRoge16Z1RU6Z<KEY>QCqpqh28<KEY>0<KEY>0J<KEY>iLZ2zlciErcRN2ErcWVtzclRlIfbaSkIlYZhlZiwbJrKiG03TljKZTCmXy9/5jwI0g6KoN1iKmqNQKExEmrZklWyiv<KEY>",
"locaText": {
"polish": "Glina",
"english": "Clay",
"taiwanese": "陶土",
"brazilian": "Clay",
"russian": "Глина",
"chinese": "陶土",
"portuguese": "Clay",
"french": "Argile",
"korean": "점토",
"japanese": "粘土",
"italian": "Creta",
"german": "Lehm",
"spanish": "Arcilla"
}
},
{
"name": "Sewing Machines",
"guid": 1010206,
"producers": [
1010284
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAY8ElEQVRogc16d3RU173uwV3SzJxz9t7njBhAEk1UUSTUUEG9SyNpRlM0GkmjMkV1VFFFHUkgBALRRAeBaTa2wdhgMDaxTdxLYsdZThzfe53c3Jv42tfXSWznPX/vDw15xC2+b62X3N9ae82sObPOOt+v7d/37cNxfx+bxXHcvZIkKXx8fNQyzy8khCwnh<KEY>",
"locaText": {
"polish": "Maszyny do szycia",
"english": "Sewing Machines",
"taiwanese": "縫紉機器",
"brazilian": "Sewing Machines",
"russian": "Швейные машины",
"chinese": "缝纫机器",
"portuguese": "Sewing Machines",
"french": "Machines à coudre",
"korean": "재봉틀",
"japanese": "ミシン",
"italian": "Macchine da cucire",
"german": "Nähmaschinen",
"spanish": "Máquinas de costura"
}
},
{
"name": "Bread",
"guid": 1010213,
"producers": [
1010291
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAATYklEQVRoge2ZaVAWV7rHG42ZrCqE1/fl7T7ndPfLvu/ry6KsguybIIsbAgIaQ1TAfUHcBREUFQVUENzQRNHEDQRl31cxkrl3MjVTd+reqqmpO7dmyf9+gEymZskkM05yq+78q051f+gP/evnnOd5+v9w3A8nnT9a/9K/9E+QDsdxsziOmz2zXvuj+1k/4Ht9<KEY>",
"locaText": {
"polish": "Chleb",
"english": "Bread",
"taiwanese": "麵包",
"brazilian": "Bread",
"russian": "Хлеб",
"chinese": "面包",
"portuguese": "Bread",
"french": "Pain",
"korean": "빵",
"japanese": "パン",
"italian": "Pane",
"german": "Brot",
"spanish": "Pan"
}
},
{
"name": "Beer",
"guid": 1010214,
"producers": [
1010292
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAASvElEQVRogc1aaVSUV7a9qLFjEhXoKqrqq2+qKkQGhxiVOLbtM61tYiZNYmI6AsZZExMziSCiIIojgyIBARkEGURmKCYBRUQmmWWeZwUBmatqvx/Q76XXej/eexLTe629zldr1Y+z1zn33nPuuYS8XGj9hlMmqPWSffh/Q4sQMpUQMl0kEr2uq6s7i9fW1tbR0ZktFArfoAmZQQiZPvGff1tRWoSQV3ie15ZIJJyMli3gpfwyGcOsVrDsSjnDLGVZ1oTneV4sFgtFItHrhJBXyL+ZIC1CyHSFSKRHi8UbHR1tHqelR6KjqwQDg7VoaStCdEwg7O2t6pcuXuzD0fRGGU0v4AQCyYSgqX+0gH9imlQq/TNLUSuLi1PUQAM0aAAmqNE0Qq1uwpiqGaNjzRgYbsY8E5NaTip9j6coQ16b1yb/BtGZqq+rP4um6QVbP/24Rq1pxOBIKwaG29Da8wyDI21QqxsxpmrCqKoZw2MtGBxtxcBIG6Jib4Gj6IMcRS0Si8VCQsirZHxTePkiBALBTJ6iDBfMM0pSqxtR1zmArr6nqG4fQu9gBzSaRoyMNaP7eRcGRtowONqKwZFW9A914NlAJzy8rqp4mv6Zp+k1tJDW19HRmU3GN4SXJmiKUCh8QyqVGhgbGiQ9epQElboR/<KEY>//<KEY>
"locaText": {
"polish": "Piwo",
"english": "Beer",
"taiwanese": "啤酒",
"brazilian": "Beer",
"russian": "Пиво",
"chinese": "啤酒",
"portuguese": "Beer",
"french": "Bière",
"korean": "맥주",
"japanese": "ビール",
"italian": "Birra",
"german": "Bier",
"spanish": "Cerveza"
}
},
{
"name": "Goulash",
"guid": 1010215,
"producers": [
1010293
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAAN<KEY>sk<KEY>beg<KEY>BhjobaW1WCCTjOJylGNSlJuaolzSNK3BJIoJo9FYodPpNEEQdF8A+oMALBcEYZUoiqIsyw5JkuKKorRoqvotl8POa7ducOrgBAfnN7F9apjBgTU0NTeSyqRIZjJkq6vJFQoUW1sZGB<KEY>VL1+8T/sBNZ/8HkLgWkP7U/<KEY>5CYII=",
"locaText": {
"polish": "Gulasz",
"english": "Goulash",
"taiwanese": "紅椒燉肉",
"brazilian": "Goulash",
"russian": "Гуляш",
"chinese": "红椒炖肉",
"portuguese": "Goulash",
"french": "Goulasch",
"korean": "굴라시",
"japanese": "グーラッシュ",
"italian": "Gulasch",
"german": "Gulasch",
"spanish": "Goulash"
}
},
{
"name": "Canned Food",
"guid": 1010217,
"producers": [
1010295
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAVqElEQVRogc2ad3RUZd7HL21FVxFChklm5t47M6GFRcEQIHVmkkmdyaRNeiEkJKRBGiGEkJBKEhJChyzSifQYQBRBBRFEBSywdlhBlHWRqoI0y+f9A/R19y1nQX3f/Z7znHPPuX99zq//nkcQfr263T3d754ev/j+6d+/vXoIgvCAo6PjIxqNxsFFqRyg0+mULkrlALVa3b9v3759FQrFw4IgPCgIQi/hPyH/reB69evX71FZqdTpRdHdRZb99aK2WC/KJVpRjNdJUqBeknwkZ2mULMuuKpVKclEqBzg4OPTRarW9hTtg/+9QPTQajYMsy/6RcYmXJlc1UNaygLwZtWSWTienvJqJZVWMLyglKmncj6<KEY>",
"locaText": {
"polish": "Konserwy",
"english": "Canned Food",
"taiwanese": "罐頭食物",
"brazilian": "Canned Food",
"russian": "Консервы",
"chinese": "罐头食物",
"portuguese": "Canned Food",
"french": "Conserves",
"korean": "통조림",
"japanese": "缶詰",
"italian": "Cibo in scatola",
"german": "Fleischkonserven",
"spanish": "Comida en conserva"
}
},
{
"name": "Schnapps",
"guid": 1010216,
"producers": [
1010294
],
"icon": "data:image/png;base64,i<KEY>aW4BUhvrTL0GiGRZJ8kiRXKc0<KEY>
"locaText": {
"polish": "Alkohol",
"english": "Schnapps",
"taiwanese": "烈酒",
"brazilian": "Schnapps",
"russian": "Шнапс",
"chinese": "烈酒",
"portuguese": "Schnapps",
"french": "Eau-de-vie",
"korean": "슈냅스",
"japanese": "シュナップス",
"italian": "Liquore",
"german": "Schnaps",
"spanish": "Licor"
}
},
{
"name": "Sausages",
"guid": 1010238,
"producers": [
1010316
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAATeklEQVRoge1aaVQUZ7oujca4Qq9VXfV9tXQ3yL7a7DvIKi644UJEjUZxQ1BxJa4oRlFGBRUVlYAYNYo7o+Zq9sWYbWIS10RFkVVj0u3NnfjcH41es0xmJmNm5p4zzznPqe/Uqe7+nnrferdqhvkP/oP/d2jXxva/wofX/Nvg4YafYhjmaUJIZ51O102lUjmIoqgihKh/xB5E7eDgoFKr1T1Yhukqy/IzDMN0bPv8P13Yw8135Hm+i4ODg4pSylM9NVFKPYyUWoyiGCYKYqxgMGQIHPfsQxpFMU4ShGhJkoIlnvdVeL4nz/OU53mtTqfrxjDM08z/Wex3FdCBMExn0qOHWjEYJImX/IjBMMDDJK+1uJgvTO0bjUNzn8PNzfPRUDYft0rycLM4G9dXTcLV<KEY>",
"locaText": {
"polish": "Kiełbasy",
"english": "Sausages",
"taiwanese": "香腸",
"brazilian": "Sausages",
"russian": "Колбаски",
"chinese": "香肠",
"portuguese": "Sausages",
"french": "Saucisses",
"korean": "소시지",
"japanese": "ソーセージ",
"italian": "Salsicce",
"german": "Wurst",
"spanish": "Salchichas"
}
},
{
"name": "Champagne",
"guid": 120016,
"producers": [
100659
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAS4klEQVRogdVaeXBUdba+AQJJb0mH7tzue+/vd7fudLo7W6dD9o2wBAiQgOwCQQghQAiQsCeELBD2AEkkLAohgBAEZRfHB4iAo4KCMqMiCow44AI8VFwQxu/9keDM/POqHjjq+6pOdVVXV9f57tnPuQzzx4YPwzDt2sTnd9blkdCOYZiOJp<KEY>
"locaText": {
"polish": "Szampan",
"english": "Champagne",
"taiwanese": "香檳",
"brazilian": "Champagne",
"russian": "Игристое вино",
"chinese": "香槟",
"portuguese": "Champagne",
"french": "Champagne",
"korean": "샴페인",
"japanese": "シャンパン",
"italian": "Champagne",
"german": "Sekt",
"spanish": "Champán"
}
},
{
"name": "<NAME>",
"guid": 1010218,
"producers": [
1010296
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAARB0lEQVRoge2aeXRb5ZnGb5xACEu81LKk79773Xslr7KT2IlXWbblRV5iO4kT4zh2vMi2LNmWtW/e7chL4<KEY>",
"locaText": {
"polish": "Stalowe belki",
"english": "<NAME>",
"taiwanese": "鋼梁",
"brazilian": "Beams",
"russian": "Стальные балки",
"chinese": "钢梁",
"portuguese": "Beams",
"french": "Poutres d'acier",
"korean": "철재",
"japanese": "鉄骨材",
"italian": "Travi d'acciaio",
"german": "Stahlträger",
"spanish": "Vigas de acero"
}
},
{
"name": "Steel",
"guid": 1010219,
"producers": [
1010297
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAARTElEQVRoge2aeVQUZ7rGPzXGxCwqARurq+qrqsYtixvQe0Oz72jcghoEF5Ctodl3mmZrdmhWWRRRUURFUaMmmk2jZnEyJ5nsy82dk0nMxDvjmMk9Se5M5rl/dIOTe+aPhJhlzrnvOe+hu+CP+vXzPc/78VUT8v1rCiFkKiHkDkLInSwhd8tksnvc3Nzulclk9xBC7iKETCeETHP+7b9NTfkX/f/171hTiGP53Ukcy3GG8/UdzutT/6l/tSpPJYTM4Hl+zrJliwSJZeezLDufyqgol8tZce5cmVwuf2D27Nmz3dzc7iWEzPTw8JhBHJBTf9lbv1XTCCH3iKJIQ4P8so6OHvlTcWnJ9djH417TaXTnFJT2STxfpuC4eCqnfpRhtJShK0RRXEhdXec5A2XaLw7hRsi9LMt6rFi2rOPcxd/i5FPnYe8bRH1XP+q7dqF94ABsbT3o3juCmtZupGQVYPW6DTAYfL9WcEKMgmU9nCr9Ysrc4eLicr/IMAsfXLjo<KEY>",
"locaText": {
"polish": "Stal",
"english": "Steel",
"taiwanese": "鋼鐵",
"brazilian": "Steel",
"russian": "Сталь",
"chinese": "钢铁",
"portuguese": "Steel",
"french": "Acier",
"korean": "강철",
"japanese": "鋼鉄",
"italian": "Acciaio",
"german": "Stahl",
"spanish": "Acero"
}
},
{
"name": "Weapons",
"guid": 1010221,
"producers": [
1010299
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAVB0lEQVRoge2aeWzb53nHf77jWBZFiuSP/PF3khRvird4iBRvipR4iKJO0rovH7Ity5JsRb5k2VLs+HbsOIlj53CbpkmbNGmLNMva9UA7DMOKYd2GYevWDuiODOvWrTfSfveHZKNpkzgFtiYF9gXev4gf8Hze5<KEY>
"locaText": {
"polish": "Uzbrojenie",
"english": "Weapons",
"taiwanese": "武器",
"brazilian": "Weapons",
"russian": "Оружие",
"chinese": "武器",
"portuguese": "Weapons",
"french": "Armes",
"korean": "무기",
"japanese": "武器",
"italian": "Armi",
"german": "Kanonen",
"spanish": "Armas"
}
},
{
"name": "Dynamite",
"guid": 1010222,
"producers": [
1010300
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAX60lEQVRogc2aaXQU55nvSyCptfXe1bW9S1X1rlZrl5AAIQmEhIQQWgCxg4VZxS7JCIQkFrEZs5kWu8DsO9h4N0mceGLPdTLxOJnMOOM4k3Myi3Mm90xubq5zPLGT//0g4fHkeMEzycw859<KEY>",
"locaText": {
"polish": "Dynamit",
"english": "Dynamite",
"taiwanese": "炸藥",
"brazilian": "Dynamite",
"russian": "Динамит",
"chinese": "炸药",
"portuguese": "Dynamite",
"french": "Dynamite",
"korean": "다이너마이트",
"japanese": "ダイナマイト",
"italian": "Dinamite",
"german": "Dynamit",
"spanish": "Dinamita"
}
},
{
"name": "Advanced Weapons",
"guid": 1010223,
"producers": [
1010301
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYMUlEQ<KEY>jTVdr3fyKgMgOU2jbJ<KEY>6W5j6KoCTRNTyJTp07z8/OTyeVyX29v7ymCIDxIUdREQRAe9PHxmcxMZh7mOI4WBCGI0LS9ZsERNAw8g/qlT6<KEY>
"locaText": {
"polish": "Zaawansowane uzbrojenie",
"english": "Advanced Weapons",
"taiwanese": "高等武器",
"brazilian": "Advanced Weapons",
"russian": "Усовершенствованное оружие",
"chinese": "高等武器",
"portuguese": "Advanced Weapons",
"french": "Armes lourdes",
"korean": "고급 무기",
"japanese": "最新武器",
"italian": "Armi avanzate",
"german": "Schwere Geschütze",
"spanish": "Armas avanzadas"
}
},
{
"name": "Steam Motors",
"guid": 1010224,
"producers": [
1010302
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAW00lEQVRogcV6aZQ<KEY>
"locaText": {
"polish": "Silniki parowe",
"english": "Steam Motors",
"taiwanese": "蒸汽機",
"brazilian": "Steam Motors",
"russian": "Паровые двигатели",
"chinese": "蒸汽机",
"portuguese": "Steam Motors",
"french": "Moteurs à vapeur",
"korean": "증기 모터",
"japanese": "蒸気モーター",
"italian": "Motori a vapore",
"german": "Dampfmaschinen",
"spanish": "Motores de vapor"
}
},
{
"name": "<NAME>",
"guid": 1010225,
"producers": [
1010303
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAXyUlEQVRogc2ad3Rc5Zn/r22wvWZxQzN35t77vreNpmiKZjRdGs1oqnrvtqxmq9lqLkKSLcvGtnAvGOOCAxgCJJjYpoW1MRBKCpAASVg2Idms4fyWHyRhCZuEwBrw9/eHRDEGfsHJ2d3nnO8fc2bOvPdzn+e9T7kvw/z32LQv0f9qm8YwzHSGYa5gGOZKhmFmcxw3Z+HChXOl+ZO2cOHCuSzLXsUwzGyGYWZO/XY68z8M9/GFX8kwzCyWZa+S5s+fL2u1LMdxVOF5o8zzmZIg+GVCcmVCciVeCkg875Q4ySzr9aKs1bLS/PnzOY6bw0yCzfgc1Gdvzsea/vcEuJJhmKs4jkuTZVmklGZIguCnPF/Ls+yEx+26r6a6/BcDfT0fHbhxFx5++BR279mBTZvWY2l7yzvJROwnEqW3CSzXRymNq5S6BY3GIGu17MKFC+cyDDNr6qJnLliwYB4hhOM4joqiqJ/6/sq/B8RMnU6nMVCaoVCa0LPsyYDPg+3bNuHb37oN9x7/Jk6evBtrD29EZKwG2i4npAIKVZSgihKcTjfC0QIs7e7F0VuP4uChG+Hzut8XdLobFVEsJoR4iVarylotK2k0OqLX5/J63bOcjv25wOmu5XneqNFo/pH5Gz0zQ5o/f75EyKHurvYP9t+wHSPbRtDS0o<KEY>
"locaText": {
"polish": "Pojazdy parowe",
"english": "Steam Carriages",
"taiwanese": "蒸汽車",
"brazilian": "Steam Carriages",
"russian": "Паровой транспорт",
"chinese": "蒸汽车",
"portuguese": "Steam Carriages",
"french": "Automobiles à vapeur",
"korean": "증기차",
"japanese": "蒸気自動車",
"italian": "Carrozze a vapore",
"german": "Dampfwagen",
"spanish": "Carruajes de vapor"
}
},
{
"name": "Brass",
"guid": 1010204,
"producers": [
1010282
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAATxklEQVRoge1aZ1SVZ9Z91CSWGEXCbW9/L5aIJVZERUVEgg2s2BCQ3ouIIqIUFUFBQKQpCIIU6R2kXZooooAo9pix6xhT/CbJlJj9/bhoZiaZ+ZJMxuTHd9Y6665177prvfs8e59znnNeQv7f/iPrTwh5mxAyiBAymBAykBDyTt93A/q8PyGkX5//Lq0/RaghUqlUpmSYUYIgfMAwzChBLggMw9CiVCqjafp95YgRwyUSyVCiBvs2UQP73Vg/QshgQS4IxvPGXfBzM4SDxaw/rlg0qUtvyqgyhVSeQMtkO2iatuRper5A03ocx41jWZaSEfIu+R2BeVsqlco4Wr66/pQNVPm2aC1xxNkyJ5wpcURbqRMa8+3QVGiP1mIHnIhZA/sNeqBp2pzVYimiPpnflGr9CCEDNDU1h3EcNzVs<KEY>
"locaText": {
"polish": "Mosiądz",
"english": "Brass",
"taiwanese": "黃銅",
"brazilian": "Brass",
"russian": "Латунь",
"chinese": "黄铜",
"portuguese": "Brass",
"french": "Laiton",
"korean": "황동",
"japanese": "真鍮",
"italian": "Ottone",
"german": "Messing",
"spanish": "Latón"
}
},
{
"name": "Coal",
"guid": 1010226,
"producers": [
1010298,
1010304
],
"icon": "data:image/png;base64,i<KEY>OH3+25g8cAlb9j6O8amH0DNy<KEY>",
"locaText": {
"polish": "Węgiel",
"english": "Coal",
"taiwanese": "煤",
"brazilian": "Coal",
"russian": "Уголь",
"chinese": "煤",
"portuguese": "Coal",
"french": "Charbon",
"korean": "석탄",
"japanese": "石炭",
"italian": "Carbone",
"german": "Kohle",
"spanish": "Carbón"
}
},
{
"name": "Iron",
"guid": 1010227,
"producers": [
1010305
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYN0lEQVRogc1aaVRUV7a+auwkdqKCFFV1h3OHKoZirmKmoAaGYqaY50lQUZEZERRUJkUERQQVUQHnORrHOHbM1Ek0iTHmmTZTp6NJd/KSlZeOacfv/YDYWf3s1+nXyXtvr7VX/bi11j3f2fvbe5/vXIr6ZWwcRVHjx37H/ULv+EVtPEVRT9ja2k4mU6bY2NjYTJHL5b+mKOpXFEVN+D9e20+2CXZ2dk8LCkFgFIo0gRWMKkL0IsN40jRNBEGYSlHU4xRFTRzzx6hRcP9vIjaOoqiJNE3bESXxDo1Kula8dAT5DZuQMr0BQaEJtziGaRFY1p/I5ZIgCAIvl4s0TXMqudzezs7uaWoU4P8pqIcg3Lx8g/LmLEbx0h1YvudzdOz+BB073oMlOAycQvGtyPPzGZruV9rbX1PIZA8YubKHZ9lonqZ1PM+LDMNMk8lkT1EU9QQ1GrHx/5tAJqrkKvuE6RW5/XvO3Nly+jO0DryJ5t7zqGrdj4SYTGjVKkT6+aA+NxMr58xAW3EBSq1xmBWfgPzkHOgcHd+nFYqVKpaNEhgmQMVxbjRNc7a2tpOp/yVejbelbCe7e3mVvvfJTTx/7Qu0V<KEY>
"locaText": {
"polish": "Żelazo",
"english": "Iron",
"taiwanese": "鐵",
"brazilian": "Iron",
"russian": "Железо",
"chinese": "铁",
"portuguese": "Iron",
"french": "Fer",
"korean": "철",
"japanese": "鉄",
"italian": "Ferro",
"german": "Eisen",
"spanish": "Hierro"
}
},
{
"name": "Zinc",
"guid": 1010229,
"producers": [
1010307
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAXO0lEQVRoge1aeVSTd7r+3KaddqxFIyHflu8LCkLCTgIhCYGQEPYtYV8TCPsOiisKsiMqQhE3VLQtLl0UcUPFfcG1VluttrU6c52Z9s7SM+eeO3NP57l/QJ3Onc7Uzm3vvX/c55zf4Y+cw/k9v3d73vf9COL/8aNiCkEQU79xpvzvXucf479edhpBED+hafqnAoFgJsuydhRFzbGzs5tFE<KEY>
"locaText": {
"polish": "Cynk",
"english": "Zinc",
"taiwanese": "鋅",
"brazilian": "Zinc",
"russian": "Цинк",
"chinese": "锌",
"portuguese": "Zinc",
"french": "Zinc",
"korean": "아연",
"japanese": "亜鉛",
"italian": "Zinco",
"german": "Zink",
"spanish": "Zinc"
}
},
{
"name": "Copper",
"guid": 1010230,
"producers": [
1010308
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYXElEQVRoge1ad3RUZfq+CIJrARIymZl77/fdMr2XTHqb9F5JJYVAEjoJgZDQS4iU0HtX6UuTJlVFBaQuggjSBNYuCigWREWe3x9Et+rirnv2n997zntmzj1nz<KEY>
"locaText": {
"polish": "Miedź",
"english": "Copper",
"taiwanese": "銅",
"brazilian": "Copper",
"russian": "Медь",
"chinese": "铜",
"portuguese": "Copper",
"french": "Cuivre",
"korean": "구리",
"japanese": "銅",
"italian": "Rame",
"german": "Kupfer",
"spanish": "Cobre"
}
},
{
"name": "Cement",
"guid": 1010231,
"producers": [
1010309
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAWjUlEQVRogdWad1yVZ7bvX2<KEY>aWpqqtCYmWlkWX7OUpZfUqtUr1nI8p/VknS0c/AipWfGSK/uJzKvlfC0CrSi+V9+/+<KEY>
"locaText": {
"polish": "Cement",
"english": "Cement",
"taiwanese": "水泥",
"brazilian": "Cement",
"russian": "Цемент",
"chinese": "水泥",
"portuguese": "Cement",
"french": "Ciment",
"korean": "시멘트",
"japanese": "セメント",
"italian": "Cemento",
"german": "Zement",
"spanish": "Cemento"
}
},
{
"name": "<NAME>",
"guid": 1010233,
"producers": [
1010311
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAWDElEQVRoge2ad1TWV5rHf5riTGYmogIv/Pr7gtgoAlKliUivAiIK0<KEY>iy1<KEY>//ldo92<KEY>J<KEY>fy<KEY>7FhRiq97j4eaLGeZVNXH2tpas7Cw+K0gCM/9s8/9H1i4MPeF028v0W5cPZS3ddOspEAf98STJ7awe3Eolw8M5eK+VI61xrN3cTgbZ0cTFWD6VBeVZKNo7NbN3Px3wr+IZdodPTpHvHZxS9lXt09eOPjmmu/Wtc7j22/<KEY>
"locaText": {
"polish": "Ruda złota",
"english": "Gold Ore",
"taiwanese": "金礦石",
"brazilian": "Gold Ore",
"russian": "Золотая руда",
"chinese": "金矿石",
"portuguese": "Gold Ore",
"french": "Minerai d'or",
"korean": "금광석",
"japanese": "金鉱",
"italian": "Minerale d'oro",
"german": "Gold",
"spanish": "Mineral de oro"
}
},
{
"name": "Tallow",
"guid": 1010234,
"producers": [
1010312
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAS1UlEQVRoge2aZ1SUZ9rHH2uKJgphmJmn3M/MgDHGGOOemMS1JLtm08yqa91EjRUQBKVKkyIdKaLYBVQQFUvsXZpImYFhhhkYei8iTRDQRLP7fz/MiLDGrL6b7O6Hvc65z5mZT9fv+V/1foai/mf/s//Zb2mDfuYMpihqKEVRwwxnqOG3/xrr7+wQiqKGCwSCkTIjo1HmxsavC4XCEUKhcAQhxEgiEIikYjEvEYkkEoFAZGJi8hpFUS9RT6AG/bsdf/x0X6Jp+lUBJRg5evTo0UKh0JRlWXNOzM3gaHouoelpMjH3vpRlPyAiZtH4cWNCp344qenrL6e38yw/TyKRfMQwzJuciQktGT16NEVRLxsexm8OMJSm6FdZljXmTExoIiQyGctOkHHcZBkh03gxO2/mJx+p83MS0dZwHZGhjj2ciI6LCN7QU1mYhI7b19HRdA11JSeRGOvzyGr1vFqhqel1jmHWmhEylTPlzFiWNab0Kv1mQEOMjY1fF4lEnzAi0XJzicTtq88/Vu+J3oS8rEQcivFD1500NJafQZX2KMpVCWiuPo+ullQ0lH2P+tJTaG+6ho6ma2hvuIJS5SHUlZxEc9U5NFefg6fLip84MeMoo8k0QoisH9CvnkfDZTRNLp7djfZmOR49KMOjB2V40CXH/c5s9HRkorstAz1tt9DTnoHutpu415q<KEY>",
"locaText": {
"polish": "Łój",
"english": "Tallow",
"taiwanese": "動物性油脂",
"brazilian": "Tallow",
"russian": "Сало",
"chinese": "动物性油脂",
"portuguese": "Tallow",
"french": "Suif",
"korean": "수지",
"japanese": "獣脂",
"italian": "Sego",
"german": "Talg",
"spanish": "Sebo"
}
},
{
"name": "Flour",
"guid": 1010235,
"producers": [
1010313
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAWG0lEQVRoge2aZ1SVZ7bHXzXVjNIOnHPe/p5z6CC9dw5Ih0Mv0otUkY6CFAUUQbAgCKIoTUFsKCBqDMZuT<KEY>Zj<KEY>8/<KEY>PlJOfIsqwxSZKMhoaGmkKheHUG6B/u1Mv04sWaMorSYylWaWNmXB3obff07uW9ePfkJhzbFo+RxnDsr1NhYG0w9lQFoKPMG/WZdrA3keDM0<KEY>
"locaText": {
"polish": "Mąka",
"english": "Flour",
"taiwanese": "小麥粉",
"brazilian": "Flour",
"russian": "Мука",
"chinese": "小麦粉",
"portuguese": "Flour",
"french": "Farine",
"korean": "밀가루",
"japanese": "小麦粉",
"italian": "Farina",
"german": "Mehl",
"spanish": "Harina"
}
},
{
"name": "Malt",
"guid": 1010236,
"producers": [
1010314
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAThklEQVRoge1ZeXRX5Zm+AUFUxCT8ttz7bffe3y8h+76H7CvZ95CFbCRkXyAJIQkhAgmEsIQAgQBBQBaRRQQZxAVFsRYX1Grdaqu12jqtnbZnnKm11mf+SOzxjFtHbadzxuec76+7nO+57/c+93nfV5K+<KEY>",
"locaText": {
"polish": "Słód",
"english": "Malt",
"taiwanese": "麥芽",
"brazilian": "Malt",
"russian": "Солод",
"chinese": "麦芽",
"portuguese": "Malt",
"french": "Malt",
"korean": "맥아",
"japanese": "麦芽",
"italian": "Malto",
"german": "Malz",
"spanish": "Malta"
}
},
{
"name": "Work Clothes",
"guid": 1010237,
"producers": [
1010315
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAWZ0lEQVRoge2ad3BWZ5bmL8bGYRqTJH3fd/P9JIEACwTKOWcJCUWEItKnLJQQSCjLCCGEJBBKiCARBIicDdhgA44YZxu33dPj6ZqardqdqQ21VT1V3W77t38gz3bvbtdO19K9vVX7VL11/7pv3eeec97znHNeQfj/+N9ijiAIz8w+/5/EHEEQnhMF4SWnxYtfXrx48cuiILzk5OT0vCAI8wRBeE4QhGeFv3KSzwiC8ILJZHLQRG2tZDan6bLsbUjSalEUl6mqatXNZl1RFHHRokULhCfE/urIPCMIwotWUVQli6X0k49u8I//8JCrlyfx9/VAspi/Ec3mn4tm82PRYvqFVVE8dXvdLAjC88JfAZk5wn+PhRdFUVQs9qYd165MkpkcSX5aLHVlOUwMd/P143t8+OFtPnx4k/MXTyJZLHs1UfNzcHAwCYLwwuwe/1cIPCsIwvP29vY/k19+ebHFYtEsJlPPr757j+hgL1JigynauI6y/HSqy/LZt38vXR3befTwFsOjw/j5+f6jKsrtqiSFqyaTdeHChQuFJ9b5ixCaIwjCs6IovuTg4GCyStJSQ5a9rJIabqhqmmyxTNy+fYHujjqigr0ozUul0raRuspCdu7s5NZrJ7l58xxDw0PkFOSRujGT5cuX/<KEY>
"locaText": {
"polish": "Ubrania robocze",
"english": "Work Clothes",
"taiwanese": "工作服",
"brazilian": "Work Clothes",
"russian": "Рабочая одежда",
"chinese": "工作服",
"portuguese": "Work Clothes",
"french": "Vêtements de travail",
"korean": "작업복",
"japanese": "作業着",
"italian": "Abiti da lavoro",
"german": "Arbeitskleidung",
"spanish": "Ropas de trabajo"
}
},
{
"name": "Glass",
"guid": 1010241,
"producers": [
1010319
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAVz0lEQVRoge2aZ3SUZdrHH4qICqROZuZp88wELCAgTUAUpIqQQBopk2R6n0ym12QmM+m9dyAh9CKEIsIqKIIg7qqopCckVBVYQKQIArneDxPQfd93VVb37O45e53zP/NlPvx/93Vf93PdBUH+G/+N/7gYjCDIUARBnkAQZNjA79ABDf6ZBg3o3zKG0Gi0EewgNp3NZrNYLBaboigKDwjAKIpijGYwaBiGBVC+vr7+/v6jaDTaCBRFn8YR5CkEQZ5E/hZ8CPIvgh7q5+fnQzIY4ya//NqHkbEJhx2e7MNyQ/qfFoeL13Go0R6cjkooilrMIcn5bIKYzcKwmSSTOYWN4xNIBmMsjuNjSJLkoChKEASBBgUF0VEUDSRJ0i8wMHDkuHHjhg2A/dNisL+//yiSwRjLZj/3laVww7sad9HO9XsPf/GXnkvXPur45sp7X569tO+z05f2f37+2o6j3d8XNO66rbBk3V0SkXh/2ozZD8a+OKnn+ecnHBwzZuxqDjU6h0BRFYlhfBLDotgEsYhkMqcEBARgCIIM/2fBDKYjyDMYhj1LUdQugcHdLDSmbxeZ05vFpvTd6/Z/0rV2//HutfuOd6/Ze+xU096Pe9fsPdrX+PbR02v2fHSmcfeRsw17Dp9r3H3kfHb9lu6EJOtnfF3al4nJztZYmakzSqTtDeOp<KEY>",
"locaText": {
"polish": "Szkło",
"english": "Glass",
"taiwanese": "玻璃",
"brazilian": "Glass",
"russian": "Стекло",
"chinese": "玻璃",
"portuguese": "Glass",
"french": "Verre",
"korean": "유리",
"japanese": "ガラス",
"italian": "Vetro",
"german": "Glas",
"spanish": "Cristal"
}
},
{
"name": "<NAME>",
"guid": 1010242,
"producers": [
1010320,
101296
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAXF0lEQVRoge2aaXBUV5qmr7ey3RgsZEmpvHtmSmhXKiWllErt+4o2QBtCC2iXAIGEFiQQEiAkFgEGDLYpbBYLYxtsVoEWJITYjDG2q13dET1bzER1T0zEdM9M1ET19PTUMz9EObp6bLyUf3RHzBtx/pybkXHe+933/b7vnCMI/x/f4Jl/Mv5V4llBEH5hMBgWuLu7v2IwGBYIgvCSIAi/EAThuSfPfyjBZ578/p+PZ75l/Kx4RhCEl41Go2b08EhXjMZwXZJCTKLJx2g0arq7u6eqqovd3NwWCoLw8<KEY>
"locaText": {
"polish": "Okładzina drewniana",
"english": "Wood Veneers",
"taiwanese": "薄木片",
"brazilian": "Wood Veneers",
"russian": "Шпон",
"chinese": "薄木片",
"portuguese": "Wood Veneers",
"french": "Placages de bois",
"korean": "합판",
"japanese": "寄せ木細工",
"italian": "Impiallacciature di legno",
"german": "Holzfurnier",
"spanish": "Revestimientos de madera"
}
},
{
"name": "Filaments",
"guid": 1010243,
"producers": [
1010321
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAATFUlEQVRoge3aeXCcZ30H8Fc2zkUc24q0x/M+x3vsu/vurvY+tKd2da+<KEY>
"locaText": {
"polish": "Żarniki",
"english": "Filaments",
"taiwanese": "燈絲",
"brazilian": "Filaments",
"russian": "Нити накала",
"chinese": "灯丝",
"portuguese": "Filaments",
"french": "Filaments",
"korean": "필라멘트",
"japanese": "フィラメント",
"italian": "Filati",
"german": "Glühfäden",
"spanish": "Filamentos"
}
},
{
"name": "<NAME>",
"guid": 1010245,
"producers": [
1010323
],
"icon": "data:image/png;base64,i<KEY>NQ<KEY>Zn/hjf348KMW/O3DZ<KEY>
"locaText": {
"polish": "Bicykle",
"english": "<NAME>",
"taiwanese": "大小輪自行車",
"brazilian": "<NAME>",
"russian": "Пенни-фартинги",
"chinese": "大小轮自行车",
"portuguese": "<NAME>",
"french": "Grands-bis",
"korean": "자전거",
"japanese": "ファージング硬貨",
"italian": "Biciclo",
"german": "Hochräder",
"spanish": "Cuartos de penique"
}
},
{
"name": "<NAME>",
"guid": 1010246,
"producers": [
1010324
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAASjklEQVRogdWaZ1hVV7rHF5porFECp+y9djkHbCDdQokKsYOIEgui<KEY>Qk<KEY>polgwGpOoUWOcTKLJxNzkZq6TyUzM/34QvZN7cz+YmBnn/zzrw36e/WH/9vuu9X/ftRYh<KEY>8A7LnziG8WEYZoZUKp1AXqKojNLV1Z2ox/MWf3i/GhFellAKQqaCE3xFjluux/M2IsctV1Dey9qUftWYtx2LLGd8LVDBntPhGELIq/9qgKd6RSKRSBmZzOfOpVwssxL+rCcICQKlK0WZTGRZ9g1BR0f<KEY>//<KEY>
"locaText": {
"polish": "Zegarki kieszonkowe",
"english": "Pocket Watches",
"taiwanese": "懷錶",
"brazilian": "Pocket Watches",
"russian": "Карманные часы",
"chinese": "怀表",
"portuguese": "Pocket Watches",
"french": "Montres à gousset",
"korean": "회중시계",
"japanese": "懐中時計",
"italian": "Orologi da taschino",
"german": "Taschenuhren",
"spanish": "Relojes de bolsillo"
}
},
{
"name": "Glasses",
"guid": 120030,
"producers": [
101250
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAUiklEQVRogc1aaXRT17W+BAjYlnSHc+6VbWxswGAGz7MleZbnSbItT5I8D9iWB3mejWdbmKFgYiZjIAxJaDBJIAlJWEnzUkiaJm2avA4vndbra5u2SV/mNH19+d4PCUqz2q42lJfstfaS1l33x/7OPt++e3/nMMyXbyscfo/DVzEMcy/DMGsZhnFy/N7LMMxKx3tfKVvB2AO7l7EHK+c4jpPL5cTFxUUpODl5cBznxXGct+Dk5CGXyynDMC4Mw6xmviJgbq78GkEQFC4uLkqWZTcQQrZKHBdIKQ2TBEFFCEmUBCFVovR3IqXf4nnej1LqxjCMM2NfgC/VbmbBWSaTiQqFYjMhJFKidEQk5IREyP0SpRAJuZAWF4zDw3qcGopDd7YSfusF8DwfIJPJRMaexS/VVjIM4+zi4qLked6f8nzmRq91+PkL0/je2WIcbd2GmUovHGzaht3V3rBVe+PieDIW23xx0iADpTRTVCg2C4KgYL7ErKxgGGaNTCYTe<KEY>BWI<KEY>
"locaText": {
"polish": "Okulary",
"english": "Glasses",
"taiwanese": "眼鏡",
"brazilian": "Glasses",
"russian": "Очки",
"chinese": "眼镜",
"portuguese": "Glasses",
"french": "Lunettes",
"korean": "안경",
"japanese": "眼鏡",
"italian": "Occhiali",
"german": "Brillen",
"spanish": "Gafas"
}
},
{
"name": "Gramophones",
"guid": 1010248,
"producers": [
1010326
],
"icon": "data:image/png;base64,iVBORw0<KEY>0<KEY>Zbk+qd2L0VJuoGrXR70<KEY>iY<KEY>2<KEY>REMWTGqNhW4UDXKicWZ4egKDsUZXl27G7OhCJZzuuMpSiKMpMEisOXIsZNnTrVpCpK+uknK<KEY>17KkKwNNOGubNsK<KEY>7S2EjWvVqqra5UCK3fddCdI0bTIVhBBJFN+ckxyK6tka6uYZOFQbit6mcJTPDsGS2eFYvsCJmuJINC2LwqYqD0Sz+WONMb/NZhNJoCzfPwh<KEY>
"locaText": {
"polish": "Gramofony",
"english": "Gramophones",
"taiwanese": "留聲機",
"brazilian": "Gramophones",
"russian": "Граммофоны",
"chinese": "留声机",
"portuguese": "Gramophones",
"french": "Gramophones",
"korean": "축음기",
"japanese": "蓄音機",
"italian": "Grammofoni",
"german": "Phonographen",
"spanish": "Gramófonos"
}
},
{
"name": "Gold",
"guid": 1010249,
"producers": [
1010327
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAASCElEQVRoge2aeXBUZbqHT0QcHR0gsTvdffbu4Ig77sg4V+bqOG4oEsKSDhCSANlIQtjDLqvACCqyiYAoLoAgIiJBCJAEkhBJQhIStiBb9r2TTneS7uf+keB4b90/LrjM3Kr5Vb3Vf3R1Vz/1nPec73u/FoR/598RBEEQgJtgbdd/9u/42dm6destlZW5DwuCcIsgCL/rfO0qCMLNgiB0EQThJkEQfDrrXzZ<KEY>Zs<KEY>0aODe+tmsy7LsmQymfwlSbrT19e3u9FovEMQhN8LHaBdhH8RMB9BEG5WVdV3RPCAJzKOJZdf+uEkMWOHocrSVbPReFiyWJJ0RRmgy/ILuiz30yWpj1WyPvRHVbVJknSn0GHvnwrjIwhC1549exqnTx/XPyZquKf5zLu4K/ZRfziE+iPBNKSG4MgYhTM3EvepOCqyosjcNYL4sKcwGY0lAZrW12g0moUOO/80iFv8/f1NmiQ9FRX+Og1H7DQcseMsXk<KEY>
"locaText": {
"polish": "Złoto",
"english": "Gold",
"taiwanese": "金",
"brazilian": "Gold",
"russian": "Золото",
"chinese": "金",
"portuguese": "Gold",
"french": "Or",
"korean": "금",
"japanese": "金",
"italian": "Oro",
"german": "Goldbarren",
"spanish": "Oro"
}
},
{
"name": "Jewelry",
"guid": 1010250,
"producers": [
1010328
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAW6ElEQVRoge1aaVQU17Yu0Rg1GgW76e6qU6eqq8GJROOAEwYHBo2apFFRNESjgihKEOcR1KA4gIogo7QMggMgk8wqkxNKUAREBeIQRVQUNOKM3/sBGcw19+Xel9z11lvvW2v/6dVd1d/Z+9tn730Ow/w//u9D73fW6h32vxatGIZpzTBMOwMDgw85juvKderUlVKqL5PJOsnl8o5yubyjgmE+YBimPcMw7zMM8x7zK9H/LIB1esBbL/6FAPmQGPA8rxE5bjDPKueLPD9azfPmakIGCqzQTxCEviLHfUIpNeENeQ3pSjjaubM+wzAd/uOkgJoODx9Wd255YRuWZTuoDQ0VVEl7CZwwat4si9vxgeNxLvELnIwdjzm2mtfhXv1fHNw+EBGbTBHkboqVDn3uWQyRzrIK5WY1pVYCy/aVWJZSSvVJs7fea1mcv48UUN720aMyU8Iw7Y2USrnIsj00asHTfeVU+G6xx/HwIUj27YYk3+4oSh6LtJCByI/oA7/FPDxmK7FqBoul9gSe87pjj4cpNrr0g4kRe5VydIZE6TCqVPbiOI4QQgxaSLX5WwjZ2tq2vXu3aO6ng/r2UigUvvOdply5WR2L0swpuJQ5BuVHzJETbor7le64dcoSZc<KEY>
"locaText": {
"polish": "Biżuteria",
"english": "Jewellery",
"taiwanese": "珠寶",
"brazilian": "Jewellery",
"russian": "Украшения",
"chinese": "珠宝",
"portuguese": "Jewellery",
"french": "Bijoux",
"korean": "보석",
"japanese": "宝石",
"italian": "Gioielli",
"german": "Schmuck",
"spanish": "Joyería"
}
},
{
"name": "<NAME>",
"guid": 1010251,
"producers": [
1010329
],
"icon": "data:image/png;base64,iVBORw0KGgo<KEY>EQ<KEY>//<KEY>3<KEY>2PMd5C4T4CYT4CZT68oQE8oSECxy3cJCFVrXdQL1bdrZG+XraQg5h2aWEZZN5jpstEhJPOS6JsGwKYdnlAmFzBllq/2hnrVs7YrhJ8aiR5mUOX/erdXK0vDN+rHW7h5vtm9TFE7ApywXB<KEY>
"locaText": {
"polish": "Trzcina cukrowa",
"english": "Sugar Cane",
"taiwanese": "甘蔗",
"brazilian": "Sugar Cane",
"russian": "Сахарный тростник",
"chinese": "甘蔗",
"portuguese": "Sugar Cane",
"french": "Canne à sucre",
"korean": "사탕수수",
"japanese": "さとうきび",
"italian": "Canna da zucchero",
"german": "Zuckerrohr",
"spanish": "Caña de azúcar"
}
},
{
"name": "Tobacco",
"guid": 1010252,
"producers": [
1010330
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAWVUlEQVRogc1aZ3QV1doeBCSnl5xzZs7M3nvKCQREiogIKoKIUhUQaUqLgP<KEY>
"locaText": {
"polish": "Tytoń",
"english": "Tobacco",
"taiwanese": "菸草",
"brazilian": "Tobacco",
"russian": "Табак",
"chinese": "烟草",
"portuguese": "Tobacco",
"french": "Tabac",
"korean": "담배",
"japanese": "タバコ",
"italian": "Tabacco",
"german": "Tabak",
"spanish": "Tabaco"
}
},
{
"name": "Cotton",
"guid": 1010253,
"producers": [
1010331
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAY8klEQVRoge16d3hU9bruAoWjokBikplZfQZwbxXsKBvYioqcbUEFRBCQUEIxBUgltPTeeybJpEwmvc1MMul90pNJ7z2hd0J3o/DePxIV7z3urefse+69z3Pf51l/rmd97/rK+33f70cQ/x//Esx+7Jn1f9iW/xRmEwQx18DA4DmapvVZltUjCeIZgiCeJP4fITSLmDZ2HqVP0ZRQ+KlIIDjJkOQXi1n2JUNDQyFBEM8SBDGXIIgniP9LSM0ifgmbJwmCmGtoaPisQCAwYln25SWLJSXAJIDTmJrqwSIxr+YZ5gtWxL7Jsq<KEY>
"locaText": {
"polish": "Bawełna",
"english": "Cotton",
"taiwanese": "棉花",
"brazilian": "Cotton",
"russian": "Хлопок",
"chinese": "棉花",
"portuguese": "Cotton",
"french": "Coton",
"korean": "목화",
"japanese": "木綿",
"italian": "Cotone",
"german": "Baumwolle",
"spanish": "Algodón"
}
},
{
"name": "Cocoa",
"guid": 1010254,
"producers": [
1010332
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAVE0lEQVRoge2aZ1Cc57XHX1V22d53n7e/yzZg2V1YytJ7E6ItCFEkEKogg<KEY>3<KEY>9f/2r2<KEY>2<KEY>i<KEY>Uo<KEY>Fq<KEY>fs<KEY>j<KEY>Zu<KEY>8VtR6eF/P0qn02kYhqElhvHSVmtHXrz55sYy429P1Gtxojoa/QXR2JyhwIY0BdanKrA+RYk1QSVWJSqxMqBEk0cNN228z<KEY>
"locaText": {
"polish": "Kakao",
"english": "Cocoa",
"taiwanese": "可可",
"brazilian": "Cocoa",
"russian": "Какао",
"chinese": "可可",
"portuguese": "Cocoa",
"french": "Cacao",
"korean": "코코아",
"japanese": "ココア",
"italian": "Cacao",
"german": "Kakao",
"spanish": "Cacao"
}
},
{
"name": "Caoutchouc",
"guid": 1010255,
"producers": [
1010333
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAU1klEQVRogdWad1SUZ9rGXzWJ2WR<KEY>FwJEnqiwni/X8nVM/L6+vrfyATi0U0TRsKDOMxzNmi7srO6biyczqu7pqOq7tmaNfuGSjdloyru2eifPdMl<KEY>",
"locaText": {
"polish": "Kauczuk",
"english": "Caoutchouc",
"taiwanese": "橡膠",
"brazilian": "Caoutchouc",
"russian": "Каучук",
"chinese": "橡胶",
"portuguese": "Caoutchouc",
"french": "Caoutchouc",
"korean": "생고무",
"japanese": "天然ゴム",
"italian": "Caucciù",
"german": "Kautschuk",
"spanish": "Caucho"
}
},
{
"name": "<NAME>",
"guid": 120031,
"producers": [
101251
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYn0lEQVRoge2aZ3xVVdr2d3KSnJy+91prn5OT3ntCOklI<KEY>9/<KEY>Pnuv69zlutd9L037//i7CNA0<KEY>2<KEY>heit<KEY>5PvnS5Ug3DiHa5XEq7YrXvCP1bEdBFwObxeAxps0VIKdO8QpSYhtFoSrnQ7zVpLk5j//KhnN05jhe2Deetn8/hwuYh/O7msdw<KEY>",
"locaText": {
"polish": "Ziarna kawy",
"english": "Coffee Beans",
"taiwanese": "咖啡豆",
"brazilian": "Coffee Beans",
"russian": "Кофейные зерна",
"chinese": "咖啡豆",
"portuguese": "Coffee Beans",
"french": "Grains de café",
"korean": "커피콩",
"japanese": "コーヒー豆",
"italian": "Fave di caffè",
"german": "Kaffeebohnen",
"spanish": "Granos de café"
}
},
{
"name": "Corn",
"guid": 120034,
"producers": [
101270
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYjElEQVRogdV6d3hTV7b9pWNZuveec+6<KEY>AQjUZjzd137kOdOozjOKUkSbaM50MlQtIYYzmMMTOlNEySJE+FQmFj4fqIh4AZynGctczzbjIhKZOa<KEY>
"locaText": {
"polish": "Kukurydza",
"english": "Corn",
"taiwanese": "玉米",
"brazilian": "Corn",
"russian": "Кукуруза",
"chinese": "玉米",
"portuguese": "Corn",
"french": "Maïs",
"korean": "옥수수",
"japanese": "トウモロコシ",
"italian": "Mais",
"german": "Mais",
"spanish": "Maíz"
}
},
{
"name": "<NAME>",
"guid": 120036,
"producers": [
101272
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAcBUlEQVRogc2ad1RW57buV5KdnYT2lbXWhyYxprhjjBqV9iFdeoePDtJ7E5DeEUR<KEY>//<KEY>",
"locaText": {
"polish": "Wełna alpaki",
"english": "Alpaca Wool",
"taiwanese": "羊駝毛",
"brazilian": "Alpaca Wool",
"russian": "Шерсть альпака",
"chinese": "羊驼毛",
"portuguese": "Alpaca Wool",
"french": "Laine d'alpaga",
"korean": "알파카 양모",
"japanese": "アルパカ生地",
"italian": "Lana di alpaca",
"german": "Alpakawolle",
"spanish": "Lana de alpaca"
}
},
{
"name": "Plantains",
"guid": 120041,
"producers": [
101263
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAX8UlEQVRogc2ad3SVVfrvX9CUU9+y93tOGqRBgCS0gIFAaAKiKDrizDijzig6Yx0QFSmiIg5Sk5DeIHRCCJ0EUoBQDemkF5oijmBBQUTv3Ht/63P/SMIwc+f3WzPO/K73u9b7x1nnrHftz372U/bzHEX5/0c9FEXpqSiKh6IoVlVVddNm83GrarCu65FCiGhT18eYpjlWCBEthOhvmqaPoih2RVHu/klXfod6KIpyl6IoFofDITRNC9R1faCp67GmYfzCJWV8UC+TZ37tzxu/uYeIPn64pDysadpgl83mVhTF+yde/231UBTF2+FwSCFEf6lp411CfBXgZ7JiUTAHdvSmuMAgfpnGkD4aw8IE/QLsuE3zP5xOZ1/TNO0/NUC3<KEY>",
"locaText": {
"polish": "Bananowce",
"english": "Plantains",
"taiwanese": "大蕉",
"brazilian": "Bananas",
"russian": "Бананы",
"chinese": "大蕉",
"portuguese": "Bananas",
"french": "Plantains",
"korean": "플랜테인",
"japanese": "バナナ",
"italian": "Banane",
"german": "Bananen",
"spanish": "Plátanos"
}
},
{
"name": "Pearls",
"guid": 1010256,
"producers": [
1010339
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAVWElEQVRoge1aaVRb55m+OHb22DEFJN1dwo2dpVnquHaWjrPHadJOkrZJ2zSZJk3qNGsdO47t2I7BCwaMWQwYEEisYhESSEKAEIhFiEVISAKxGWR2AzZmM9jG2DzzAzqTyaSO26aT/JjnnO/cc+6555773Pf93uV5P4L4f3zr8CIIYglBEEu/tK5bvPe9x18//gYfH5/bSJL0oWmaWkVRNE3TlFAo9F25cuUKgiBuIBZIfS/hRRDEDeyKFStZlpXwNL1RJBDsuvf++6U/Wf9QEiUUhlEi6nWe4jfQNL2KoqgfEAuEvlcWWkLT9E0kSTISln10/YYNY6bWDhjaOqF3d0DjaIHK6kKOxY433vsYNEl/wdP0RpIkWYFAcAvxPSHjtUiCXSWRHK202TB8bgq2Tg8qXa2oau5AqbMV2loHVKU1yC6sQqrRgsee+dkJMcn+nKbpVSRJ3kx8x2S8CIK4gSRJRsJLwhsGBtHaN4AGmxP9A6cwNnIafUMjcA8MobC7H8o2D7IsDmSoSpGmLMXa9Q+fldD0yyKRiCMI4qbF930nWMKuWLFSzDA/TTWUorq5HbYGB8z2JlS2e2DvHYSlZwAlXb3I6+xGdmcPMpo6kGGsQ1q2EfIsI/zF/uVihvk3oVDoS3yHAeAGlmUlD65ff6G<KEY>
"locaText": {
"polish": "Perły",
"english": "Pearls",
"taiwanese": "珍珠",
"brazilian": "Pearls",
"russian": "Жемчуг",
"chinese": "珍珠",
"portuguese": "Pearls",
"french": "Perles",
"korean": "진주",
"japanese": "真珠",
"italian": "Perle",
"german": "Perlen",
"spanish": "Perlas"
}
},
{
"name": "<NAME>",
"guid": 120042,
"producers": [
101262
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYh0lEQVRogcWad3CV17X2XxMb67S37fc9qqiAJIR6lygS6l0gCRXUKyqAQEIIIQSIJsAYUw1YNIHpxnQIEHCLEyex49gJLte+jp3EcRKn2nFJJvkmv+8PKb75kji2v5S7ZtbMmTln5uxnr/KssiXpf1fuGtMvSZJ0r2EYDofDYRiG4aHr+gTDMDwcDoeh67osSZLL2O/u+t888F/LJ4eXJMkmy7IuLBZPw+GYbChKrFOIWqeuDxqqmiKEiDMcjslWq9VdkiSHJEn3SP8BMH8+4D1jh3QZ03slSbp77LvR25ckh81mc3VVlImmqkYahpEihCjxcHX+6crWFvYtLmRNYw7uTuf/MYXoE0IkqKrqq6qqKknS+H8XmL+8Ydlutzt1i2WCoih+qqr66haLl91udyqKosmyrFutVnfD4QgUQiQ4DWOth6vzK+H+rqQnTOHWjnbmF8RRlRJKU1YEbbkx9Fel4e3p/iND0/IVRZmkaZoi/Yst8wkAXddlq9XqbhjGZCFEvK7r<KEY>",
"locaText": {
"polish": "Tran",
"english": "Fish Oil",
"taiwanese": "魚油",
"brazilian": "Fish Oil",
"russian": "Рыбий жир",
"chinese": "鱼油",
"portuguese": "Fish Oil",
"french": "Huile de poisson",
"korean": "어유",
"japanese": "魚油",
"italian": "Olio di pesce",
"german": "Fischöl",
"spanish": "Aceite de pescado"
}
},
{
"name": "Ponchos",
"guid": 120043,
"producers": [
101266
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAZYUlEQVRogcWad3hVBdavN6iE08+u5yTnJKftc04IhAQQEqo0ASnSpEhRLPRe0hMSSgKBJISETuglCaGF3kF6ERBRBBXFMjMyIzN+fjOO44y+9w/ivd75vrl3+reeZ/+7n+fda+1VfmsJwj9u9QRBeFIQBKPNZhMVRYlSrVbdIYrxsiy31CSpjSaKbSVJSlZVNVFRlJAkSW6r1SpFCYJREISnBEGoX/ee/zF7QhCECLsg2CVJihZFMV612zuosjxRU5SSpuEmPNexO4OfH0S3dl2JVNUKVZanKIrSSbXbm9lsNp/FYlGEx0BP/k/A1KuDMDrMZk2W5VhFUZ7RZPnLF7sP5LOPP+LrLz7n+rk3KC5cRFZaJmNHj2f7uvX87MMP6N2++w+aLD/SJKm7YrM1d9rtXqvVKgmCYPh3AtUXBOEpSZKskiS5FZutuaIor7dJbMnZQ8coyJtDcqt2dH6mK/37vcCk8ZOYNXMmkyZOZtCAISS1bEOPbr147+YtenXrhaYoWzVJ6qbZ7QmiKMbY7Xa7IAgN6z7UvwzoCUEQDFarVVJVVVdFsZ0my29PHjUa/vQN333zW0J6PN269KB3jz707zeQaZOnMnXKNMaPHk/v7r1p07oDzqgAN65dY0F+AdevXcfrjkGV5QxFUTrKstzIbDZrwr8w3J<KEY>
"locaText": {
"polish": "Poncza",
"english": "Ponchos",
"taiwanese": "斗篷",
"brazilian": "Ponchos",
"russian": "Пончо",
"chinese": "斗篷",
"portuguese": "Ponchos",
"french": "Ponchos",
"korean": "판초",
"japanese": "ポンチョ",
"italian": "Poncho",
"german": "Ponchos",
"spanish": "Ponchos"
}
},
{
"name": "Felt",
"guid": 120044,
"producers": [
101415
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAY8klEQVRogdWaeVSV57X/36RpUhXOOe9wDrY2aZImaYZGk2o0JtHggCPiLMqszKMokzLJJAgiwwFkRmZElBlkHkSUUcRZMM5ivGnT9ra5Xfe3btfn/gEm6bh6b++97W+v9fxx1rvWed797P39vnt/9yMI/3h7Zmo9O7We/v7/wp4RBOE5QRBeEARhhiAIKlEQ1KIgqAVBMBAE4XtTz5/9x73iX7enDkxTq9Wioig/0KnVP5Yk6W2dKM4WRfGniqK8IUnSi4aGhrIw6eRzwj9RhJ4RBOE7giB8T61Wi9K0aS+KoviuVqNZrFOULK0s58+aOROdooxrFSVHluWlGo1mjiiKL4miqBYE4XnhHxydp7n/giiKalmWZ02d+hKdLDd98P5PuT9YyN2+fG73FTM+1MhgWzn7vR3RaZWvNBrNp1qV6jWVSiVNOfN/HpmnDjyvKIqhMn3692VZfnMqAmGLP5rL5Z5i7p7L5l5/HvcH8rjdm8md89lcro/nUmsOw12nmPf+bGS1erlWpXpdo9FoBEH47v+lM89MbTjDwMBAp1KpXpMkaaFOFF3eePVlhtvzGG9PZOJiGff<KEY>
"locaText": {
"polish": "Filc",
"english": "Felt",
"taiwanese": "毛氈",
"brazilian": "Felt",
"russian": "Войлок",
"chinese": "毛毡",
"portuguese": "Felt",
"french": "Feutre",
"korean": "펠트",
"japanese": "フェルト",
"italian": "Feltro",
"german": "Filz",
"spanish": "Fieltro"
}
},
{
"name": "Bombins",
"guid": 120037,
"producers": [
101273
],
"icon": "data:image/png;base64,i<KEY>gW9GGrg1YOLOUCF3hgq5NWD6s+3OM3+4NdP8i63ZfNiXxVhXOqNdaYz1pnN5YxoXu9I5szyJk00JVM<KEY>",
"locaText": {
"polish": "Kapelusze",
"english": "Bowler Hats",
"taiwanese": "圓頂硬禮帽",
"brazilian": "Bombín",
"russian": "Котелки",
"chinese": "圆顶硬礼帽",
"portuguese": "Bombín",
"french": "Bombín",
"korean": "중산모",
"japanese": "山高帽",
"italian": "Bombette",
"german": "Melonen",
"spanish": "Bombines"
}
},
{
"name": "Rum",
"guid": 1010257,
"producers": [
1010340
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAXEklEQVRoge2aeXCc93nfX5KyLEuUcBCLxb77Hnvhxm<KEY>
"locaText": {
"polish": "Rum",
"english": "Rum",
"taiwanese": "蘭姆酒",
"brazilian": "Rum",
"russian": "Ром",
"chinese": "兰姆酒",
"portuguese": "Rum",
"french": "Rhum",
"korean": "럼주",
"japanese": "ラム酒",
"italian": "Rum",
"german": "Rum",
"spanish": "Ron"
}
},
{
"name": "Chocolate",
"guid": 1010258,
"producers": [
1010341
],
"icon": "data:image/png;base64,iVBORw0KG<KEY>2<KEY>Qj<KEY>5<KEY>i21f/s2wtJ3Mn14YWpGB7MDeKbJ/rhNHDwVXP4o6kQ2k0Cuqt1GHDU4kTYg/HuBji1xXjjRAzPT8VxbyKGe5MfV8jGQFlSUv77giic8bbgxek4bo8E8dRoEE+NBHF7NIQOvQz9DeX40cUxvDgTx9uLGfzFxRxemgxhwG5Gb62IU/5G5NpqEDpixlyfC5cyQTw9MYABewV6TE<KEY>
"locaText": {
"polish": "Czekolada",
"english": "Chocolate",
"taiwanese": "巧克力",
"brazilian": "Chocolate",
"russian": "Шоколад",
"chinese": "巧克力",
"portuguese": "Chocolate",
"french": "Chocolat",
"korean": "초콜릿",
"japanese": "チョコレート",
"italian": "Cioccolato",
"german": "Schokolade",
"spanish": "Chocolate"
}
},
{
"name": "Coffee",
"guid": 120032,
"producers": [
101252
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAXtElEQVRoge2ad1RU6Zb2j1mg0glVoIgKhlYUMNCKOeeAiiiCCAYQRbKIREmiKCi2iqEVMGftVttsKza2ObSiKAYMCIpIEEPH+5s/oG/313PnznfnhllrZp619qpatWrVOc+7937ODiUI/4f/2aglCELtGqv7B/v181r/bXf3V/DrjdcTBKGhIAgmgiBo1Wq1rFKpDCYmJqYmJiamKpXKoFarZUEQtDXfaSD8Ru6/ldivJ95QFEWtSqUyiKLYVFGrW4uiaKMoSmdJkhwMotjDIIo9JElyUBSlsyiKNnqNppUkSRYqlUovSZJGqD6Auv9qQrVqLmqk0WgkURSbSpLUTpKkbpIkDVIUxUuvKF9ZW1vn9R8wEFd3D8a7uNKn3wDatGl7T68oX+ll2dNUlgfKstxVluW2kiRZaLVaURAEo38VoTqCINQXRVErSZKFQRRtTWV5oEFR4q3bWhMdl8CN/ALO33nA19fucOibqxw8d5nDOVc5fuk7Ltx5yOPXldzIf4K3XxAtWrZCL8thiqL0E0WxvWxkZF7jofpCtcf/KagtCEJDtVqt6DWaVnqdrrdBlvf5+gVw4fY9Ptt+gMCFy/CLW0pI0nIWfb6FNbsPseXIGbYcOcPWo2fZcuQMmYdOsuGL4+w+lUPu0yKu5D1i8Bhn9LK81yCKPbRab<KEY>
"locaText": {
"polish": "Kawa",
"english": "Coffee",
"taiwanese": "咖啡",
"brazilian": "Coffee",
"russian": "Кофе",
"chinese": "咖啡",
"portuguese": "Coffee",
"french": "Café",
"korean": "커피",
"japanese": "コーヒー",
"italian": "Caffè",
"german": "Kaffee",
"spanish": "Café"
}
},
{
"name": "<NAME>",
"guid": 120033,
"producers": [
101264
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAZDElEQVRoge2ad3SU19Wvz4xG0mjqW2dGXUhCXUINCUmgLgGSML0I0UFYoghZNNGLhOgSMpjeTMdg022MbWzAjrENGOOGHQx2CIlxQhLbsePvu99dz/0Dkdj5bnKzVtbNLevba50/ZmbNe87z/vbZp+wtxH/Zf9n/E2YQQhiFEF4/ao8+m4QQPkIIsxDCTwjh2/GdseN//8ft0eC9hRAWWZaddrtdtdvtqtPplGVZdkqSJNntdk3TtABJkkIlSQrVLJYAh8OhCCEs4iHQvwzGIH76xk0dzSdACIvdbldlWQ7xKEq8pmlpmqal67qe4pblRLcsJ6qq2lVX1V0uVX3WparP6pp2WJblBE3TAjQh<KEY>
"locaText": {
"polish": "Pieczone banany",
"english": "Fried Plantains",
"taiwanese": "炸大蕉餅",
"brazilian": "Fried Bananas",
"russian": "Жареные бананы",
"chinese": "炸大蕉饼",
"portuguese": "Fried Bananas",
"french": "Plantains frits",
"korean": "플랜테인 튀김",
"japanese": "揚げバナナ",
"italian": "Banane fritte",
"german": "Gebackene Bananen",
"spanish": "Plátanos fritos"
}
},
{
"name": "Tortillas",
"guid": 120035,
"producers": [
101271
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAcUklEQVRogc2ad1SVd9bvn/RRyjlPOQfsDRUQQcWKooCIBSnSQZGu0nsRUVFQwIaIoEYF61gjGns0lsQeldhRikgvakxm8iYmd+Zz/wBzM+975665M/Pedfdae52z1lnP75zP2fu3f8+zv1sQ/jF7XxCEDwVB+EQjCLpqtVqtp6enaHV0DLQ6Oga6<KEY>
"locaText": {
"polish": "Tortille",
"english": "Tortillas",
"taiwanese": "玉米餅",
"brazilian": "Tortilla",
"russian": "Тортильи",
"chinese": "玉米饼",
"portuguese": "Tortilla",
"french": "Tortillas",
"korean": "토르티야",
"japanese": "トルティーヤ",
"italian": "Tortillas",
"german": "Tortillas",
"spanish": "Tortillas de maíz"
}
},
{
"name": "Sugar",
"guid": 1010239,
"producers": [
1010317
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAATvklEQVRogc1aaVCU17b9RBNvNOEiAbr7m7tBELqbqWmgmYVmHkQEQXFE44AScZ6vE4maRFFQFBWvig/ngUYEHBAEBDQIMsisiCAKzkavMbl3vR9NfNat1KuKYiqrav/4qruqv9Vr7bP32ecQxPuhP0EQnxAEMZAgiE97n/sa/XrjT0Ff/lg/QvuHfEoQxCCBQDBYIBAMJgjib4T2T9Ppo9/5qNDhef5vtK6uPi/keZZlpSYcZ8NTlLWYJM0YhiENDAy+IAhiAPEnqvRHoWNoaPg5y7ISlibjvooKupWyNhbJ/5iKlTNHwd/FupUWieYwDGMnNhILCK1Cfzky/QQCwWBjmjYx4dmm+otpqMrehrxdi5G6PBo7F4/GxhkBWBHtAZHA8BJLki48zwsJrf3+UviUoijaWmaWXnthD6rO7kDRwdVIXRqFvStGY+N0Pywf64b4kY74ytcGLCnaJaZpe16P1yP+Qjmjo6+vryumafvTqStRd2E3Tm2NR9aWmTiwagx<KEY>
"locaText": {
"polish": "Cukier",
"english": "Sugar",
"taiwanese": "糖",
"brazilian": "Sugar",
"russian": "Сахар",
"chinese": "糖",
"portuguese": "Sugar",
"french": "Sucre",
"korean": "설탕",
"japanese": "砂糖",
"italian": "Zucchero",
"german": "Zucker",
"spanish": "Azúcar"
}
},
{
"name": "<NAME>",
"guid": 1010240,
"producers": [
1010318
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAW8ElEQVRoge2aZ3RbVbbHbwoTAkziOFEk61bJnoQUHszQGQYCvEDoDCTwKBPIgwADIcVxirvl3uNe4pa4xL3IlizZsizJcou7497tuMiWLJeQngz/98EmA0PC<KEY>
"locaText": {
"polish": "Tkanina bawełniana",
"english": "Cotton Fabric",
"taiwanese": "棉織物",
"brazilian": "Cotton Fabric",
"russian": "Ткань",
"chinese": "棉织物",
"portuguese": "Cotton Fabric",
"french": "Fabrique de coton",
"korean": "면직물",
"japanese": "綿布",
"italian": "Tessuto di cotone",
"german": "Baumwollstoff",
"spanish": "Tela de algodón"
}
},
{
"name": "Cigars",
"guid": 1010259,
"producers": [
1010342
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAASa0lEQVRoge2ZaVCVV5qAb3rJakfZLnD57sLdWC7bZZF9uwqKICD7jiDIJovIJooEEHFDQBFFQEHFPa4Rjai4QBSXmMR9TUzS3enp6Z6eqXRNT5KeZ36YTvV0T02NhulM1fRTdX59VV+9<KEY>
"locaText": {
"polish": "Cygara",
"english": "Cigars",
"taiwanese": "雪茄",
"brazilian": "Cigars",
"russian": "Сигары",
"chinese": "雪茄",
"portuguese": "Cigars",
"french": "Cigares",
"korean": "시가",
"japanese": "葉巻",
"italian": "Sigari",
"german": "Zigarren",
"spanish": "Puros"
}
}
],
"populationGroups": [
{
"name": "Population: Old World",
"guid": 15000082,
"populationLevels": [
15000000,
15000001,
15000002,
15000003,
15000004
],
"locaText": {
"polish": "Populacja: Stary Świat",
"english": "Population: Old World",
"taiwanese": "人口:舊世界",
"brazilian": "Moderate Population",
"russian": "Население: Старый Свет",
"chinese": "人口:旧世界",
"portuguese": "Moderate Population",
"french": "Population : Ancien Monde",
"korean": "인구: 구대륙",
"japanese": "人口: 旧世界",
"italian": "Popolazione: Vecchio Mondo",
"german": "Bevölkerung: Alte Welt",
"spanish": "Población: Viejo Mundo"
}
},
{
"name": "Population: New World",
"guid": 15000083,
"populationLevels": [
15000005,
15000006
],
"locaText": {
"polish": "Populacja: Nowy Świat",
"english": "Population: New World",
"taiwanese": "人口:新世界",
"brazilian": "Colony Population",
"russian": "Население: Новый Свет",
"chinese": "人口:新世界",
"portuguese": "Colony Population",
"french": "Population : Nouveau Monde",
"korean": "인구: 신대륙",
"japanese": "人口: 新世界",
"italian": "Popolazione: Nuovo Mondo",
"german": "Bevölkerung: Neue Welt",
"spanish": "Población: Nuevo Mundo"
}
}
],
"workforce": [
{
"name": "<NAME>",
"guid": 1010052,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAMd0lEQVRoge2ZaXRUVdaGT8IUROgQKqlw77nnnHuqMlQqpIqAASINrSKgCBlAaJpEICMRGaNhksQOGEQa6IVGRiGESUFkEIJEEFvFr1drdzMpYR5UhDBF/ASSGt7+UZUyEaG/JrTwrcW71v5R6/6p5+797r3PuYTc133d170iP0JII0JIMyFEACEkgBDShBDi7312z8ufENI0ODj4QaPRGMKMTHLOLVJVw1VVpb<KEY>JgW<KEY>
"locaText": {
"polish": "Siła robocza - farmerzy",
"english": "Farmer Workforce",
"taiwanese": "農夫勞動力",
"brazilian": "Farmer Workforce",
"russian": "Количество фермеров",
"chinese": "农夫劳动力",
"portuguese": "Farmer Workforce",
"french": "Main-d'œuvre de fermiers",
"korean": "농부",
"japanese": "農家の労働力",
"italian": "Manodopera contadini",
"german": "Bauern-Arbeitskaft",
"spanish": "Mano de obra granjera"
}
},
{
"name": "Worker Workforce",
"guid": 1010115,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAMuUlEQVRoge3aaXBUVRYH8Juwr9m6816/u77<KEY>
"locaText": {
"polish": "Siła robocza - robotnicy",
"english": "Worker Workforce",
"taiwanese": "工人勞動力",
"brazilian": "Worker Workforce",
"russian": "Количество рабочих",
"chinese": "工人劳动力",
"portuguese": "Worker Workforce",
"french": "Main-d'œuvre d'ouvriers",
"korean": "노동자",
"japanese": "労働者の労働力",
"italian": "Manodopera lavoratori",
"german": "Arbeiter-Arbeitskraft",
"spanish": "Mano de obra obrera"
}
},
{
"name": "Artisan Workforce",
"guid": 1010116,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAOsklEQVRoge3ZeXRNV/sH8J3ETBNJ7s29Oefs4ZxzkfmGUFWqpToquQmtDqo0xog5poaIyFuKGouqJOaZGEpLaRVvX2k6eKmaiohZjImWyh2+vz/uzTWUapX1W+9anrX2yrr/7Cefs/d+ztl7E/IoHsWjeBSe8PG0/8lcPoQQP0JIRUJI5ZtaBUKI74NM5OmvAiGk0k15Knny/6NcfoKQKrIsB0uSRDVZrq1KUh3GmCaMRnNQUJC/J5Ev+WdPz4cQUsFkMlU3m81GYTaL8lzCLITJZAoxmUzVifth/m1QhaCgIH/GmGbhvPPzdbVvExpZ8GKc/nuTKG2Vylh7jdIGmiSxwMDAgJtA94OoqPgrQZqiRMdYxNCX4vSDbzWthefqamdia4mZKmOtVFm2KsGKbDAYHvs7IL/AwMAAC7NEtmte6/DmjBhsHGjF2pQYrEyOxuLukZjWIRyNItUiQWk7IctPSJJEtfsDV<KEY>",
"locaText": {
"polish": "Siła robocza - rzemieślnicy",
"english": "Artisan Workforce",
"taiwanese": "工匠勞動力",
"brazilian": "Artisan Workforce",
"russian": "Количество ремесленников",
"chinese": "工匠劳动力",
"portuguese": "Artisan Workforce",
"french": "Main-d'œuvre d'artisans",
"korean": "직공",
"japanese": "職人の労働力",
"italian": "Manodopera artigiani",
"german": "Handwerker-Arbeitskraft",
"spanish": "Mano de obra artesana"
}
},
{
"name": "Engineer Workforce",
"guid": 1010117,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAANBklEQVRoge2ZaXQUVRbHX0IIYU06dNKdqnpLVXWArFVMFBk2AZWjHExCYGQdIIAgWwIoEJYAsooiuyRsskgQAQVEQIbV6IwwKAxggLDoaMISFgkqKqlO/+dDd0KizoxbkA/cc+pLn+46/Xv33v9dHiH37b7dt/v2K8yPEFKNEFLd5XLVEEIEuVyuGjGEBPo+9/d95541P0JIgCRJtWRZrq9LElUUxaVKUkNN<KEY>HOT<KEY>
"locaText": {
"polish": "Siła robocza - inżynierowie",
"english": "Engineer Workforce",
"taiwanese": "工程師勞動力",
"brazilian": "Engineer Workforce",
"russian": "Количество инженеров",
"chinese": "工程师劳动力",
"portuguese": "Engineer Workforce",
"french": "Main-d'œuvre d'ingénieurs",
"korean": "기술자",
"japanese": "技師の労働力",
"italian": "Manodopera ingegneri",
"german": "Ingenieure-Arbeitskraft",
"spanish": "Mano de obra ingeniera"
}
},
{
"name": "<NAME>",
"guid": 1010128,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAOnUlEQVRoge3ZaXQUVdoH8JsQCGsgTXcqqbpbVTWdPd3sCDPKIqKAgQQdZRtCkCAwgCAKQsQQEFSiRAHByJp5GQRURMQNNxwdZRAFwiY7QUAEHHFmGKGX/3zo6tAJIaKE1/Oe895z7sfq079z63+f594i5P/H//0RQQiJJITUIYREEULqEkLqOZ3OaCllfUJITTPa6XRGE0LqWc9FWb8Vaf3u/xqgDiGkvt1ub6JpWnPpcMSbqso454amaS6RkJDMOU+92pSqmkQpbSEUoauqyqTDEU8ptdnt9iYWtM6NBkUQQqJks2bNOOeGpLS9pPR2U4ipLilXuaTY49Ll+c6tDGR2cuLOjk707uBE7/ZO9GrnRM+2TtzWygmXlHBJsbeFEK84hXjcoKKfznl3g7G2lFKnS1XtlNIGJLhSNwQU6XA4GkvGekwckvj1ujlp2LvKg/2rPNhT6sGupR7seMGDLxe4sbXYjc+L3Ph0thsfF7rx4TQ33pvixrsPufHmA268PiYDL4<KEY>",
"locaText": {
"polish": "Siła robocza - inwestorzy",
"english": "Investor Workforce",
"taiwanese": "投資人勞動力",
"brazilian": "Investor Workforce",
"russian": "Количество инвесторов",
"chinese": "投资人劳动力",
"portuguese": "Investor Workforce",
"french": "Main-d'œuvre d'investisseurs",
"korean": "투자가",
"japanese": "投資家の労働力",
"italian": "Manodopera investitori",
"german": "Investoren-Arbeitskraft",
"spanish": "Mano de obra inversora"
}
},
{
"name": "<NAME>",
"guid": 1010366,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAOEklEQVRoge3aaXQUVdoH8JsAspOtu6vr1l2qqpslkKRaZIQgKouOshhIWGSRRWQLYICAgUAQkEXBIAIqgiiggCwioARQEAfc8HVkCWuA8LKvsggznCG9/N8P3XQCg68sMwfmjM859SU5p7t/qfs8/9u3Qsgf9d9TkYSQUqErkhAScW8/zp1VaTuxV3I6nXZFURxmTEwUIaQsCYL+Y6o0YyyWMZak2m1Hdc5bSkrruzl3sSpVYkkQVOpef8jfq0ibzVb<KEY>
"locaText": {
"polish": "Siła robocza - jornaleros",
"english": "Jornalero Workforce",
"taiwanese": "計日工人勞動力",
"brazilian": "Jornalero Workforce",
"russian": "Количество хорналеро",
"chinese": "计日工人劳动力",
"portuguese": "Jornalero Workforce",
"french": "Main-d'œuvre de jornaleros",
"korean": "식민지 노동자",
"japanese": "日雇い労働者の労働者",
"italian": "Manodopera jornaleros",
"german": "Jornalero-Arbeitskraft",
"spanish": "Mano de obra jornalera"
}
},
{
"name": "Obrero Workforce",
"guid": 1010367,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAMaUlEQVRoge2aeXQUVdrGb8IiCibptruruu6tW0snJixJNdsAjowOZwTH0aAZPgUEFBTiAjEIBAiQEMAoIgIqEIgiouLMoKNRw6ayI64IERAMISQkEcIqOt8n3V39zB/VSXcCeGSGDJnv+J5TJ3/kn/r1+z73fZ7bTciv9WvVVRQhJDr0N+oKv8u/VFGEkJaEkKvtdnuM0+lsRwi5ihDSgvwX<KEY>",
"locaText": {
"polish": "Siła robocza - obreros",
"english": "Obrero Workforce",
"taiwanese": "勞工勞動力",
"brazilian": "Obrero Workforce",
"russian": "Количество обреро",
"chinese": "劳工劳动力",
"portuguese": "Obrero Workforce",
"french": "Main-d'œuvre d'obreras",
"korean": "식민지 직공",
"japanese": "労働者の労働力",
"italian": "Manodopera obreros",
"german": "Obrero-Arbeitskraft",
"spanish": "Mano de obra obrera"
}
}
],
"productFilter": [
{
"name": "Consumer Goods",
"guid": 11511,
"products": [
1010200,
1010216,
1010237,
1010238,
1010213,
1010203,
1010214,
1010217,
1010206,
120033,
1010257,
120043,
1010247,
120030,
1010245,
1010246,
120035,
120032,
120037,
1010208,
120016,
1010259,
1010258,
1010250,
1010248,
1010225
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAABvElEQVRoge2WsWoCURBFhWAhSCqxsRFBwSaQL1hUBH9AJGiTMp9hJyL4IdpYWPoZqVMomipIFFREbponGZ7zdLPOrhHmwgPhXufOeYprLKZSqVQqlcq/ALwCeIv4vEhDzHA7zSRBVjcEWUmC1AB8mGNrccZbE2/N+EdvccariYEQoB5TWCS+rQHxBrZJvCLz3p44ACncWGUHAHEBkLiZRbUJCyLPLDq3lrHVJX6X8eklzBk/HwZInykaE7/O+G3itxm/Tvwx4/fDAOHkEX8YAGRIfI8rkIZIXyoBMGUiDeI3GH/q47LSkiATHyDLACBLHyATSZAdUzDyscQlEPsyRkxkJwXx5FiySTIZR6ZEMiVHJkMyTUfmWQKk7BieI5mCI0N/DDxHpkAyOUemLAGSYg<KEY>",
"locaText": {
"polish": "Towary konsumpcyjne",
"english": "Consumer Goods",
"taiwanese": "製成品",
"brazilian": "Consumer Goods",
"russian": "Потребительские товары",
"chinese": "制成品",
"portuguese": "Consumer Goods",
"french": "Biens de consommation",
"korean": "소비재",
"japanese": "消費財",
"italian": "Beni di consumo",
"german": "Konsumgüter",
"spanish": "Bienes de consumo"
}
},
{
"name": "Construction Material",
"guid": 11510,
"products": [
1010196,
1010205,
1010210,
1010218,
1010221,
1010207,
1010202,
1010224,
1010223
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAA0ElEQVRoge3YIQ7CQBBG4VJRgWhvgCHBYPAcgRMguAEX4ABwDxKuQPCIehwaVTyCYF5VDWkg<KEY>
"locaText": {
"polish": "Materiały budowlane",
"english": "Construction Material",
"taiwanese": "建設材料",
"brazilian": "Construction Material",
"russian": "Строительный материал",
"chinese": "建设材料",
"portuguese": "Construction Material",
"french": "Matériau de construction",
"korean": "건설재",
"japanese": "建設資材",
"italian": "Materiale da costruzione",
"german": "Baumaterial",
"spanish": "Material de construcción"
}
},
{
"name": "Raw Materials",
"guid": 11512,
"products": [
120008,
1010201,
1010227,
1010226,
1010228,
1010209,
1010229,
1010230,
1010231,
1010233,
1010232,
1010256
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAABh0lEQVRoge2Yv0rDUBSHr/+o<KEY>
"locaText": {
"polish": "Surowce naturalne",
"english": "Raw Materials",
"taiwanese": "原料",
"brazilian": "Raw Materials",
"russian": "Сырье",
"chinese": "原料",
"portuguese": "Raw Materials",
"french": "Matières premières",
"korean": "원자재",
"japanese": "原料",
"italian": "Materie prime",
"german": "Rohmaterial",
"spanish": "Materia prima"
}
},
{
"name": "Agricultural Products",
"guid": 11513,
"products": [
1010195,
1010197,
1010199,
1010192,
1010194,
1010193,
1010198,
120042,
120041,
1010251,
1010253,
120036,
1010255,
120034,
120031,
120014,
1010252,
1010254
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAACiUlEQVRoge2ZvWsUQRiH90RN1KiFRxBTmcYiaCOkkWihpBCCpRhUBEFsJEQDGgT/BFGCiChYKGITxSByRRBRsEip5SFERSUgUU4RvFUfi53EYTMz797H7By4P1i4nXl353lub3dn96KoSJEiRYoU+RdgGJgCZrRlS2iuzAHOYE9faL4oiqIImAWGHf0vHRKdIQLc0YD2GPonBInwIkDFALVP618NxB0tAhywQNW1msEMEgBdIUVcualqzmaQeB5SokuAW2xApDukyH6JLoNIDPSHgH+ifR5pUWQa2BRC4q4CqKr1zYLHF1VXBnZqy4bc4TWJ2RTkJ9XuynQwYFOA4xbQCnDQIXIB+GVof0GIeZXwrfcgTz1sWTED8CkxJMBUVN2DJmWsc7N2i1wVQOa12rkmZXb7gj+ifX4sQLxPbdvokfm<KEY>
"locaText": {
"polish": "Produkty rolne",
"english": "Agricultural Products",
"taiwanese": "農業產品",
"brazilian": "Agricultural Products",
"russian": "Сельскохозяйственная продукция",
"chinese": "农业产品",
"portuguese": "Agricultural Products",
"french": "Produits agricoles",
"korean": "농산품",
"japanese": "農産物",
"italian": "Prodotti agricoli",
"german": "Landwirtschaftliche Produkte",
"spanish": "Productos agrícola"
}
},
{
"name": "Intermediate Products",
"guid": 11514,
"products": [
1010235,
1010219,
1010234,
1010236,
1010241,
1010215,
1010240,
120044,
1010204,
1010224,
1010249,
1010243,
1010222,
1010242,
1010239,
1010211
],
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAACKUlEQVRoge3YPWjUcBjH8bRKhVIXX8CCL4iIIL4MdtVBKIIvKA5<KEY>2<KEY>Ng<KEY>FgPArZwDycximO4jbmc2kMhMt3kacHsC9kFISIPuyQxVnL+wcy6av8isbULEhNtZg1iKGf/TGrty0oii43<KEY>
"locaText": {
"polish": "Półprodukty",
"english": "Intermediate Products",
"taiwanese": "中間產品",
"brazilian": "Intermediate Products",
"russian": "Промежуточные компоненты",
"chinese": "中间产品",
"portuguese": "Intermediate Products",
"french": "Produits intermédiaires",
"korean": "중간재",
"japanese": "中間財",
"italian": "Prodotti intermedi",
"german": "Zwischenprodukte",
"spanish": "Productos intermedios"
}
}
],
"items": [
{
"name": "Stale Bread",
"guid": 190799,
"factories": [
1010283
],
"replaceInputs": [
{
"OldInput": 1010201,
"NewInput": 1010213
}
],
"locaText": {
"brazilian": "Stale Bread",
"portuguese": "Stale Bread",
"english": "Stale Bread",
"chinese": "Stale Bread",
"french": "Stale Bread",
"italian": "Stale Bread",
"polish": "Stale Bread",
"spanish": "Stale Bread",
"taiwanese": "Stale Bread",
"german": "Stale Bread",
"japanese": "Stale Bread",
"korean": "Stale Bread",
"russian": "Stale Bread"
}
},
{
"name": "Illustrious Gemologist",
"guid": 190625,
"factories": [
1010328
],
"replaceInputs": [
{
"OldInput": 1010249,
"NewInput": 1010233
}
],
"locaText": {
"brazilian": "Illustrious Gemologist",
"portuguese": "Illustrious Gemologist",
"english": "Illustrious Gemologist",
"chinese": "杰出的宝石学家",
"french": "Gemmologue illustre",
"italian": "Illustre gemmologo",
"polish": "Znakomity gemmolog",
"spanish": "Gemólogo ilustre",
"taiwanese": "傑出的寶石學家",
"german": "Illustrer Gemmologe",
"japanese": "著名な宝石鑑定士",
"korean": "저명한 보석감정사",
"russian": "Знаменитый геммолог"
}
},
{
"name": "<NAME>",
"guid": 190626,
"factories": [
1010328
],
"replaceInputs": [
{
"OldInput": 1010249,
"NewInput": 1010233
}
],
"locaText": {
"brazilian": "Goldsmith",
"portuguese": "<NAME>",
"english": "<NAME>",
"chinese": "金匠吉尔伯特",
"french": "<NAME>",
"italian": "<NAME>'orafo",
"polish": "<NAME>",
"spanish": "<NAME>",
"taiwanese": "金匠吉爾伯特",
"german": "<NAME>",
"japanese": "金細工師ギルバート",
"korean": "금세공사 길버트",
"russian": "Золотых дел мастер Гилберт"
}
},
{
"name": "Baker",
"guid": 190628,
"factories": [
1010291
],
"replaceInputs": [
{
"OldInput": 1010235,
"NewInput": 1010192
}
],
"locaText": {
"brazilian": "Baker",
"portuguese": "Baker",
"english": "Baker",
"chinese": "烘焙师",
"french": "Boulanger",
"italian": "Panettiere",
"polish": "Piekarz",
"spanish": "Panadero",
"taiwanese": "烘焙師",
"german": "Bäcker",
"japanese": "パン屋",
"korean": "제빵사",
"russian": "Пекарь"
}
},
{
"name": "<NAME>",
"guid": 190642,
"factories": [
1010342
],
"replaceInputs": [
{
"OldInput": 1010242,
"NewInput": 1010196
}
],
"locaText": {
"brazilian": "Renowned Torcedor",
"portuguese": "Torcedor Lucia",
"english": "<NAME>",
"chinese": "卷烟师露西娅",
"french": "<NAME>",
"italian": "<NAME> torcedor",
"polish": "<NAME>",
"spanish": "<NAME>",
"taiwanese": "捲菸師露西婭",
"german": "<NAME>",
"japanese": "葉巻職人ルチア",
"korean": "시가제조가 루시아",
"russian": "Торседор Люсия"
}
},
{
"name": "<NAME>, of the Patent Eyeglass.",
"guid": 191310,
"factories": [
101250
],
"replaceInputs": [
{
"OldInput": 1010204,
"NewInput": 120008
}
],
"additionalOutputs": [
{
"Product": 1010246,
"AdditionalOutputCycle": 3,
"Amount": 1
}
],
"locaText": {
"brazilian": "Moritz von Rohr - The Eyeglass Lens Designer",
"portuguese": "Moritz von Rohr - The Eyeglass Lens Designer",
"english": "<NAME>, of the Patent Eyeglass",
"chinese": "“专利眼镜”的葛尔哈德·福契斯",
"french": "<NAME>, du Monarque au Monocle",
"italian": "<NAME>, del brevetto degli occhiali",
"polish": "<NAME>, od patentowanych okularów",
"spanish": "<NAME>, patentador de las gafas",
"taiwanese": "「專利眼鏡」的葛爾哈德.福契斯",
"german": "<NAME>, vom patentierten Augenglas",
"japanese": "特許メガネのジェラルド・フックス",
"korean": "특허 안경 기술자, 게르하르트 푹스",
"russian": "<NAME>, создатель оригинальной линзы"
}
},
{
"name": "<NAME>",
"guid": 191318,
"factories": [
1010281
],
"replaceInputs": [
{
"OldInput": 1010234,
"NewInput": 120008
}
],
"locaText": {
"brazilian": "<NAME>",
"portuguese": "Perfumier Prunella",
"english": "<NAME>",
"chinese": "香氛师普涅拉",
"french": "Prunella, parfumeuse",
"italian": "Produttrice di profumi Prunella",
"polish": "Perfumerzystka Prunella",
"spanish": "Perfumista Prunella",
"taiwanese": "香氛師普涅拉",
"german": "Parfümeurin Prunella",
"japanese": "香水製造者のプルネラ",
"korean": "향수 제조가 프루넬라",
"russian": "<NAME>"
}
},
{
"name": "<NAME>",
"guid": 191323,
"factories": [
1010324
],
"replaceInputs": [
{
"OldInput": 1010249,
"NewInput": 1010204
}
],
"locaText": {
"brazilian": "Chronometrist Chiara",
"portuguese": "Chronometrist Chiara",
"english": "Chronometrist Chiara",
"chinese": "测时学家奇亚拉",
"french": "Chiara, chronométriste",
"italian": "Chiara la cronometrista",
"polish": "Chronometryczka Chiara ",
"spanish": "Cronometrista Chiara",
"taiwanese": "測時學家奇亞拉",
"german": "Chronometrikerin Chiara",
"japanese": "クロノメーター専門家のチアラ",
"korean": "시간 측정학자 키아라",
"russian": "Изготовительница хронометров Кьяра"
}
},
{
"name": "<NAME>",
"guid": 191348,
"factories": [
1010325
],
"replaceInputs": [
{
"OldInput": 1010240,
"NewInput": 1010197
}
],
"locaText": {
"brazilian": "Costume Designer",
"portuguese": "Costume Designer",
"english": "Costume Designer",
"chinese": "服装设计师",
"french": "Fabricant de costumes",
"italian": "Designer di costumi",
"polish": "Projektantka kreacji",
"spanish": "Diseñador de vestuario",
"taiwanese": "服裝設計師",
"german": "Kostümbildnerin",
"japanese": "コスチュームデザイナー",
"korean": "의복 디자이너",
"russian": "Известный модельер"
}
},
{
"name": "<NAME>",
"guid": 192039,
"factories": [
1010325
],
"replaceInputs": [
{
"OldInput": 1010209,
"NewInput": 1010227
},
{
"OldInput": 1010240,
"NewInput": 1010197
}
],
"additionalOutputs": [
{
"Product": 120043,
"AdditionalOutputCycle": 12,
"Amount": 1
},
{
"Product": 1010237,
"AdditionalOutputCycle": 12,
"Amount": 1
},
{
"Product": 120037,
"AdditionalOutputCycle": 12,
"Amount": 1
}
],
"locaText": {
"portuguese": "Master Craftsman Boris",
"english": "Master Craftsman Franke",
"chinese": "“工艺名人”法兰克",
"french": "Franke, maître artisan",
"italian": "Franke il maestro artigiano",
"polish": "Mistrz rzemieślnik Franke",
"spanish": "Maestro artesano Franke",
"taiwanese": "「工藝名人」法蘭克",
"german": "Franke, der Modeguru",
"japanese": "名匠フランク",
"korean": "기능장 프랑케",
"russian": "Мастер-раскройщик Франке"
}
},
{
"name": "Miliner",
"guid": 191349,
"factories": [
101273
],
"replaceInputs": [
{
"OldInput": 120044,
"NewInput": 120036
}
],
"locaText": {
"brazilian": "Miliner",
"portuguese": "Miliner",
"english": "Milliner",
"chinese": "女帽工匠",
"french": "Styliste",
"italian": "Stilista",
"polish": "Wytwórca sombreros",
"spanish": "Hacedor de gorros",
"taiwanese": "女帽工匠",
"german": "Hutmeister",
"japanese": "婦人帽子職人",
"korean": "여성용 모자 제작자",
"russian": "Галантерейщик"
}
},
{
"name": "Quality Chocolatier",
"guid": 191332,
"factories": [
1010341
],
"replaceInputs": [
{
"OldInput": 1010239,
"NewInput": 120031
}
],
"additionalOutputs": [
{
"Product": 120032,
"AdditionalOutputCycle": 3,
"Amount": 1
}
],
"locaText": {
"brazilian": "Quality Chocolatier",
"portuguese": "Quality Chocolatier",
"english": "Quality Chocolatier",
"chinese": "优质巧克力师傅",
"french": "Maître-chocolatier",
"italian": "Cioccolatiere di qualità",
"polish": "Mistrz kuchni czekoladowej",
"spanish": "Chocolatero de calidad",
"taiwanese": "優質巧克力師傅",
"german": "Qualitätschocolatier",
"japanese": "高級チョコレート職人",
"korean": "고급 초콜릿 제조가",
"russian": "Профессиональный шоколатье"
}
},
{
"name": "Master Confectioner",
"guid": 191356,
"factories": [
101264
],
"replaceInputs": [
{
"OldInput": 120042,
"NewInput": 1010254
}
],
"additionalOutputs": [
{
"Product": 1010258,
"AdditionalOutputCycle": 3,
"Amount": 1
}
],
"locaText": {
"brazilian": "Patissier",
"portuguese": "Patissier",
"english": "Master Confectioner",
"chinese": "甜品大师",
"french": "Maître-confiseur",
"italian": "Maestro pasticcere",
"polish": "Mistrz cukiernictwa",
"spanish": "Repostero maestro",
"taiwanese": "甜品大師",
"german": "Meisterkonditor",
"japanese": "名菓子職人",
"korean": "마스터 과자 제조가",
"russian": "Мастер-кондитер"
}
},
{
"name": "<NAME>",
"guid": 191354,
"factories": [
1010326
],
"replaceInputs": [
{
"OldInput": 1010242,
"NewInput": 1010196
}
],
"locaText": {
"brazilian": "Johan the Inventor",
"portuguese": "Johan the Inventor",
"english": "Johan the Inventor",
"chinese": "“发明家”尤汉",
"french": "Johan l'inventeur",
"italian": "Johan l'inventore",
"polish": "Johan wynalazca",
"spanish": "Johan el inventor",
"taiwanese": "「發明家」尤漢",
"german": "<NAME>",
"japanese": "発明家のヨハン",
"korean": "발명가 요한",
"russian": "Изобретатель Иоганн"
}
},
{
"name": "<NAME>",
"guid": 191386,
"factories": [
101271
],
"replaceInputs": [
{
"OldInput": 1010193,
"NewInput": 120042
}
],
"locaText": {
"brazilian": "Tex Mex Cook",
"portuguese": "Tex Mex Cook",
"english": "Mole Master",
"chinese": "莫雷酱大师",
"french": "Saucier",
"italian": "Maestro del mole",
"polish": "Mistrz sosów",
"spanish": "Maestro de la sartén",
"taiwanese": "莫雷醬大師",
"german": "Mole-Meister",
"japanese": "モーレ・マスター",
"korean": "몰 마스터",
"russian": "Мастер по изготовлению гуакамоле"
}
},
{
"name": "<NAME>, King of the Corn",
"guid": 191402,
"factories": [
101271
],
"replaceInputs": [
{
"OldInput": 120034,
"NewInput": 120041
}
],
"additionalOutputs": [
{
"Product": 120033,
"AdditionalOutputCycle": 3,
"Amount": 1
}
],
"locaText": {
"brazilian": "Pablo Savor - The Tortilla King",
"portuguese": "Pablo Savor - The Tortilla King",
"english": "Tlayolotl Savor, King of the Corn",
"chinese": "“玉米之王”特拉由洛提·萨佛",
"french": "Tlayolotl Savor, Roi du maïs",
"italian": "Tlayolotl Savor, il re del mais",
"polish": "Tlayolotl Savor, król kukurydzy",
"spanish": "Tlayolotl Savor, rey del maíz",
"taiwanese": "「玉米之王」特拉由洛提.薩佛",
"german": "Tlayolotl Savor, Maiskönig",
"japanese": "トラヨルトル・サボール、コーンの王",
"korean": "옥수수의 왕, 틀라욜로틀 세이버",
"russian": "Тлайолотл Пикантный, король кукурузы"
}
},
{
"name": "Maxime Graves, Delicatesseur Extraordinaire",
"guid": 191388,
"factories": [
1010316
],
"replaceInputs": [
{
"OldInput": 1010199,
"NewInput": 1010193
}
],
"additionalOutputs": [
{
"Product": 1010215,
"AdditionalOutputCycle": 2,
"Amount": 1
}
],
"locaText": {
"brazilian": "Maxim \"In the End\" - The Grand Specialist of Delicatessen",
"portuguese": "Maxim \"In the End\" - The Grand Specialist of Delicatessen",
"english": "Maxime Graves, Delicatesseur Extraordinaire",
"chinese": "“极致高级熟食冷肉贩”麦克席梅·格雷夫斯",
"french": "Maxime Graves, traiteur intraitable",
"italian": "Maxime Graves, gastronomo sublime",
"polish": "Maxime Graves, Delicatesseur Extraordinaire",
"spanish": "Maxime Graves, experto en carnes",
"taiwanese": "「極致高級熟食冷肉販」麥克席梅.格雷夫斯",
"german": "Maxime Graves, Delicatesseur Extraordinaire",
"japanese": "マキシム・グレーブス、驚異のデリカテッセン",
"korean": "탁월한 육가공품 제조가, 막심 그라베스",
"russian": "<NAME>, непревзойденный мастер приготовления деликатесов"
}
},
{
"name": "<NAME>",
"guid": 191406,
"factories": [
1010295
],
"replaceInputs": [
{
"OldInput": 1010215,
"NewInput": 1010199
}
],
"additionalOutputs": [
{
"Product": 1010238,
"AdditionalOutputCycle": 2,
"Amount": 1
}
],
"locaText": {
"brazilian": "<NAME>",
"portuguese": "<NAME>",
"english": "<NAME>",
"chinese": "米歇尔大厨",
"french": "<NAME>",
"italian": "<NAME>",
"polish": "<NAME>",
"spanish": "<NAME>",
"taiwanese": "米歇爾大廚",
"german": "<NAME>",
"japanese": "シェフ・ミシェル",
"korean": "주방장 미셸",
"russian": "<NAME>"
}
},
{
"name": "<NAME>, The Very Good Housekeeper",
"guid": 191407,
"factories": [
1010295
],
"replaceInputs": [
{
"OldInput": 1010227,
"NewInput": 1010235
}
],
"additionalOutputs": [
{
"Product": 120035,
"AdditionalOutputCycle": 3,
"Amount": 1
}
],
"locaText": {
"brazilian": "<NAME> - Discerning Household Manager",
"portuguese": "<NAME> - Discerning Household Manager",
"english": "<NAME>, The Very Good Housekeeper",
"chinese": "“绝佳管家”梅森太太",
"french": "<NAME>, l'excellente gouvernante",
"italian": "<NAME>, la governante perfetta",
"polish": "<NAME>, bardzo dobra gospodyni",
"spanish": "<NAME>, ama de llaves suprema",
"taiwanese": "「絕佳管家」梅森太太",
"german": "<NAME>",
"japanese": "メイソン婦人、とても優秀な家政婦",
"korean": "아주 뛰어난 가정부, 메이슨",
"russian": "<NAME>, лучшая домоправительница"
}
},
{
"name": "<NAME>",
"guid": 191400,
"factories": [
1010293
],
"replaceInputs": [
{
"OldInput": 1010193,
"NewInput": 1010199
}
],
"locaText": {
"brazilian": "Recipe Maker",
"portuguese": "Recipe Maker",
"english": "Recipe Archivist",
"chinese": "食谱保管员",
"french": "Archiviste culinaire",
"italian": "Collezionista di ricette",
"polish": "Archiwistka przepisów",
"spanish": "Archivista de recetas",
"taiwanese": "食譜保管員",
"german": "Rezeptarchivarin",
"japanese": "レシピ考案家",
"korean": "조리법 보관인",
"russian": "Хранительница рецептов"
}
},
{
"name": "<NAME>, Celebrity Chef",
"guid": 191408,
"factories": [
1010293
],
"replaceInputs": [
{
"OldInput": 1010193,
"NewInput": 1010199
}
],
"additionalOutputs": [
{
"Product": 1010238,
"AdditionalOutputCycle": 5,
"Amount": 1
}
],
"locaText": {
"brazilian": "<NAME> - The Celebrity Chef",
"portuguese": "<NAME> - The Celebrity Chef",
"english": "<NAME>, Celebrity Chef",
"chinese": "明星大厨马歇尔·佛卡斯",
"french": "<NAME>, chef des célébrités",
"italian": "<NAME>, lo chef delle celebrità",
"polish": "<NAME>, gwiazda kuchni",
"spanish": "<NAME>, chef famoso",
"taiwanese": "明星大廚馬歇爾.佛卡斯",
"german": "<NAME>, Koch für Berühmtheiten",
"japanese": "マルセル・フォルカス、セレブシェフ",
"korean": "유명 주방장, 마르셀 포르카스",
"russian": "Марсель Форкас, знаменитый шеф-повар"
}
},
{
"name": "<NAME>",
"guid": 191420,
"factories": [
1010303
],
"replaceInputs": [
{
"OldInput": 1010224,
"NewInput": 1010243
}
],
"additionalOutputs": [
{
"Product": 1010208,
"AdditionalOutputCycle": 4,
"Amount": 1
}
],
"locaText": {
"brazilian": "Industrial Designer",
"portuguese": "Industrial Designer",
"english": "Susannah the Steam Engineer",
"chinese": "蒸汽工程师苏珊娜",
"french": "Susannah l'ingénieure vapeur",
"italian": "Susannah, l'ingegnere del vapore",
"polish": "Susannah, inżynierka od maszyn parowych",
"spanish": "Susannah, ingeniera de vapor",
"taiwanese": "蒸汽工程師蘇珊娜",
"german": "<NAME>",
"japanese": "蒸気エンジニアのスザンナ",
"korean": "증기 기술자 수잔나",
"russian": "Сюзанна, механик паровых машин"
}
},
{
"name": "<NAME> ",
"guid": 191424,
"factories": [
1010323,
1010284
],
"replaceInputs": [
{
"OldInput": 1010219,
"NewInput": 1010227
}
],
"additionalOutputs": [
{
"Product": 1010246,
"AdditionalOutputCycle": 8,
"Amount": 1
},
{
"Product": 1010248,
"AdditionalOutputCycle": 8,
"Amount": 1
}
],
"locaText": {
"brazilian": "Marios the Mechanical Engineer ",
"portuguese": "Marios the Mechanical Engineer ",
"english": "Dario the Mechanical Engineer",
"chinese": "机械工程师达利欧",
"french": "Dario l'ingénieur mécanique",
"italian": "Dario, l'ingegnere meccanico",
"polish": "Dario, inżynier mechaniczny",
"spanish": "Dario, ingeniero mecánico",
"taiwanese": "機械工程師達利歐",
"german": "<NAME>",
"japanese": "機械エンジニアのダリオ",
"korean": "기계 기술자 다리오",
"russian": "Дарио, инженер-механик"
}
},
{
"name": "<NAME>",
"guid": 191428,
"factories": [
1010285
],
"replaceInputs": [
{
"OldInput": 1010241,
"NewInput": 1010228
}
],
"locaText": {
"brazilian": "Glass Maker",
"portuguese": "Glass Maker",
"english": "Glass Maker",
"chinese": "玻璃工",
"french": "Verrier",
"italian": "Artigiano del vetro",
"polish": "Wytwórca szkła",
"spanish": "Cristalero",
"taiwanese": "玻璃工",
"german": "Glasmacher",
"japanese": "ガラス職人",
"korean": "유리 제작자",
"russian": "Стекловар"
}
},
{
"name": "Cementer",
"guid": 191462,
"factories": [
1010280
],
"replaceInputs": [
{
"OldInput": 1010231,
"NewInput": 1010201
}
],
"locaText": {
"brazilian": "Constructor",
"portuguese": "Constructor",
"english": "Cementer",
"chinese": "水泥工",
"french": "Cimentier",
"italian": "Produttore di cemento",
"polish": "Operator betoniarki",
"spanish": "Cementero",
"taiwanese": "水泥工",
"german": "Zementierer",
"japanese": "セメント職人",
"korean": "시멘트 제조가",
"russian": "Мастер цементных работ"
}
}
],
"regions": [
{
"name": "Moderate",
"guid": 5000000,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYAUlEQVRogeWad1RU1/r3jzVqEiMIjsycc/Y5Z0bAEjUaJRYURGwoClaGoRcF6SgI0ovUoYu9oiCodEXFBkgVREUjiYKKWFEjaOLNNbnf9w8Iv8SbmxtvVv56n7W+a2atOfvM/uxnP/vZjaL+P7Y+FEX17fn80HIfWuZvs34URQ1SV1f/RCQSfUxR1EDqP0P9AtxfRlEficXiIWKxeAhFUR9RFNX/D8q9/45+FEUN6Pmvfn+izH+1vhRFDeYlkglShlnNMMw4XoMnHMcNe69y/SmKGiiiqI9pmlalh9MSiUSiScTkC04imShIJJqEEA1VVdWhPeV+r3K/AAyWSCTDZRIJzbLs2J4y/f8qSD+JRDKcJ2TD6W020P1y7GOBJnIpIdMFmh7FqauPHD<KEY>
"locaText": {
"polish": "<NAME>",
"english": "The Old World",
"taiwanese": "舊世界",
"brazilian": "Temperate",
"russian": "Старый Свет",
"chinese": "旧世界",
"portuguese": "Temperate",
"french": "L'Ancien Monde",
"korean": "구대륙",
"japanese": "旧世界",
"italian": "Il Vecchio Mondo",
"german": "Die Alte Welt",
"spanish": "El Viejo Mundo"
}
},
{
"name": "Colony01",
"guid": 5000001,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAYAUlEQVRogeWad1RU1/r3jzVqEiMIjsycc/Y5Z0bAE<KEY>
"locaText": {
"polish": "Nowy Świat",
"english": "The New World",
"taiwanese": "新世界",
"brazilian": "The New World",
"russian": "Новый Свет",
"chinese": "新世界",
"portuguese": "The New World",
"french": "Le Nouveau Monde",
"korean": "신대륙",
"japanese": "新世界",
"italian": "Il Nuovo Mondo",
"german": "Die Neue Welt",
"spanish": "Nuevo Mundo"
}
}
],
"languages": [
"brazilian",
"chinese",
"english",
"french",
"german",
"italian",
"japanese",
"korean",
"polish",
"portuguese",
"russian",
"spanish",
"taiwanese"
]
}<file_sep># Anno 1800 Calculator
* A calculator for the computer game [Anno 1800](https://www.ubisoft.com/de-de/game/anno-1800/) to compute the required production depending on the population
* To use the calculator go to the following website: https://nihoel.github.io/Anno1800Calculator/
* To use it offline, download, unzip and open index.html with a browser: https://github.com/NiHoel/Anno1800Calculator/archive/v2.2.zip
* An application that reads the population count from the game and enters it into the calculator can be found here: https://github.com/Dejauxvue/AnnoCalculatorServer
* License: MIT
* Author: <NAME>
<file_sep>let versionCalculator = "v2.2";
let EPSILON = 0.01
products = new Map();
assetsMap = new Map();
view = {
regions: [],
populationLevels: [],
sortedPopulationLevels: [],
factories: [],
categories: [],
workforce: [],
buildingMaterialsNeeds: [],
multiFactoryProducts: [],
items: [],
settings: {
language: ko.observable(navigator.language.startsWith("de") ? "german" : "english")
},
texts: {}
};
class NamedElement {
constructor(config) {
$.extend(this, config);
this.locaText = this.locaText || {}
this.name = ko.computed(() => {
let text = this.locaText[view.settings.language()];
if (text)
return text;
text = this.locaText["english"];
return text ? text : config.name;
})
}
}
class Region extends NamedElement { }
class Option extends NamedElement {
constructor(config) {
super(config);
this.checked = ko.observable(false);
this.visible = !!config;
}
}
class Island {
constructor(config = {}) {
this.name = ko.observable(config.name ? config.name : "Anno 1800 Calculator");
this.name.subscribe(val => { window.document.title = val; });
}
}
class Factory extends NamedElement {
constructor(config) {
super(config);
if (config.region)
this.region = assetsMap.get(config.region);
this.amount = ko.observable(0);
this.extraAmount = ko.observable(0);
this.percentBoost = ko.observable(100);
this.boost = ko.computed(() => parseInt(this.percentBoost()) / 100);
this.demands = new Set();
this.buildings = ko.computed(() => Math.max(0, parseFloat(this.amount()) + parseFloat(this.extraAmount())) / this.tpmin / this.boost());
this.existingBuildings = ko.observable(0);
this.items = [];
this.workforceDemand = this.getWorkforceDemand();
this.buildings.subscribe(val => this.workforceDemand.updateAmount(val));
}
getInputs() {
return this.inputs || [];
}
getOutputs() {
return this.outputs || [];
}
referenceProducts() {
this.getInputs().forEach(i => i.product = assetsMap.get(i.Product));
this.getOutputs().forEach(i => i.product = assetsMap.get(i.Product));
this.product = this.getProduct();
if (!this.icon)
this.icon = this.product.icon;
this.extraDemand = new Demand({ guid: this.getOutputs()[0].Product });
this.extraAmount.subscribe(val => {
val = parseFloat(val);
let amount = parseFloat(this.amount());
if (val < -Math.ceil(amount * 100) / 100)
this.extraAmount(- Math.ceil(amount * 100) / 100);
else
this.extraDemand.updateAmount(Math.max(val, -amount));
});
this.extraDemand.updateAmount(parseFloat(this.extraAmount()));
}
getProduct() {
return this.getOutputs()[0].product;
}
getWorkforceDemand() {
for (let m of this.maintenances) {
let a = assetsMap.get(m.Product);
if (a instanceof Workforce)
return new WorkforceDemand($.extend({ factory: this, workforce: a }, m));
}
}
getRegionExtendedName() {
if (!this.region || this.product.factories.length <= 1)
return this.name;
return `${this.name()} (${this.region.name()})`;
}
updateAmount() {
var sum = 0;
this.demands.forEach(d => {
var a = d.amount();
// if (a <= -EPSILON || a > 0)
sum += a;
});
if (sum < -EPSILON) {
if (sum < this.extraDemand.amount()) {
this.extraDemand.updateAmount(0);
this.amount(0);
} else {
this.extraDemand.updateAmount(this.extraDemand.amount() - sum);
}
}
else {
// for initialization before creation this.extraDemand
var extraDemand = this.extraDemand ? this.extraDemand.amount() : 0;
var val = Math.max(0, sum - extraDemand);
if (val < 1e-16)
val = 0;
this.amount(val);
}
}
add(demand) {
this.demands.add(demand);
this.updateAmount();
}
remove(demand) {
this.demands.delete(demand);
this.updateAmount();
}
incrementBuildings() {
if (this.buildings() <= 0 || parseInt(this.percentBoost()) <= 1)
return;
var minBuildings = Math.ceil(this.buildings() * parseInt(this.percentBoost()) / (parseInt(this.percentBoost()) - 1));
let nextBoost = Math.ceil(parseInt(this.percentBoost()) * this.buildings() / minBuildings)
this.percentBoost(Math.min(nextBoost, parseInt(this.percentBoost()) - 1));
}
decrementBuildings() {
let currentBuildings = Math.ceil(this.buildings() * 100) / 100;
var nextBuildings = Math.floor(currentBuildings);
if (nextBuildings <= 0)
return;
if (currentBuildings - nextBuildings < 0.01)
nextBuildings = Math.floor(nextBuildings - 0.01);
var nextBoost = Math.ceil(100 * this.boost() * this.buildings() / nextBuildings);
if (nextBoost - parseInt(this.percentBoost()) < 1)
nextBoost = parseInt(this.percentBoost()) + 1;
this.percentBoost(nextBoost);
}
incrementPercentBoost() {
this.percentBoost(parseInt(this.percentBoost()) + 1);
}
decrementPercentBoost() {
this.percentBoost(parseInt(this.percentBoost()) - 1);
}
}
class Product extends NamedElement {
constructor(config) {
super(config);
this.amount = ko.observable(0);
this.factories = this.producers.map(p => assetsMap.get(p));
this.fixedFactory = ko.observable(null);
if (this.producers) {
this.amount = ko.computed(() => this.factories.map(f => f.amount()).reduce((a, b) => a + b));
}
}
}
class Demand extends NamedElement {
constructor(config) {
super(config);
this.amount = ko.observable(0);
this.product = assetsMap.get(this.guid);
this.factory = ko.observable(config.factory);
if (this.product) {
this.updateFixedProductFactory(this.product.fixedFactory());
this.product.fixedFactory.subscribe(f => this.updateFixedProductFactory(f));
if (this.consumer)
this.consumer.factory.subscribe(() => this.updateFixedProductFactory(this.product.fixedFactory()));
this.demands = this.factory().getInputs().map(input => {
var d;
let items = this.factory().items.filter(item => item.replacements.has(input.Product));
if (items.length)
d = new DemandSwitch(this, input, items);
else
d = new Demand({ guid: input.Product, consumer: this });
this.amount.subscribe(val => d.updateAmount(val * input.Amount));
return d;
});
this.amount.subscribe(val => {
// :MARK: <NAME>
console.log(' -->', this.product.name(), 'updated to', val);
this.self_busy = true;
this.factory().updateAmount();
this.self_busy = false;
});
this.buildings = ko.computed(() => parseFloat(this.amount()) / this.factory().tpmin / this.factory().boost());
}
this.self_busy = false;
this.busy = ko.computed(() => {
if (this.self_busy) return this;
for (let d of this.demands) {
let busy = d.busy();
if (busy) return busy;
}
return false;
});
}
updateFixedProductFactory(f) {
if (f == null) {
if (this.consumer) { // find factory in the same region as consumer
let region = this.consumer.factory().region;
if (region) {
for (let fac of this.product.factories) {
if (fac.region === region) {
f = fac;
break;
}
}
}
}
}
if (f == null) // region based approach not successful
f = this.product.factories[0];
if (f != this.factory()) {
if (this.factory())
this.factory().remove(this);
this.factory(f);
f.add(this);
}
}
updateAmount(amount) {
this.amount(amount);
}
}
class DemandSwitch {
constructor(consumer, input, items) {
this.items = items;
this.demands = [ // use array index to toggle
new Demand({ guid: input.Product, consumer: consumer }),
new Demand({ guid: items[0].replacements.get(input.Product), consumer: consumer })
];
this.amount = 0;
this.items.forEach(item => item.checked.subscribe(() => this.updateAmount(this.amount)));
this.self_busy = false;
this.busy = ko.computed(() => {
if (this.self_busy) return this;
for (let d of this.demands) {
let busy = d.busy();
if (busy) return busy;
}
return false;
});
}
updateAmount(amount) {
this.amount = amount;
this.demands.forEach((d, idx) => {
let checked = this.items.map(item => item.checked()).reduce((a, b) => a || b);
this.self_busy = true;
d.updateAmount(checked == idx ? amount : 0);
this.self_busy = false;
});
}
}
class Need extends Demand {
constructor(config) {
super(config);
this.allDemands = [];
let treeTraversal = node => {
if (node instanceof Demand)
this.allDemands.push(node);
(node.demands || []).forEach(treeTraversal);
}
treeTraversal(this);
}
}
class PopulationNeed extends Need {
constructor(config) {
super(config);
this.inhabitants = 0;
this.percentBoost = ko.observable(100);
this.percentBoost.subscribe(val => {
val = parseInt(val);
if (val < 1)
this.percentBoost(1);
})
this.boost = ko.computed(() => parseInt(this.percentBoost()) / 100);
this.boost.subscribe(() => this.updateAmount(this.inhabitants));
this.checked = ko.observable(true);
this.banned = ko.computed(() => {
var checked = this.checked();
var noOptionalNeeds = view.settings.noOptionalNeeds.checked();
return !checked || this.happiness && noOptionalNeeds;
})
this.optionalAmount = ko.observable(0);
this.banned.subscribe(banned => {
if (banned)
this.amount(0);
else
this.amount(this.optionalAmount());
});
}
updateAmount(inhabitants) {
this.inhabitants = inhabitants;
this.optionalAmount(this.tpmin * inhabitants * this.boost());
if (!this.banned())
this.amount(this.optionalAmount());
}
incrementPercentBoost() {
this.percentBoost(parseInt(this.percentBoost()) + 1);
}
decrementPercentBoost() {
this.percentBoost(parseInt(this.percentBoost()) - 1);
}
}
class BuildingMaterialsNeed extends Need {
constructor(config) {
super(config);
this.product = config.product;
this.factory(config.factory);
this.factory().add(this);
}
updateAmount() {
var otherDemand = 0;
this.factory().demands.forEach(d => otherDemand += d == this ? 0 : d.amount());
var overProduction = this.factory().existingBuildings() * this.factory().tpmin * this.factory().boost() - otherDemand;
this.amount(Math.max(0, overProduction));
}
updateFixedProductFactory() { }
}
class PopulationLevel extends NamedElement {
constructor(config) {
super(config);
this.workforce = assetsMap.get(config.workforce);
this.amount = ko.observable(0);
this.projectedAmount = ko.observable(0);
this.jobRate = ko.pureComputed(() => {
return parseFloat((this.workforce.amount() / this.projectedAmount() * 100).toString()).toFixed(2);
});
this.jobRateVisible = ko.pureComputed(() => {
return Math.isFinite(this.jobRate);
});
this.houseCount = ko.pureComputed(() => {
return Math.ceil(this.projectedAmount() / this.fullHouse);
});
this.recalculateFlag = false;
this.noOptionalNeeds = ko.observable(false);
this.previousAmount = null;
this.needs = [];
this.workforceSubscription = null;
config.needs.forEach(n => {
if (n.tpmin > 0)
this.needs.push(new PopulationNeed(n));
});
// :MARK: :A1: De is de feedback loop, koppel dit aan de workforce
this.amount.subscribe(val => {
console.clear();
val = parseInt(val);
console.log('-------- INPUT', this.name(), val);
if (this.previousAmount > val || val > this.projectedAmount())
this.recalculateAllLevels(val);
this.previousAmount = val;
});
this.workforceSubscribe();
// Once the projected amount is calculated is should be sent here.
this.projectedAmount.subscribe(val => {
console.info(this.name(), 'projected:', val);
this.workforceUnsubscribe();
let previous = this.workforce.amount();
this.needs.forEach(n => n.updateAmount(val));
this.workforceSubscribe();
let current = this.workforce.amount();
if (current != previous || current > val) {
this.pipelineAmount(current);
}
});
}
pipelineAmount(value, fromInput = false) {
if (fromInput == false) {
let base = parseInt(this.amount());
if (base > value)
value = base;
}
this.projectedAmount(this.ceilPopulation(value));
}
ceilPopulation(value) {
let remainder = value % this.fullHouse;
if (remainder != 0)
value += this.fullHouse - remainder;
return value;
}
recalculateAllLevels(value) {
// Unsubscribe from workforce updates if we foresee recalculations.
for (let l of view.sortedPopulationLevels) {
if (l != this && l.shouldRecalculate()) {
l.recalculateFlag = true;
l.workforceUnsubscribe();
}
}
for (let l of view.sortedPopulationLevels) {
if (l == this) {
this.pipelineAmount(value, true);
}
else if (l.recalculateFlag) {
l.recalculateFlag = false;
l.recalculate();
l.workforceSubscribe();
}
}
}
shouldRecalculate() {
let amount = parseInt(this.amount());
return amount == 0 && this.projectedAmount() != 0;
}
recalculate() {
let amount = parseInt(this.amount());
console.log(this.name(), 'is recalculating');
this.pipelineAmount(amount, true);
}
workforceSubscribe() {
if (this.workforceSubscription == null) {
console.log(this.name(), 'subscribed to workforce');
this.workforceSubscription = this.workforce.amount.subscribe(val => this.receiveWorkforce(val));
}
}
workforceUnsubscribe() {
if (this.workforceSubscription != null) {
console.log(this.name(), 'unsubscribed from workforce');
this.workforceSubscription.dispose();
this.workforceSubscription = null;
}
}
receiveWorkforce(val) {
console.log(this.name(), 'workforce updated to', val);
this.pipelineAmount(val);
}
getBusyNeed() {
for (let n of this.needs) {
let busy = n.busy();
if (busy) return busy;
}
return false;
}
incrementAmount() {
this.amount(parseFloat(this.amount()) + 1);
}
decrementAmount() {
this.amount(parseFloat(this.amount()) - 1);
}
}
class ProductCategory extends NamedElement {
constructor(config) {
super(config);
this.products = config.products.map(p => assetsMap.get(p));
}
}
class Workforce extends NamedElement {
constructor(config) {
super(config);
this.amount = ko.observable(0);
this.demands = [];
}
updateAmount() {
var sum = 0;
this.demands.forEach(d => sum += d.amount());
this.amount(sum);
}
add(demand) {
this.demands.push(demand);
}
}
class WorkforceDemand extends NamedElement {
constructor(config) {
super(config);
this.amount = ko.observable(0);
this.workforce.add(this);
this.amount.subscribe(val => this.workforce.updateAmount());
}
updateAmount(buildings) {
this.amount(Math.ceil(buildings) * this.Amount);
}
}
class Item extends Option {
constructor(config) {
super(config);
this.replacements = new Map();
this.replacementArray = [];
if (this.replaceInputs)
this.replaceInputs.forEach(r => {
this.replacementArray.push({
old: assetsMap.get(r.OldInput),
new: assetsMap.get(r.NewInput)
});
this.replacements.set(r.OldInput, r.NewInput);
});
this.factories = this.factories.map(f => assetsMap.get(f));
}
}
class PopulationReader {
constructor() {
this.url = 'http://localhost:8000/AnnoServer/Population/';
this.notificationShown = false;
this.currentVersion;
this.recentVersion;
// only ping the server when the website is run locally
if (isLocal()) {
this.requestInterval = setInterval(this.handleResponse.bind(this), 1000);
$.getJSON("https://api.github.com/repos/Dejauxvue/AnnoCalculatorServer/releases/latest").done((release) => {
this.recentVersion = release.tag_name;
this.checkVersion();
});
}
}
async handleResponse() {
const response = await fetch(this.url);
const myJson = await response.json(); //extract JSON from the http response
if (!myJson)
return;
if (myJson.version) {
this.currentVersion = myJson.version;
this.checkVersion();
}
console.log('answer: ', myJson);
if (myJson) {
view.populationLevels.forEach(function (element) {
element.amount(0);
});
if (myJson.farmers) {
view.populationLevels[0].amount(myJson.farmers);
}
if (myJson.workers) {
view.populationLevels[1].amount(myJson.workers);
}
if (myJson.artisans) {
view.populationLevels[2].amount(myJson.artisans);
}
if (myJson.engineers) {
view.populationLevels[3].amount(myJson.engineers);
}
if (myJson.investors) {
view.populationLevels[4].amount(myJson.investors);
}
if (myJson.jornaleros) {
view.populationLevels[5].amount(myJson.jornaleros);
}
if (myJson.obreros) {
view.populationLevels[6].amount(myJson.obreros);
}
}
}
checkVersion() {
if (!this.notificationShown && this.recentVersion && this.currentVersion && this.recentVersion !== this.currentVersion) {
this.notificationShown = true;
$.notify({
// options
message: view.texts.serverUpdate.name()
}, {
// settings
type: 'warning',
placement: { align: 'center' }
});
}
}
}
function reset() {
assetsMap.forEach(a => {
if (a instanceof Product)
a.fixedFactory(null);
if (a instanceof Factory) {
a.percentBoost(100);
a.extraAmount(0);
}
if (a instanceof Factory)
a.existingBuildings(0);
if (a instanceof PopulationLevel)
a.amount(0);
if (a instanceof Item)
a.checked(false);
});
view.populationLevels.forEach(l => l.needs.forEach(n => {
if (n.checked)
n.checked(true);
if (n.percentBoost)
n.percentBoost(100);
}));
}
function init() {
view.settings.options = [];
for (let attr in options) {
let o = new Option(options[attr]);
o.id = attr;
view.settings[attr] = o;
view.settings.options.push(o);
if (localStorage) {
let id = "settings." + attr;
if (localStorage.getItem(id) != null)
o.checked(parseInt(localStorage.getItem(id)));
o.checked.subscribe(val => localStorage.setItem(id, val ? 1 : 0));
}
}
view.settings.languages = params.languages;
view.settings.island = new Island();
if (localStorage) {
{
let id = "islandName";
if (localStorage.getItem(id))
view.settings.island.name(localStorage.getItem(id));
view.settings.island.name.subscribe(val => localStorage.setItem(id, val));
}
{
let id = "language";
if (localStorage.getItem(id))
view.settings.language(localStorage.getItem(id));
view.settings.language.subscribe(val => localStorage.setItem(id, val));
}
}
for (let region of params.regions) {
let r = new Region(region);
assetsMap.set(r.guid, r);
view.regions.push(r);
}
for (let workforce of params.workforce) {
let w = new Workforce(workforce)
assetsMap.set(w.guid, w);
view.workforce.push(w);
}
for (let factory of params.factories) {
let f = new Factory(factory)
assetsMap.set(f.guid, f);
view.factories.push(f);
if (localStorage) {
{
let id = f.guid + ".percentBoost";
if (localStorage.getItem(id))
f.percentBoost(parseInt(localStorage.getItem(id)));
f.percentBoost.subscribe(val => {
val = parseInt(val);
if (val == null || !isFinite(val) || isNaN(val)) {
f.percentBoost(parseInt(localStorage.getItem(id)) || 100);
return;
}
localStorage.setItem(id, val)
});
}
{
let id = f.guid + ".existingBuildings";
if (localStorage.getItem(id))
f.existingBuildings(parseInt(localStorage.getItem(id)));
f.existingBuildings.subscribe(val => localStorage.setItem(id, val));
}
}
}
let products = [];
for (let product of params.products) {
if (product.producers && product.producers.length) {
let p = new Product(product);
products.push(p);
assetsMap.set(p.guid, p);
if (p.factories.length > 1)
view.multiFactoryProducts.push(p);
if (localStorage) {
{
let id = p.guid + ".percentBoost";
if (localStorage.getItem(id)) {
let b = parseInt(localStorage.getItem(id))
p.factories.forEach(f => f.percentBoost(b));
localStorage.removeItem(id);
}
}
{
let id = p.guid + ".fixedFactory";
if (localStorage.getItem(id))
p.fixedFactory(assetsMap.get(parseInt(localStorage.getItem(id))));
p.fixedFactory.subscribe(f => f ? localStorage.setItem(id, f.guid) : localStorage.removeItem(id));
}
}
}
}
view.factories.forEach(f => f.referenceProducts());
for (let item of (params.items || [])) {
let i = new Item(item);
assetsMap.set(i.guid, i);
view.items.push(i);
i.factories.forEach(f => f.items.push(i));
if (localStorage) {
let id = i.guid + ".checked";
if (localStorage.getItem(id))
i.checked(parseInt(localStorage.getItem(id)));
i.checked.subscribe(val => localStorage.setItem(id, val ? 1 : 0));
}
}
// :MARK: Hier worden poplevels geinitieerd.
for (let level of params.populationLevels) {
let l = new PopulationLevel(level)
assetsMap.set(l.guid, l);
view.populationLevels.push(l);
if (localStorage) {
let id = l.guid + ".amount";
if (localStorage.getItem(id))
l.amount(parseInt(localStorage.getItem(id)));
l.amount.subscribe(val => {
val = parseInt(val);
if (val == null || !isFinite(val) || isNaN(val)) {
l.amount(parseInt(localStorage.getItem(id)) || 0);
return;
}
localStorage.setItem(id, val);
});
} else {
l.amount.subscribe(val => {
if (val == null || !isFinite(val) || isNaN(val)) {
l.amount(0);
return;
}
});
}
for (let n of l.needs) {
if (localStorage) {
{
let id = `${l.guid}[${n.guid}].checked`;
if (localStorage.getItem(id))
n.checked(parseInt(localStorage.getItem(id)))
n.checked.subscribe(val => localStorage.setItem(id, val ? 1 : 0));
}
{
let id = `${l.guid}[${n.guid}].percentBoost`;
if (localStorage.getItem(id))
n.percentBoost(parseInt(localStorage.getItem(id)));
n.percentBoost.subscribe(val => {
val = parseInt(val);
if (val == null || !isFinite(val) || isNaN(val)) {
n.percentBoost(parseInt(localStorage.getItem(id)) || 100);
return;
}
localStorage.setItem(id, val);
});
}
} else {
n.percentBoost.subscribe(val => {
if (val == null || !isFinite(val) || isNaN(val)) {
n.percentBoost(100);
return;
}
});
}
}
}
view.sortedPopulationLevels = view.populationLevels.slice().sort((a, b) => b.order - a.order);
for (category of params.productFilter) {
let c = new ProductCategory(category);
assetsMap.set(c.guid, c);
view.categories.push(c);
}
for (let p of view.categories[1].products) {
for (let b of p.factories) {
if (b) {
b.editable = true;
let n = new BuildingMaterialsNeed({ guid: p.guid, factory: b, product: p });
b.boost.subscribe(() => n.updateAmount());
b.existingBuildings.subscribe(() => n.updateAmount());
view.buildingMaterialsNeeds.push(n);
if (localStorage) {
let oldId = b.guid + ".buildings";
let id = b.guid + ".existingBuildings"
if (localStorage.getItem(id) || localStorage.getItem(oldId))
b.existingBuildings(parseInt(localStorage.getItem(id) || localStorage.getItem(oldId)));
b.existingBuildings.subscribe(val => localStorage.setItem(id, val));
}
}
}
}
ko.applyBindings(view, $(document.body)[0]);
// negative extra amount must be set after the demands of the population are generated
// otherwise it would be set to zero
for (let f of view.factories) {
if (localStorage) {
let id = f.guid + ".extraAmount";
if (localStorage.getItem(id)) {
f.extraAmount(parseFloat(localStorage.getItem(id)));
}
f.extraAmount.subscribe(val => {
val = parseFloat(val);
if (val == null || !isFinite(val) || isNaN(val)) {
f.extraAmount(parseFloat(localStorage.getItem(id)) || 0);
return;
}
localStorage.setItem(id, val);
});
} else {
f.extraAmount.subscribe(val => {
if (val == null || !isFinite(val) || isNaN(val)) {
f.extraAmount(0);
}
});
}
}
var keyBindings = ko.computed(() => {
var bindings = new Map();
for (var l of view.populationLevels) {
for (var c of l.name().toLowerCase()) {
if (!bindings.has(c)) {
bindings.set(c, $(`.ui-race-unit-name[race-unit-name=${l.name()}] ~ .input .input-group input`));
break;
}
}
}
return bindings;
})
$(document).on("keydown", (evt) => {
if (evt.altKey || evt.ctrlKey || evt.shiftKey)
return true;
if (evt.target.tagName === 'INPUT' && evt.target.type === "text")
return true;
var focused = false;
var bindings = keyBindings();
if (bindings.has(evt.key)) {
focused = true;
bindings.get(evt.key).focus().select();
}
if (evt.target.tagName === 'INPUT' && !isNaN(parseInt(evt.key)) || focused) {
let isDigit = evt.key >= "0" && evt.key <= "9";
return ['ArrowUp', 'ArrowDown', 'Backspace', 'Delete'].includes(evt.key) || isDigit || evt.key === "." || evt.key === ",";
}
});
// listen for the server providing the population count
// window.reader = new PopulationReader();
}
function removeSpaces(string) {
if (typeof string === "function")
string = string();
return string.replace(/\W/g, "");
}
function isLocal() {
return window.location.protocol == 'file:' || /localhost|127\.0\.0\.1/.test(window.location.host.replace);
}
function exportConfig() {
var saveData = (function () {
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
return function (data, fileName) {
var blob = new Blob([JSON.stringify(data, null, 4)], { type: "text/json" }),
url = window.URL.createObjectURL(blob);
a.href = url;
a.download = fileName;
a.click();
window.URL.revokeObjectURL(url);
};
}());
saveData(localStorage, (view.settings.island.name() || "Anno1800CalculatorConfig") + ".json");
}
function checkAndShowNotifications() {
$.getJSON("https://api.github.com/repos/NiHoel/Anno1800Calculator/releases/latest").done((release) => {
$('#download-calculator-button').attr("href", release.zipball_url);
if (isLocal()) {
if (release.tag_name !== versionCalculator) {
$.notify({
// options
message: view.texts.calculatorUpdate.name()
}, {
// settings
type: 'warning',
placement: { align: 'center' }
});
}
}
if (localStorage) {
if (localStorage.getItem("versionCalculator") != versionCalculator) {
if (view.texts.newFeature.name() && view.texts.newFeature.name().length)
$.notify({
// options
message: view.texts.newFeature.name()
}, {
// settings
type: 'success',
placement: { align: 'center' },
timer: 10000
});
}
localStorage.setItem("versionCalculator", versionCalculator);
}
});
}
function installImportConfigListener() {
if (localStorage) {
$('#config-selector').on('change', event => {
event.preventDefault();
if (!event.target.files || !event.target.files[0])
return;
let file = event.target.files[0];
console.log(file);
var fileReader = new FileReader();
fileReader.onload = function (ev) {
let text = ev.target.result || ev.currentTarget.result;
try {
let config = JSON.parse(text);
if (localStorage) {
localStorage.clear();
for (var a in config)
localStorage.setItem(a, config[a]);
localStorage.setItem("versionCalculator", versionCalculator);
location.reload();
} else {
console.error("No local storage accessible to write result into.");
}
} catch (e) {
console.error(e);
}
};
fileReader.onerror = function (err) {
console.error(err);
};
fileReader.readAsText(file);
});
}
}
$(document).ready(function () {
// parse the parameters
for (let attr in texts) {
view.texts[attr] = new NamedElement({ name: attr, locaText: texts[attr] });
}
// check version of calculator - display update and new featur notification
checkAndShowNotifications();
//update links of download buttons
$.getJSON("https://api.github.com/repos/Dejauxvue/AnnoCalculatorServer/releases/latest").done((release) => {
$('#download-calculator-server-button').attr("href", release.assets[0].browser_download_url);
});
installImportConfigListener();
//load parameters
if (window.params == null)
$('#params-dialog').modal("show");
else
init();
$('#params-dialog').on('hide.bs.modal', () => {
try {
window.params = JSON.parse($('textarea#input-params').val());
init();
} catch (e) {
console.log(e);
$('#params-dialog').modal("show");
}
});
})
texts = {
inhabitants: {
english: "Inhabitants",
german: "Bevölkerung"
},
workforce: {
english: "Required Workforce",
german: "Benötigte Arbeitskraft"
},
productionBoost: {
english: "Production Boost",
german: "Produktionsboost"
},
requiredNumberOfBuildings: {
english: "Required Number of Buildings",
german: "Benötigte Anzahl an Gebäuden"
},
existingNumberOfBuildings: {
english: "Existing Number of Buildings",
german: "Vorhandene Anzahl an Gebäuden"
},
existingNumberOfBuildingsIs: {
english: "Is:",
german: "Ist:"
},
requiredNumberOfBuildings: {
english: "Required:",
german: "Benötigt:"
},
requiredNumberOfBuildingsDescription: {
english: "Required number of buildings to produce consumer products",
german: "Benötigte Gebäudeanzahl zur Produktion von Verbrauchsgütern"
},
tonsPerMinute: {
english: "Production in Tons per Minute",
german: "Produktion in Tonnen pro Minute"
},
language: {
english: "Language",
german: "Sprache"
},
islandName: {
english: "Island name",
german: "Inselname"
},
settings: {
english: "Settings",
german: "Einstellungen"
},
help: {
english: "Help",
german: "Hilfe"
},
chooseFactories: {
english: "Modify Production Chains",
german: "Modifiziere Produktionsketten"
},
noFixedFactory: {
english: "Automatic: same region as consumer",
german: "Automatisch: gleichen Region wie Verbraucher"
},
consumptionModifier: {
english: "Modify the percental amount of consumption for this tier and product",
german: "Verändere die prozentuale Verbrauchsmenge für diese Ware und Bevölkerungsstufe"
},
download: {
english: "Downloads",
german: "Downloads"
},
downloadConfig: {
english: "Import / Export configuration.",
german: "Konfiguration importieren / exportieren."
},
downloadCalculator: {
english: "Download the calculator (source code of this website) to run it locally. To do so, extract the archive and double click index.html.",
german: "Lade den Warenrechner (Quellcode dieser Seite) herunter, um ihn lokal auszuführen. Zum Ausführen, extrahiere das Archiv und doppelklicke auf index.html. "
},
downloadCalculatorServer: {
english: `Download a standalone executable that reads the current population count while playing the game. Usage:
1. Download server application and calculator (using the source code from above).
2. Start Anno 1800 with the graphics setting "Windowed Full Screen".
3. Start server (Server.exe) and open downloaded calculator (index.html) - make sure that Anno does not get minimized.
4. Expand the population statistics (global or island) to update the values in the calculator.
See the following link for more information: `,
german: `Lade eine ausführbare Datei herunter, die beim Spielen die aktuellen Bevölkerungszahlen erfasst. Verwendung:
1. Lade die Serveranwendung und den Warenrechner (siehe obiger Quellcode) herunter.
2. Starte Anno 1800 mit der Graphikeinstellung "Vollbild im Fenstermodus".
3. Führe den Server (Server.exe) aus und öffne den heruntergeladenen Warenrechner (index.html) - stelle sicher, dass Anno nicht minimiert wird.
4. Klappe die Bevölkerungsstatistiken (global oder inselweit) aus, um die Werte im Warenrechner zu aktualisieren.
Siehe folgenden Link für weitere Informationen: `
},
serverUpdate: {
english: "A new server version is available. Click the download button.",
german: "Eine neue Serverversion ist verfügbar. Klicke auf den Downloadbutton."
},
calculatorUpdate: {
english: "A new calculator version is available. Click the download button.",
german: "Eine neue Version des Warenrechners ist verfügbar. Klicke auf den Downloadbutton."
},
newFeature: {
english: "New feature: Dark mode available. Click the button to the left of settings.",
german: "Neue Funktion: Dark-Mode verfügbar. Klicke auf den Button links neben den Einstellungen."
},
helpContent: {
german:
`Verwendung: Trage die aktuellen oder angestrebten Einwohner pro Stufe in die oberste Reihe ein. Die Produktionsketten aktualisieren sich automatisch sobald man die Eingabe verlässt. Es werden nur diejenigen Fabriken angezeigt, die benötigt werden.
In der darunterliegenden Reihe wird die Arbeitskraft angezeigt, die benötigt wird, um alle Gebäude zu betreiben (jeweils auf die nächste ganze Fabrik gerundet).
Danach folgen zwei große Abschnitte, die sich wiederum in Unterabschnitte unterteilen. Der erste gibt einen Überblick über alle benötigten Gebäude, sortiert nach dem produzierten Warentyp. Der zweite schlüsselt die einzelnen Produktionsketten nach Bevölkerungsstufen auf. Jeder der Abschnitte kann durch einen Klick auf die Überschrift zusammengeklappt werden. Durch das Abwählen des Kontrollkästchens wird das entsprechende Bedürfnis von der Berechnung ausgenommen.
In jeder Kachel wird der Name der Fabrik, das Icon der hergestellten Ware, der Boost für den Gebäudetyp, die Anzahl der benötigten Gebäude und die Produktionsrate in Tonnen pro Minute angezeigt. Die Anzahl der Gebäude wird mit zwei Nachkommastellen angezeigt, um die Höhe der Überkapazitäten direkt ablesen zu können. Daneben befinden sich zwei Buttons. Diese versuchen den Boost so einzustellen, dass alle Gebäude des Typs bestmöglich ausgelastet sind und dabei ein Gebäude mehr (+) bzw. eines weniger (-) benötigt wird.
Da Baumaterialien sich Zwischenmaterialien mit Konsumgütern teilen sind sie (im Gegensatz zu Warenrechnern früherer Annos) mit aufgeführt, um so den Verbrauch von Minen besser planen zu können. Es muss die Anzahl der Endbetriebe per Hand eingegeben werden.
Über das Zahnrad am rechten oberen Bildschirmrand gelangt man zu den Einstellungen. Dort können die Sprache ausgewählt und die Menge der dargestellten Informationen angepasst werden.
Über die drei Zahnräder neben dem Einstellungsdialog öffnet sich der Dialog zur Modifikation der Produktionsketten. In der oberen Hälfte kann die Fabrik ausgewählt werden, die die dargestellte Ware herstellen soll. In der unter Hälfte können Spezialisten aktiviert werden, welche die Eingangswaren der Fabriken verändern. Standardmäßig ist die Gleiche-Region-Regel eingestellt. Exemplarisch besagt diese, dass das Holz für die Destillerien in der Neuen Welt, das Holz für Nähmaschinen aber in der Alten Welt produziert wird.
Durch Eingabe des ersten (bzw. zweiten - bei Uneindeutigkeiten) Buchstaben des Bevölkerungsnames wird das zugehörige Eingabefeld fokussiert. Die Anzahl dort kann ebenfalls durch Drücken der Pfeiltasten erhöht und verringert werden.
Über den Downloadbutton kann dieser Rechner sowie eine zusätzliche Serveranwendung heruntergeladen werden. Mit der Serveranwendung lassen sich die Bevölkerungszahlen automatisch aus dem Spiel auslesen. Ich danke meinem Kollegen Josua Bloeß für die Umsetzung.
Haftungsausschluss:
Der Warenrechner wird ohne irgendeine Gewährleistung zur Verfügung gestellt. Die Arbeit wurde in KEINER Weise von Ubisoft Blue Byte unterstützt. Alle Assets aus dem Spiel Anno 1800 sind © by Ubisoft.
Dies sind insbesondere, aber nicht ausschließlich alle Icons der Bevölkerung, Waren und Gegenstände sowie die Daten der Produktionsketten und die Verbrachswerte der Bevölkerung.
Diese Software steht unter der MIT-Lizenz.
Autor:
<NAME>
Fehler und Verbesserungen:
Falls Sie auf Fehler oder Unannehmlichkeiten stoßen oder Verbesserungen vorschlagen möchten, erstellen Sie ein Issue auf GitHub (https://github.com/NiHoel/Anno1800Calculator/issues)`,
english:
`Usage: Enter the current or desired number of inhabitants per level into the top most row. The production chains will update automatically when one leaves the input field. Only the required factories are displayed.
The row below displays the workforce that is required to run all buildings (rounded towards the next complete factory).
Afterwards two big sections follow that are subdivided into smaller sections. The first one gives an overview of the required buildings sorted by the type of good that is produced. The second one lists the individual production chains for each population level. Clicking the heading collapses each section. Deselecting the checkbox leads to the need being excluded from the calculation.
Each card displays the name of the factory, the icon of the produced good, the boost for the given type of building, the number of required buildings, and the production rate in tons per minute. The number of buildings has two decimal places to directly show the amount of overcapacities. There are two buttons next to it. Those try to adjust the boost such that all buildings operate at full capacity and one more (+) or one building less (-) is required.
Since construction materials share intermediate products with consumables they are explicitly listed (unlike in calculators for previous Annos) to better plan the production of mines. The number of factories must be entered manually.
When clicking on the cog wheel in the upper right corner of the screen the settings dialog opens. There, one can chose the language, give the browser tab a name and customize the information presented by the calculator.
The three cog wheels next to the settings dialog open a dialog to modify the production chains. In the upper part, the factory can be chosen to produce the noted product. In the lower part, specialists that change the input for factories can be applied. By default, the same region policy is selected. By example, this means that the wood for desitilleries is produced in the New World while the wood for sewing machines is produced in the Old World.
Press the key corresponding to the first (or second in case of ambiguities) letter of the name of a population level to focus the input field. There, one can use the arrow keys to inc-/decrement the number.
Pressing the download button one can download the configuration, this calculator and an additional server application. The server application automatically reads the population count from the game. I thank my colleague <NAME> for the implementation.
Disclaimer:
The calculator is provided without warranty of any kind. The work was NOT endorsed by Ubisoft Blue Byte in any kind. All the assets from Anno 1800 game are © by Ubsioft.
These are especially but not exclusively all the icons of population, goods and items and the data of production chains and the consumptions values of population.
This software is under the MIT license.
Author:
<NAME>
Bugs and improvements:
If you encounter any bugs or inconveniences or if you want to suggest improvements, create an Issue on GitHub (https://github.com/NiHoel/Anno1800Calculator/issues)`
}
}
options = {
"noOptionalNeeds": {
"name": "Do not produce luxury goods",
"locaText": {
"english": "Do not produce luxury goods",
"german": "Keine Luxusgüter produzieren"
}
},
"decimalsForBuildings": {
"name": "Show number of buildings with decimals",
"locaText": {
"english": "Show number of buildings with decimals",
"german": "Zeige Nachkommastellen bei der Gebäudeanzahl"
}
},
"missingBuildingsHighlight": {
"name": "Highlight missing buildings",
"locaText": {
"english": "Highlight missing buildings",
"german": "Fehlende Gebäude hervorheben"
}
},
"additionalProduction": {
"name": "Show input field for additional production",
"locaText": {
"english": "Show input field for additional production (negative values possible)",
"german": "Zeige Eingabefeld für Zusatzproduktion (negative Werte möglich)"
}
},
"consumptionModifier": {
"name": "Show input field for percental consumption modification",
"locaText": {
"english": "Show input field for percental consumption modification",
"german": "Zeige Eingabefeld für prozentuale Änderung des Warenverbrauchs"
}
},
"hideNames": {
"name": "Hide the names of products, factories, and population levels",
"locaText": {
"english": "Hide the names of products, factories, and population levels",
"german": "Verberge die Namen von Produkten, Fabriken und Bevölkerungsstufen"
}
},
"hideProductionBoost": {
"name": "Hide the input fields for production boost",
"locaText": {
"english": "Hide the input fields for production boost",
"german": "Verberge das Eingabefelder für Produktionsboosts"
}
},
"hideNewWorldConstructionMaterial": {
"name": "Hide factory cards for construction material that produce in the new world",
"locaText": {
"english": "Hide factory cards for construction material that is produced in the New world",
"german": "Verberge die Fabrikkacheln für Baumaterial, das in der Neuen Welt produziert wird"
}
}
}
|
06c1db8f24f35d6c4be17e50c036bb00742c93f6
|
[
"JavaScript",
"Markdown"
] | 3 |
JavaScript
|
redodo/Anno1800Calculator
|
71cafa2ed486568f969b7693afff5c0764cdf810
|
62cddc9da08879716bb564e0de6e9bf881ebebe6
|
refs/heads/master
|
<file_sep># Graficas-SR6
Correr SR6.py
python3 SR6.py [argumento]
Los posibles argumentos son:
- low: para crear una imagen con low angle shot
- mid: para crear una imagen con un mediumshot
- high: para crear una imagen con un high angle shot
- all: para crear todas las imagenes anterriores
* se recomienda utilizar all para salir del paso rapido
<file_sep>#bmp_processor
#Por <NAME>
#V_A
import sys
import math
import struct
import random
import numpy as np
class bmpImage:
# Define init(). Attributes Initializer
def __init__(self, new_width, new_height):
# image data
self.image_data = bytes()
# image attributes
self.width = 0
self.height = 0
self.bits_per_pixel = 0
self.row_bytes = 0
self.row_padding = 0
# viewport
self.vp_x = 0
self.vp_y = 0
self.vp_width = 0
self.vp_height = 0
# clear colors
self.clearRgbRed = 0
self.clearRgbGreen = 0
self.clearRgbBlue = 0
# paint colors
self.paintRgbRed = 0
self.paintRgbGreen = 0
self.paintRgbBlue = 0
# texture image
self.textureImg = []
self.texture_width = 0
self.texture_height = 0
self.texture_width_ratio = 0
self.texture_height_ratio = 0
# add values
self.constructImage(new_width, new_height)
# Define constructImage(int, int). Creates the header for the BMP image
# returns: 0 on success
def constructImage(self, new_width, new_height):
self.width = new_width
self.height = new_height
self.row_bytes = new_width * 4
self.row_padding = int(math.ceil(int(self.row_bytes / 4.0))) * 4 - self.row_bytes
data = bytes('BM', 'utf-8')
data += struct.pack('i', 26 + 4 * self.width * self.height)
data += struct.pack('h', 0)
data += struct.pack('h', 0)
data += struct.pack('i', 26)
data += struct.pack('i', 12)
data += struct.pack('h', self.width)
data += struct.pack('h', self.height)
data += struct.pack('h', 1)
data += struct.pack('h', 32)
self.image_data = data
self.z_buffer = [
[-float('inf') for x in range(self.width)]
for y in range(self.height)
]
return 0
# Define glAbsolutePointPaint(int, int). Paints an individual pixel
# returns: 0 on success
def glAbsolutePoint(self,x, y):
# changes the data of an individual pixel
data = self.image_data[:26 + ((y - 1) * (self.width + self.row_padding) + (x - 1)) * 4]
data += self.rgbToByte(self.paintRgbRed, self.paintRgbGreen, self.paintRgbBlue)
data += self.image_data[30 + ((y - 1) * (self.width + self.row_padding) + (x - 1)) * 4:]
self.image_data = data
return 0
# Define glAbsolutePointPaint(int, int). Paints an individual pixel
# returns: 0 on success
def glAbsolutePointWithColor(self,x, y,color):
# changes the data of an individual pixel
data = self.image_data[:26 + ((y - 1) * (self.width + self.row_padding) + (x - 1)) * 4]
data += color
data += self.image_data[30 + ((y - 1) * (self.width + self.row_padding) + (x - 1)) * 4:]
self.image_data = data
return 0
# Define glLine(). Paints a line from point (xi,yi) to (xf,yf)
# returns: 0 on success
def glAbsoluteLine(self,xi,yi,xf,yf):
dy = yf - yi
dx = xf - xi
if (dx == 0):
for y in range(dy + 1):
self.glAbsolutePoint(xi,y + yi)
return 0
m = dy/dx
grad = m <= 1 and m >= 0
if grad and xi > xf:
xi, xf = xf, xi
yi, yf = yf, yi
dy = yf - yi
dx = xf - xi
m = dy/dx
grad = m <= 1 and m >= 0
elif yi > yf:
xi, xf = xf, xi
yi, yf = yf, yi
dy = yf - yi
dx = xf - xi
m = dy/dx
grad = m <= 1 and m >= 0
if (grad):
for x in range(dx + 1):
y = round(m*x + yi)
self.glAbsolutePoint(x+xi,y)
else:
m = 1/m
for y in range(dy + 1):
x = round(m*y + xi)
self.glAbsolutePoint(x,y + yi)
return 0
# Define glClear(). It paints the whole image in a specific rgb color.
# returns: 0 on success
def glClear(self):
first = True
pixel = self.rgbToByte(self.clearRgbRed, self.clearRgbGreen, self.clearRgbBlue)
for y in range(self.height):
if (first):
data = pixel * self.width
first = False
else:
data += pixel * self.width
# padding for each line
for x in range(self.row_padding):
data += bytes('\x00', 'utf-8')
self.image_data = self.image_data[:27] + data
return 0
#Define glClearColor(float, float, float). It change the colors used for the glClear
# returns: 0 on success
def glClearColor(self,r,g,b):
# the rgb data for glClear is store after converting the rgb numbers from float to integers
# on a scale from 0 to 255
self.clearRgbRed = int(math.ceil(float(r/1)*255))
self.clearRgbGreen = int(math.ceil(float(g/1)*255))
self.clearRgbBlue = int(math.ceil(float(b/1)*255))
return 0
# Define glColor(float, float, float). It change the colors used for painting a specific pixel
# returns: 0 on success
def glColor(self,r,g,b):
# the rgb data for the pixel painting is store after converting the rgb numbers from float
# to integers on a scale from 0 to 255
self.paintRgbRed = int(math.ceil(float(r/1)*255))
self.paintRgbGreen = int(math.ceil(float(g/1)*255))
self.paintRgbBlue = int(math.ceil(float(b/1)*255))
return 0
def glLoadTextureImage(self, texture, scale_X, scale_Y):
image = open(texture + '.bmp', "rb")
image.seek(10)
header_size = struct.unpack("=l", image.read(4))[0]
image.seek(18)
self.texture_width = struct.unpack("=l", image.read(4))[0]
self.texture_height = struct.unpack("=l", image.read(4))[0]
self.texture_width_ratio = (self.texture_width/self.width)/scale_X
self.texture_height_ratio = (self.texture_height/self.height)/scale_Y
self.textureImg = []
image.seek(header_size)
for y in range(self.texture_height):
self.textureImg.append([])
for x in range(self.texture_width):
b = ord(image.read(1))
g = ord(image.read(1))
r = ord(image.read(1))
self.textureImg[y].append(self.rgbToByte(r,g,b))
image.close()
return 0
def glObjMover(self, vertices, scale, translateX, translateY):
new_vertices = []
# transform np
scale_it = np.matrix([
[scale,0,0],
[0,scale,0],
[0,0,1]
])
for vertice in vertices:
vertice = np.matmul(scale_it,vertice)
vertice = np.sum([vertice,[translateX,translateY,0]],axis=0)
new_vertices.append([vertice.item(0),vertice.item(1),vertice.item(2)])
return new_vertices
def glObjRotate(self,vertices,angle):
new_vertices = []
# transform np
rotate_it = np.matrix([
[np.cos(angle), -np.sin(angle), 0],
[np.sin(angle), np.cos(angle), 0],
[0.01, 0.001, 1]
])
for vertice in vertices:
vertice = np.matmul(rotate_it,vertice)
new_vertices.append([vertice.item(0),vertice.item(1),vertice.item(2)])
return new_vertices
def glObjReader(self, objectName):
# opens obj file
file = open(objectName + '.obj')
lines = file.read().splitlines()
# vertices and faces
vertices = []
textures = []
faces = []
# reads each line and stores each vertice and face
for line in lines:
# gets the prefix and the values of either a vertice or a face
try:
prefix, value = line.split(' ',1)
except ValueError:
continue
# reads and store vertices
if prefix == 'v':
try:
vertices.append(list(map(float, value.split(' '))))
except ValueError:
break
# reads and store vertices
if prefix == 'vt':
try:
textures.append(list(map(float, value.split(' '))))
except ValueError:
break
# reads and store faces
elif prefix == 'f':
section = []
for face in value.split(' '):
try:
section.append(list(map(int, face.split('/'))))
except ValueError:
try:
section.append(list(map(int, face.split('//'))))
except ValueError:
break
faces.append(section)
# 2D list to return with the vertices and faces
object_skeleton = [vertices,faces,textures]
return object_skeleton
# Define glObjWriter(). Makes BMP out of a flat .obj
# Return 0 on success
def glObjWriter(self,object_skeleton,scale,translate_x, translate_y,angle = 0):
# vertices and faces
vertices = self.glObjMover(object_skeleton[0],1/scale,translate_x,translate_y)
if angle != 0:
vertices = self.glObjRotate(vertices,angle)
faces = object_skeleton[1]
textures = object_skeleton[2]
# counter
counter = 0
# draws each face of the object
for face in faces:
counter += 1
if counter%50 == 0:
sys.stdout.write('\r' + str(counter/len(faces)*100)[0:4] + "% complete")
pollygon = []
texturesToPaint = []
z_avg = 0
paint_pol = True
# gets all the vertices in a face
for i in range(len(face)):
x = int((vertices[face[i][0]-1][0])*self.width)
y = int((vertices[face[i][0]-1][1])*self.height)
z = int(vertices[face[i][0]-1][2])
tex_X = textures[face[i][1]-1][0]
tex_Y = textures[face[i][1]-1][1]
z_avg += z
texturesToPaint.append([tex_X,tex_Y])
pollygon.append([x,y])
if x >= self.width or y >= self.height:
paint_pol = False
if x < 0 or y < 0:
paint_pol = False
# avarage cooordinate
z_avg = z_avg/len(face)
# paints the face
if paint_pol:
self.glPolygonMaker(pollygon,texturesToPaint,z_avg)
sys.stdout.write('\r' + "100% complete ")
return 0
# Define glPolygonMaker(). Paints a figure given the vertices in a list.
# returns: 0 on success
def glPolygonMaker(self, vertices, textures, z_coordinate):
# lista para guardar los puntos de la figura
figurePoints = []
# se reutiliza el codigo para hacer lineas solo que se guarda cada punto
# que se pinta en figurePoints
for i in range(len(vertices)):
xi = vertices[i][0]
yi = vertices[i][1]
if i == len(vertices)-1:
xf = vertices[0][0]
yf = vertices[0][1]
else:
xf = vertices[i+1][0]
yf = vertices[i+1][1]
dy = yf - yi
dx = xf - xi
if (dx == 0):
if dy > 0:
for y in range(dy + 1):
figurePoints.append([xi,y + yi])
if z_coordinate >= self.z_buffer[xi][y+yi]:
self.z_buffer[xi][y+yi] = z_coordinate
else:
for y in range(abs(dy) + 1):
figurePoints.append([xi,y + yf])
if z_coordinate >= self.z_buffer[xi][y+yf]:
self.z_buffer[xi][y+yf] = z_coordinate
else:
m = dy/dx
grad = m <= 1 and m >= 0
if grad and xi > xf:
xi, xf = xf, xi
yi, yf = yf, yi
dy = yf - yi
dx = xf - xi
m = dy/dx
grad = m <= 1 and m >= 0
elif yi > yf:
xi, xf = xf, xi
yi, yf = yf, yi
dy = yf - yi
dx = xf - xi
m = dy/dx
grad = m <= 1 and m >= 0
if (grad):
for x in range(dx + 1):
y = round(m*x + yi)
figurePoints.append([x+xi,y])
if z_coordinate >= self.z_buffer[x+xi][y]:
self.z_buffer[x+xi][y] = z_coordinate
else:
m = 1/m
for y in range(dy + 1):
x = round(m*y + xi)
figurePoints.append([x,y + yi])
if z_coordinate >= self.z_buffer[x][y+yi]:
self.z_buffer[x][y+yi] = z_coordinate
# avoids processing the same point twice.
avoidPoints = []
counter_for_tex_Y = 0
for point in figurePoints:
if (int(textures[0][1]*self.texture_height)-1 + counter_for_tex_Y) > self.texture_height:
counter_for_tex_Y -= self.texture_height_ratio
if point[1] not in avoidPoints:
# finds which points are in the same y coordinate in the figure.
pointsToPaint = []
for i in range(len(figurePoints)):
if figurePoints[i][1] == point[1]:
pointsToPaint.append(figurePoints[i][0])
# order the points
pointsToPaint.sort()
pointsLen = len(pointsToPaint)
counter_for_tex_X = 0
if pointsLen != 0:
for xToDraw in range(pointsToPaint[0],pointsToPaint[pointsLen-1]+1):
if z_coordinate >= self.z_buffer[xToDraw][point[1]]:
if (int(textures[0][1]*self.texture_width)-1 + counter_for_tex_X) > self.texture_width:
counter_for_tex_X -= self.texture_width_ratio
self.glAbsolutePointWithColor(xToDraw,point[1], \
self.textureImg[int(textures[0][1]*self.texture_height + counter_for_tex_Y)-1][int(textures[0][0]*self.texture_width + counter_for_tex_X)])
self.z_buffer[xToDraw][point[1]] = z_coordinate
counter_for_tex_X += self.texture_width_ratio
avoidPoints.append(point[1])
counter_for_tex_Y += self.texture_height_ratio
return 0
# Define glVertex(int, int). Paints an individual pixel
# returns: 0 on success
def glVertex(self,x, y):
# painting cordinates
pcx = self.vp_x + x
pcy = self.vp_y + y
# changes the data of an individual pixel
data = self.image_data[:26 + ((pcy - 1) * (self.width + self.row_padding) + (pcx - 1)) * 4]
data += self.rgbToByte(self.paintRgbRed, self.paintRgbGreen, self.paintRgbBlue)
data += self.image_data[30 + ((pcy - 1) * (self.width + self.row_padding) + (pcx - 1)) * 4:]
self.image_data = data
return 0
# Define glColor(). Paint the whole viewport
# returns: 0 on success
def glVertexPaintVp(self):
for y in range(self.vp_height):
for x in range(self.vp_width):
self.glVertex(x,y)
return 0
# Define glViewPort(int, int, int, int). Establish an area of work for the painting process
# returns: 0 on success
def glViewPort(self, viewport_x, viewport_y, viewport_width, viewport_height):
self.vp_x = viewport_x
self.vp_y = viewport_y
self.vp_width = viewport_width
self.vp_height = viewport_height
return 0
# Define rgbToByte(int, int, int). Converts RGB to bytes
# returns: 4 bytes indicating the RGB of a pixel
def rgbToByte(self, r,g,b):
data = struct.pack('B', b)
data += struct.pack('B', g)
data += struct.pack('B', r)
data += struct.pack('B', 0)
return data
# Define finish(). Takes the image_data and makes a file out of it with
# a specif name
# returns: 0 on success
def writeImage(self, fileName):
# Makes the image file
img = open(fileName + ".bmp", 'wb')
img.write(self.image_data)
return 0
def get_bmp_processor_info(self):
return "bmp_processor Version B"
def get_header_info(self):
return [self.width, self.height,self.bits_per_pixel, self.row_bytes, self.row_padding]
def get_viewport_info(self):
return [slef.viewport_x, self.viewport_y, self.viewport_width, self.viewport_height]
def get_clearColors_info(self):
return [self.clearRgbRed, self.clearRgbGreen, self.clearRgbBlue]
def get_paintColors_info(self):
return [self.paintRgbRed, self.paintRgbGreen, self.paintRgbBlue]
<file_sep>#SR5
#<NAME>
import sys
import bmp_processor
import numpy as np
# image
image = bmp_processor.bmpImage(600,600)
print(image.get_bmp_processor_info())
#Decide color
image.glClearColor(0,0,0)
image.glColor(0,0,0)
image.glClear()
image_skeleton = image.glObjReader("obj/earth")
image.glLoadTextureImage('obj/earth',2,1)
#Load model
# pipeline: readImage -> loadTextures -> writeObject
def lowangle():
print("lowangle")
imageLow = bmp_processor.bmpImage(400,400)
imageLow.glLoadTextureImage('obj/earth',2,1)
imageLow.glClearColor(0,0,0)
imageLow.glColor(0,0,0)
imageLow.glClear()
imageLow.glObjWriter(image_skeleton,700,0.5,0.65,0)
imageLow.writeImage("earth-lowangle")
print("\n")
def mediumshot():
print("mediumshot")
imageMid = bmp_processor.bmpImage(400,400)
imageMid.glLoadTextureImage('obj/earth',2,1)
imageMid.glClearColor(0,0,0)
imageMid.glColor(0,0,0)
imageMid.glClear()
imageMid.glObjWriter(image_skeleton,600,0.5,0.5,0)
imageMid.writeImage("earth-mediumshot")
print("\n")
def highangle():
print("highangle")
imageHigh = bmp_processor.bmpImage(400,400)
imageHigh.glLoadTextureImage('obj/earth',2,1)
imageHigh.glClearColor(0,0,0)
imageHigh.glColor(0,0,0)
imageHigh.glClear()
imageHigh.glObjWriter(image_skeleton,1200,0.5,0.25,0)
imageHigh.writeImage("earth-highangle")
print("\n")
if len(sys.argv) == 2:
if str.lower(sys.argv[1]) == "low":
lowangle()
elif str.lower(sys.argv[1]) == "mid":
mediumshot()
elif str.lower(sys.argv[1]) == "high":
highangle()
elif str.lower(sys.argv[1]) == "all":
lowangle()
mediumshot()
highangle()
else:
print("Es necesario un argumento valido, elija: low, mid, high o all")
else:
print("Es necesario uno de los siguientes argumentos: low, mid, high o all")
|
e49075615eae2639f5f468e2f5ab9db1e8c36def
|
[
"Markdown",
"Python"
] | 3 |
Markdown
|
LuisDiego19FV/Graficas-SR6
|
60d03755d8457216ba3306c3158aed4025f319df
|
515280cfb732ea66ecfc46a34b4623f31161448d
|
refs/heads/master
|
<file_sep>= Scanty, a really small blog
== Overview
This is a fork off the main Scanty branch. It is meant to be used in an internal setting, so I removed support for Disqus.
Scanty is blogging software. Software for my blog, to be exact:
http://adam.blog.heroku.com
It is not a blogging engine, but it's small and easy to modify, so it could be
the starting point for your blog, too.
== Features
* Posts (shock!)
* Authors
* Tags
* Markdown (via Maruku)
* Ruby code syntax highlighting (via Syntax)
* Atom feed
* Comments via Disqus (removed from this fork)
* Web framework = Sinatra
* ORM = Sequel
* Templating = HAML
== Dependencies
$ gem install sinatra
Sequel, Maruku, and Syntax are all vendored.
== Setup
Edit main.rb and change the Blog config struct at the top to your liking. For
security purposes, change the admin cookie key and value. These can be set to any
random value you like, just choose something other than the default.
Then run the server:
$ ruby main.rb
And visit: http://localhost:4567
To create a default user - after the server is run for the first time, so that the tables exist - run:
$ rake bootstrap
This will allow you to log in with <EMAIL> with password '<PASSWORD>'. To create a different
user by default edit the Rakefile.
Log in with the password you selected, then click New Post. The rest should be
self-explanatory.
In production, you'll probably want to run "rake start" to start (and restart)
the server. Change the value of "port" at the top of the Rakefile to run on a
different port.
== Database
The default is a SQLite file named blog.db. To use something else, set
DATABASE_URL in your environment when running the app, i.e.:
$ DATABASE_URL='mysql://localhost/myblog' ruby main.rb
Or, modify the Sequel.connect statement at the top of main.rb.
The database will be created automatically when the server is executed.
== Comments
There are no comments by default. If you wish to activate comments, create an
account and a website on Disqus (disqus.com) and enter the website shortname as
the :disqus_shortname value in the Blog config struct.
== Import data
<NAME> has a Wordpress importer: http://github.com/swenson/scanty_wordpress_import
Other kinds of data can be imported easily, take a look at the rake task :import for an example of loading from a YAML file with field names that match the database schema.
== Customize
There are no themes or settings beyond the basic ones in the Blog struct. Just
edit the CSS or the code as you see fit.
== Meta
Written by <NAME>
Patches contributed by: <NAME>, <NAME>, and <NAME>
Released under the MIT License: http://www.opensource.org/licenses/mit-license.php
http://github.com/adamwiggins/scanty
http://adam.blog.heroku.com
<file_sep>require File.dirname(__FILE__) + '/../vendor/maruku/maruku'
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../vendor/syntax'
require 'syntax/convertors/html'
class Author < Sequel::Model
one_to_many :posts
unless table_exists?
set_schema do
primary_key :id
text :email
text :first_name
text :last_name
text :password
timestamp :created_at
end
create_table
end
def full_name
"#{first_name} #{last_name}"
end
def wrote?(post)
self.id == post.author.id
end
end
<file_sep>require 'rubygems'
require 'sinatra'
$LOAD_PATH.unshift File.dirname(__FILE__) + '/vendor/sequel'
require 'sequel'
configure do
Sequel.connect(ENV['DATABASE_URL'] || 'sqlite://blog.db')
require 'ostruct'
Blog = OpenStruct.new(
:title => 'Blog Title',
:url_base => 'http://localhost:4567/',
:admin_cookie_key => 'scanty_author',
:admin_cookie_value => '51d6d976913ace58'
)
end
error do
e = request.env['sinatra.error']
puts e.to_s
puts e.backtrace.join("\n")
"Application error"
end
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/lib')
require 'post'
require 'author'
helpers do
def is_admin?
true if author
end
def admin?
is_admin?
end
def author
author_id = request.cookies["author_id_cookie_key"]
Author.filter(:id => author_id.to_i).first
end
def auth
redirect '/' unless is_admin?
end
end
layout 'layout'
### Public
get '/' do
posts = Post.reverse_order(:created_at).limit(10)
haml :index, :locals => { :posts => posts }
end
get '/past/:year/:month/:day/:slug/' do
post = Post.filter(:slug => params[:slug]).first
stop [ 404, "Page not found" ] unless post
@title = post.title
haml :post, :locals => { :post => post }
end
get '/past/:year/:month/:day/:slug' do
redirect "/past/#{params[:year]}/#{params[:month]}/#{params[:day]}/#{params[:slug]}/", 301
end
get '/past' do
posts = Post.reverse_order(:created_at)
@title = "Archive"
haml :archive, :locals => { :posts => posts }
end
get '/past/tags/:tag' do
tag = params[:tag]
posts = Post.filter(:tags.like("%#{tag}%")).reverse_order(:created_at).limit(30)
@title = "Posts tagged #{tag}"
haml :tagged, :locals => { :posts => posts, :tag => tag }
end
get '/author/:author_id' do
author = Author.filter(:id => params[:author_id]).first
posts = Post.filter(:author_id => author.id).reverse_order(:created_at)
@title = "All posts by #{author.full_name}"
haml :archive, :locals => { :posts => posts }
end
get '/feed' do
@posts = Post.reverse_order(:created_at).limit(20)
content_type 'application/atom+xml', :charset => 'utf-8'
builder :feed
end
get '/rss' do
redirect '/feed', 301
end
### Admin
get '/admin/authors' do
auth
authors = Author.all
haml :authors, :locals => {:authors => authors}
end
get '/login' do
haml :auth
end
post '/auth' do
author = Author.filter(:email => params[:email]).first
if !author.nil? and params[:password] == <PASSWORD>
response.set_cookie(Blog.admin_cookie_key, Blog.admin_cookie_value)
response.set_cookie(:author_id_cookie_key, author.id)
redirect '/'
else
haml :auth, :locals => { :message => "Wrong email address or password" }
end
end
get '/logout' do
response.set_cookie(Blog.admin_cookie_key, "")
response.set_cookie(:author_id_cookie_key, "")
redirect '/'
end
get '/posts/new' do
auth
haml :edit, :locals => { :post => Post.new, :url => '/posts' }
end
post '/posts' do
auth
post = Post.new :author_id => author.id, :title => params[:title], :tags => params[:tags], :body => params[:body], :created_at => Time.now, :slug => Post.make_slug(params[:title])
post.save
redirect post.url
end
get '/past/:year/:month/:day/:slug/edit' do
auth
post = Post.filter(:slug => params[:slug]).first
stop [ 404, "Page not found" ] unless post
haml :edit, :locals => { :post => post, :url => post.url }
end
post '/past/:year/:month/:day/:slug/' do
auth
post = Post.filter(:slug => params[:slug]).first
stop [ 404, "Page not found" ] unless post
post.title = params[:title]
post.tags = params[:tags]
post.body = params[:body]
post.save
redirect post.url
end
|
dd03e3663dad498a1330edf70f441d552dcb6dd0
|
[
"RDoc",
"Ruby"
] | 3 |
RDoc
|
luis-ca/scanty
|
6303dff245460b468591eaad6ba94f1db34f971c
|
d1307e16a8118270eadd5f742254b6978d59c97c
|
refs/heads/master
|
<repo_name>Cvetomird91/unseen-mail-downloader<file_sep>/unseen.js
function getMessages() {
var conversations = document.querySelectorAll('[id^="zli__CLV-main__"]');
var messages = document.getElementsByClassName('Conv2MsgHeader');
if (messages.length === 0) {
//returns the messages from the first available conversation for testing purposes
var firstConversation = conversations[0];
firstConversation.click();
var messages = document.getElementsByClassName('Conv2MsgHeader');
}
return messages;
}
/*
function getMessages(conversationId) {
var conversations = document.querySelectorAll('[id^="zli__CLV-main__"]');
var messages = document.getElementsByClassName('Conv2MsgHeader');
if (messages.length == 0) {
//returns the messages from the first available conversation for testing purposes
firstConversation = conversations[0];
firstConversation.click();
var messages = document.getElementsByClassName('Conv2MsgHeader');
}
return messages;
}
*/
function fetchMessageHTML(messageUrl) {
var xhr = new XMLHttpRequest();
xhr.open('GET', messageUrl, false);
xhr.send();
var doc = xhr.responseText;
var parser = new DOMParser();
var mailPage = parser.parseFromString(doc, 'text/html');
//remove JavaScript that starts print browser dialog
var printDialog = mailPage.getElementsByTagName('script')[4];
printDialog.parentNode.removeChild(printDialog);
return mailPage;
}
function downloadMessage(messageHTML, filename) {
var uriContent = 'data:application/octet-stream;filename=' + filename + '.html,' + encodeURIComponent('<!DOCTYPE html><html><head>' + messageHTML.head.innerHTML + '</head>' + '<body>' + messageHTML.body.innerHTML + '</body></html>');
var a = document.createElement('a');
a.download = filename + '.html';
a.href = uriContent;
a.style.display = 'hidden';
document.body.appendChild(a);
a.click();
a.parentNode.removeChild(a);
}
function getFileName(messageHTML) {
var messageTimes = messageHTML.querySelectorAll('[id^="messageDisplayTime"]');
var messageTime = '';
if (messageTimes)
var messageTime = messageTimes[0];
if (!messageTime)
return;
return messageTime.innerText.replace(/\s/g, '-').replace(/,/g, '').replace(/:/, '');
}
function generateURL(messageID) {
var url = 'https://webmail.unseen.is/h/printmessage?id=' + messageID + '&tz=Europe/Athens';
return url;
}
function getMessageIDs(messages) {
var messageIDs = [];
for (var i = 0; i <= messages.length; i++) {
if (typeof messages[i].id !== 'undefined')
continue;
var rawID = messages[i].id;
var msgID = rawID.match('[0-9]{3}')[0];
messageIDs.push(msgID);
console.log(typeof messages[i].id);
}
//sample id: main_MSGC918__header
return messageIDs;
}
function main() {
var messageList = getMessages();
var messageIDs = getMessageIDs(messageList);
var messageURLs = [];
for (var msg in messageIDs) {
var url = generateURL(messageIDs[msg]);
console.log(url);
messageURLs.push(url);
}
var messageCount = messageURLs.length;
for (var id in messageURLs) {
var messageHTML = fetchMessageHTML(messageURLs[id]);
var fileName = getFileName(messageHTML);
console.log(fileName);
//http://stackoverflow.com/questions/7749090/how-to-use-setinterval-function-within-for-loop
//setInterval('downloadMessage(messageHTML, fileName)', 1500);
}
/*
var id = 0;
setInterval(function() {
if (id <= messageCount) {
var messageHTML = fetchMessageHTML(messageURLs[id]);
var fileName = getFileName(messageHTML);
//downloadMessage(messageHTML, fileName);
console.log(fileName);
id += 1;
} else return;
}, 1500);
*/
}
var URL = 'http://webmail.unseen.is';
function getSoAPIUrl() {
return getWebMailURL() + '/service/soap/';
}
function getWebMailURL() {
return URL;
}
<file_sep>/README.md
Download emails form the unseen.is mail client as HTML pages.
Unseen.is provide an excellent cryptographic chat and an email service,
that supports OpenPGP encryption.
However, the mailbox of the free service is limited to 10MB.
Messages can be exported into tar.gz archives in .eml format.
|
43e49e2d11e27a6dadfde85f58c25692c1b3a243
|
[
"JavaScript",
"Markdown"
] | 2 |
JavaScript
|
Cvetomird91/unseen-mail-downloader
|
3325f51c163836bb9d830f39e0828250b7f49e7e
|
684ac7d60bfecca310077fa69a210bb284c8f335
|
refs/heads/master
|
<file_sep>#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
#define ld long double
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);
const long double EPS = 1e-10;
const lli MOD = 1000000007ll;
const lli mod1 = 1000000009ll;
const lli mod2 = 1100000009ll;
int INF = 2147483645;
lli INFINF = 9223372036854775807;
int debug = 0;
using namespace std;
void print(int a[],int s,int e){for(int i=s;i<=e;i++)cout<<a[i]<<" ";cout<<"\n";}
void print(vector<int> &v,int s,int e){for(int i=s;i<=e;i++)cout<<v[i]<<" ";cout<<"\n";}
void print(vector<int> &v){for(int x:v)cout<<x<<" ";cout<<"\n";}
lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
lli bit(lli _mask,lli _i){return (_mask&(1<<_i))==0?0:1;}
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli add(lli a,lli b,lli m){lli x=a+b;while(x>=m)x-=m;return x;}
lli sub(lli a,lli b,lli m){lli x=a-b;while(x<0)x+=m;return x;}
lli mul(lli a,lli b,lli m){lli x=a*b;x%=m;return x;}
/*
change MAXN
check all functions
*/
struct Segtree{
typedef int stt;
static const int MAXN = 100010;
struct Node{
stt val;
stt lazy;
};
struct Node Segtree[4*MAXN];
Node MergeSegTree(Node a,Node b){
struct Node temp;
// create combined node
return temp;
}
void lazyupd(int s,int e,int idx){
if(s>e)
return;
/*if(Segtree[idx].lazy == 0)
return;
// update this node
if(s != e){
Segtree[2*idx+1].lazy += Segtree[idx].lazy;
Segtree[2*idx+2].lazy += Segtree[idx].lazy;
}
Segtree[idx].lazy = 0;*/
}
void BuildSegTree(int s,int e,int idx){
if(s==e){
/*Segtree[idx].val = 0;
Segtree[idx].lazy = 0;*/
}
else{
int mid = (s+e)>>1;
BuildSegTree(s,mid,2*idx+1);
BuildSegTree(mid+1,e,2*idx+2);
Segtree[idx] = MergeSegTree(Segtree[2*idx+1],Segtree[2*idx+2]);
}
}
void UpdateSegTree(int s,int e,int x,int y,stt v,int idx){
if(s==x && e==y){
// add lazy
return;
}
lazyupd(s,e,idx);
lli mid = (s+e)>>1;
if(y<=mid){
UpdateSegTree(s,mid,x,y,v,2*idx+1);
lazyupd(mid+1,e,2*idx+2);
}
else if(x>mid){
UpdateSegTree(mid+1,e,x,y,v,2*idx+2);
lazyupd(s,mid,2*idx+1);
}
else{
UpdateSegTree(s,mid,x,mid,v,2*idx+1);
UpdateSegTree(mid+1,e,mid+1,y,v,2*idx+2);
}
Segtree[idx] = MergeSegTree(Segtree[2*idx+1],Segtree[2*idx+2]);
}
Node QuerySegTree(int s,int e,int x,int y,int idx){
lazyupd(s,e,idx);
if(s==x && e==y)
return Segtree[idx];
int mid = (s+e)>>1;
if(y<=mid)
return QuerySegTree(s,mid,x,y,2*idx+1);
if(x>mid)
return QuerySegTree(mid+1,e,x,y,2*idx+2);
return MergeSegTree(QuerySegTree(s,mid,x,mid,2*idx+1),QuerySegTree(mid+1,e,mid+1,y,2*idx+2));
}
};
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
debug = 1;
#endif
srand (time(NULL));
return 0;
}
<file_sep>/*
By : <NAME>
Dhirubhai Ambani Institute Of Information And Communication Technology, Gandhinagar (DA-IICT GANDHINAGAR)
1st Year ICT BTECH student
*/
#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
const double EPS = 1e-24;
const lli MOD = 1000000007ll;
const double PI = 3.14159265359;
int INF = 2147483645;
lli INFINF = 9223372036854775807;
template <class T>T Max2(T a,T b){return a<b?b:a;}
template <class T>T Min2(T a,T b){return a<b?a:b;}
template <class T>T Max3(T a,T b,T c){return Max2(Max2(a,b),c);}
template <class T>T Min3(T a,T b,T c){return Min2(Min2(a,b),c);}
template <class T>T Max4(T a,T b,T c,T d){return Max2(Max2(a,b),Max2(c,d));}
template <class T>T Min4(T a,T b,T c,T d){return Min2(Min2(a,b),Max2(c,d));}
using namespace std;
struct SuffixArray
{
string S;
vector<int> SA;
vector<int> RSA;
vector<int> P[50];
vector<int> LCP[50];
vector<int> LOG2;
vector<pair<pair<int,int>,int> >L;
int laststep;
void init(string a)
{
S=a;
L.resize(a.size());
SA.resize(a.size());
RSA.resize(a.size());
LOG2.resize(a.size());
for(int i=0;i<50;i++)
P[i].resize(a.size());
for(int i=0;i<50;i++)
LCP[i].resize(a.size());
}
void buildSA()
{
for(int i=0;i<S.size();i++)
P[0][i]=S[i];
for(int step=1,cnt=1;cnt<S.size();cnt*=2,step++)
{
for(int i=0;i<S.size();i++)
{
L[i].first.first=P[step-1][i];
L[i].first.second=(i+cnt)<S.size()?(P[step-1][i+cnt]):(-1);
L[i].second=i;
}
sort(L.begin(),L.end());
P[step][L[0].second]=0;
for(int i=1;i<S.size();i++)
{
if(L[i].first.first==L[i-1].first.first && L[i].first.second==L[i-1].first.second)
P[step][L[i].second]=P[step][L[i-1].second];
else
P[step][L[i].second]=i;
}
laststep=step;
}
for(int i=0;i<S.size();i++)
SA[i]=L[i].second;
}
void buildRSA()
{
for(int i=0;i<S.size();i++)
RSA[SA[i]]=i;
}
void buildLCP()
{
for(int i=0;i<S.size()-1;i++)
LCP[0][i]=lcp(SA[i],SA[i+1]);
for(int j=1;(1<<j)<=S.size();j++)
for(int i=0;(i+(1<<j)-1)<S.size();i++)
{
int p,q;
p=LCP[j-1][i];
q=LCP[j-1][i+(1<<(j-1))];
LCP[j][i]=Min2(p,q);
}
}
void buildLOG2()
{
int g=2;
while(g <= S.size()){
LOG2[g] = 1;
g = (g << 1);
}
for(int i=1;i<=S.size();i++)
LOG2[i]+=LOG2[i - 1];
}
int lcp(int x,int y)
{
int k,ret=0;
if(x==y)
return S.size()-x;
for(k=laststep;k>=0 && x<S.size() && y<S.size(); k--)
if(P[k][x]==P[k][y])
x+=1<<k,y+=1<<k,ret+=1<<k;
return ret;
}
int lcprmq(int x,int y)
{
if(x==y)
return S.size()-x;
if(x>y)
swap(x,y);
int k=LOG2[y-x+1];
return Min2(LCP[k][x], LCP[k][y+1-(1<<k)]);
}
};
int main()
{
std::ios::sync_with_stdio(false);
cin.tie(NULL);
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
return 0;
}
<file_sep>/*
By : <NAME>
Dhirubhai Ambani Institute Of Information And Communication Technology, Gandhinagar (DA-IICT GANDHINAGAR)
2nd Year ICT BTECH student
*/
#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);
const double EPS = 1e-10;
const lli MOD = 1000000007ll;
const lli mod1 = 1000000009ll;
const lli mod2 = 1100000009ll;
const double PI = 3.14159265359;
int INF = 2147483645;
lli INFINF = 9223372036854775807;
int debug = 0;
template <class T>T Max2(T a,T b){return a<b?b:a;}
template <class T>T Min2(T a,T b){return a<b?a:b;}
template <class T>T Max3(T a,T b,T c){return Max2(Max2(a,b),c);}
template <class T>T Min3(T a,T b,T c){return Min2(Min2(a,b),c);}
template <class T>T Max4(T a,T b,T c,T d){return Max2(Max2(a,b),Max2(c,d));}
template <class T>T Min4(T a,T b,T c,T d){return Min2(Min2(a,b),Min2(c,d));}
using namespace std;
lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
lli bit(lli _mask,lli _i){return (_mask&(1<<_i))==0?0:1;}
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli add(lli a,lli b){lli x=a+b;if(x>MOD)x-=MOD;return x;}
lli sub(lli a,lli b){lli x=a-b;if(x<0)x+=MOD;return x;}
lli mul(lli a,lli b){lli x=a*b;x%=MOD;return x;}
// Gauss-Jordan elimination with full pivoting.
//
// Uses:
// (1) solving systems of linear equations (AX=B)
// (2) inverting matrices (AX=I)
// (3) computing determinants of square matrices
//
// Running time: O(n^3)
//
// INPUT: a[][] = an nxn matrix
// b[][] = an nxm matrix
//
// OUTPUT: X = an nxm matrix (stored in b[][])
// A^{-1} = an nxn matrix (stored in a[][])
// returns determinant of a[][]
double GaussJordan(vector<vector<double> > &a, vector<vector<double> > &b) {
const int n=a.size();
const int m=b[0].size();
vector<int> irow(n),icol(n),ipiv(n);
double det=1;
for(int i=0;i<n;i++){
int pj=-1,pk=-1;
for(int j=0;j<n;j++)if(!ipiv[j])
for(int k=0;k<n;k++) if(!ipiv[k])
if(pj==-1 || fabs(a[j][k])>fabs(a[pj][pk])){pj=j;pk=k;}
if(fabs(a[pj][pk])<EPS){return 0.0;}
ipiv[pk]++;
swap(a[pj],a[pk]);
swap(b[pj],b[pk]);
if (pj!=pk) det*=-1;
irow[i]=pj;
icol[i]=pk;
double c=1.0/a[pk][pk];
det*=a[pk][pk];
a[pk][pk]=1.0;
for (int p=0;p<n;p++)a[pk][p]*=c;
for (int p=0;p<m;p++)b[pk][p]*=c;
for (int p=0;p<n;p++)if(p!=pk){
c=a[p][pk];
a[p][pk]=0;
for(int q=0;q<n;q++)a[p][q]-=a[pk][q]*c;
for(int q=0;q<m;q++)b[p][q]-=b[pk][q]*c;
}
}
for(int p=n-1;p>=0;p--)if(irow[p]!=icol[p]){
for(int k=0;k<n;k++) swap(a[k][irow[p]],a[k][icol[p]]);
}
return det;
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
debug = 1;
#endif
srand (time(NULL));
const int n = 3;
const int m = 2;
double A[n][n] = { {2,3,4},{1,1,5},{6,1,2} };
double B[n][m] = { {1,2},{5,8},{0,7} };
vector<vector<double> > a(n), b(n);
for (int i = 0; i < n; i++) {
a[i] = vector<double>(A[i], A[i] + n);
b[i] = vector<double>(B[i], B[i] + m);
}
double det = GaussJordan(a, b);
// expected: 60
cout << "Determinant: " << det << endl;
// expected: -0.233333 0.166667 0.133333 0.0666667
// 0.166667 0.166667 0.333333 -0.333333
// 0.233333 0.833333 -0.133333 -0.0666667
// 0.05 -0.75 -0.1 0.2
cout << "Inverse: " << endl;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++)
cout << a[i][j] << ' ';
cout << endl;
}
// expected: 1.63333 1.3
// -0.166667 0.5
// 2.36667 1.7
// -1.85 -1.35
cout << "Solution: " << endl;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++)
cout << b[i][j] << ' ';
cout << endl;
}
return 0;
}
<file_sep>/*
By : <NAME>
Dhirubhai Ambani Institute Of Information And Communication Technology, Gandhinagar (DA-IICT GANDHINAGAR)
2nd Year ICT BTECH student
*/
#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);
const double EPS = 1e-4;
const lli MOD = 1000000007ll;
const lli HASHMOD[2]={1000000009ll,1100000009ll};
const double PI = 3.14159265359;
int INF = 2147483645;
lli INFINF = 9223372036854775807;
int debug = 0;
template <class T>T Max2(T a,T b){return a<b?b:a;}
template <class T>T Min2(T a,T b){return a<b?a:b;}
template <class T>T Max3(T a,T b,T c){return Max2(Max2(a,b),c);}
template <class T>T Min3(T a,T b,T c){return Min2(Min2(a,b),c);}
template <class T>T Max4(T a,T b,T c,T d){return Max2(Max2(a,b),Max2(c,d));}
template <class T>T Min4(T a,T b,T c,T d){return Min2(Min2(a,b),Min2(c,d));}
using namespace std;
lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
lli bit(lli _mask,lli _i){return (_mask&(1<<_i))==0?0:1;}
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli add(lli a,lli b){lli x=a+b;if(x>MOD)x-=MOD;return x;}
lli sub(lli a,lli b){lli x=a-b;if(x<0)x+=MOD;return x;}
lli mul(lli a,lli b){lli x=a*b;x%=MOD;return x;}
int sign(double a){return a < -EPS ? -1 : a > EPS ? 1 : 0;}
struct Point{
double x,y;
Point(){}
Point(double _x,double _y){x =_x;y=_y;}
double dot(Point b){
return x*b.x + y*b.y;
}
double cross(Point b){
return x*b.y - y*b.x;
}
Point rotateCCW(double angle) {
Point ret(x * cos(angle) - y * sin(angle), x * sin(angle) + y * cos(angle));
return ret;
}
};
struct Line{
double a,b,c;
Line(Point p1,Point p2){
a = p1.y - p2.y;
b = p2.x - p1.x;
c = p1.x * p2.y - p2.x * p1.y;
}
Line(double _a,double _b,double _c){a=_a;b=_b;c=_c;}
bool isParallel(Line line){
return a * line.b - b * line.a == 0;
}
bool isPerpendicular(Line line){
return sign( a * line.a + b * line.b ) == 0;
}
Point intersect(Line line) {
double d = a * line.b - line.a * b;
double x = -(c * line.b - line.c * b) / d;
double y = -(a * line.c - line.a * c) / d;
Point ret(x,y);
return ret;
}
};
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
debug = 1;
#endif
srand (time(NULL));
return 0;
}
<file_sep>/*
By : <NAME>
Dhirubhai Ambani Institute Of Information And Communication Technology, Gandhinagar (DA-IICT GANDHINAGAR)
1st Year ICT BTECH student
*/
#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
const double EPS = 1e-24;
const lli MOD = 1000000007ll;
const double PI = 3.14159265359;
int INF = 2147483645;
template <class T>T Max2(T a,T b){return a<b?b:a;}
template <class T>T Min2(T a,T b){return a<b?a:b;}
template <class T>T Max3(T a,T b,T c){return Max2(Max2(a,b),c);}
template <class T>T Min3(T a,T b,T c){return Min2(Min2(a,b),c);}
template <class T>T Max4(T a,T b,T c,T d){return Max2(Max2(a,b),Max2(c,d));}
template <class T>T Min4(T a,T b,T c,T d){return Min2(Min2(a,b),Max2(c,d));}
using namespace std;
/*
1-based string
struct Trie *root = new Trie();
*/
struct Trie
{
const static int sz = 26;
int cnt;
struct Trie *children[sz];
Trie(){
for(int i=0;i<this->sz;i++)
this->children[i] = NULL;
this->cnt = 0;
}
void addString(string s){
struct Trie *pCrawl = this;
int n = s.size()-1;
for(int i=1;i<=n;i++){
int idx = s[i]-'a';
if(pCrawl->children[idx] == NULL)
pCrawl->children[idx] = new Trie();
pCrawl=pCrawl->children[idx];
}
}
void dfs(Trie* u){
for(int i=0;i<u->sz;i++){
if(u->children[i] != NULL){
dfs(u->children[i]);
}
}
}
};
int main()
{
std::ios::sync_with_stdio(false);
cin.tie(NULL);
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
return 0;
}
<file_sep>/*
By : <NAME>
Dhirubhai Ambani Institute Of Information And Communication Technology, Gandhinagar (DA-IICT GANDHINAGAR)
2nd Year ICT BTECH student
*/
#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);
const double EPS = 1e-9;
const lli MOD = 1000000007ll;
const lli HASHMOD[2]={1000000009ll,1100000009ll};
const double PI = 3.14159265359;
int INF = 2147483645;
lli INFINF = 9223372036854775807;
int debug = 0;
template <class T>T Max2(T a,T b){return a<b?b:a;}
template <class T>T Min2(T a,T b){return a<b?a:b;}
template <class T>T Max3(T a,T b,T c){return Max2(Max2(a,b),c);}
template <class T>T Min3(T a,T b,T c){return Min2(Min2(a,b),c);}
template <class T>T Max4(T a,T b,T c,T d){return Max2(Max2(a,b),Max2(c,d));}
template <class T>T Min4(T a,T b,T c,T d){return Min2(Min2(a,b),Min2(c,d));}
using namespace std;
lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
lli bit(lli _mask,lli _i){return (_mask&(1<<_i))==0?0:1;}
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli add(lli a,lli b){lli x=a+b;if(x>MOD)x-=MOD;return x;}
lli sub(lli a,lli b){lli x=a-b;if(x<0)x+=MOD;return x;}
lli mul(lli a,lli b){lli x=a*b;x%=MOD;return x;}
struct Edge {
int from, to, cap, flow, index;
Edge(int from, int to, int cap, int flow, int index) :
from(from), to(to), cap(cap), flow(flow), index(index) {}
};
struct PushRelabel {
int N;
vector<vector<Edge> > G;
vector<lli> excess;
vector<int> dist, active, count;
queue<int> Q;
PushRelabel(int N) : N(N), G(N), excess(N), dist(N), active(N), count(2*N) {}
void AddEdge(int from, int to, int cap) {
G[from].push_back(Edge(from, to, cap, 0, G[to].size()));
if (from == to) G[from].back().index++;
G[to].push_back(Edge(to, from, 0, 0, G[from].size() - 1));
}
void Enqueue(int v) {
if (!active[v] && excess[v] > 0) { active[v] = true; Q.push(v); }
}
void Push(Edge &e) {
int amt = int(min(excess[e.from], (lli)(e.cap - e.flow)));
if (dist[e.from] <= dist[e.to] || amt == 0) return;
e.flow += amt;
G[e.to][e.index].flow -= amt;
excess[e.to] += amt;
excess[e.from] -= amt;
Enqueue(e.to);
}
void Gap(int k) {
for (int v = 0; v < N; v++) {
if (dist[v] < k) continue;
count[dist[v]]--;
dist[v] = max(dist[v], N+1);
count[dist[v]]++;
Enqueue(v);
}
}
void Relabel(int v) {
count[dist[v]]--;
dist[v] = 2*N;
for (int i = 0; i < G[v].size(); i++)
if (G[v][i].cap - G[v][i].flow > 0)
dist[v] = min(dist[v], dist[G[v][i].to] + 1);
count[dist[v]]++;
Enqueue(v);
}
void Discharge(int v) {
for (int i = 0; excess[v] > 0 && i < G[v].size(); i++) Push(G[v][i]);
if (excess[v] > 0) {
if (count[dist[v]] == 1)
Gap(dist[v]);
else
Relabel(v);
}
}
lli GetMaxFlow(int s, int t) {
count[0] = N-1;
count[N] = 1;
dist[s] = N;
active[s] = active[t] = true;
for (int i = 0; i < G[s].size(); i++) {
excess[s] += G[s][i].cap;
Push(G[s][i]);
}
while (!Q.empty()) {
int v = Q.front();
Q.pop();
active[v] = false;
Discharge(v);
}
lli totflow = 0;
for (int i = 0; i < G[s].size(); i++) totflow += G[s][i].flow;
return totflow;
}
};
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
debug = 1;
#endif
srand (time(NULL));
return 0;
}
<file_sep>/*
By : <NAME>
Dhirubhai Ambani Institute Of Information And Communication Technology, Gandhinagar (DA-IICT GANDHINAGAR)
2nd Year ICT BTECH student
*/
#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);
const double EPS = 1e-9;
const lli MOD = 1000000007ll;
const lli HASHMOD[2]={1000000009ll,1100000009ll};
const double PI = 3.14159265359;
int INF = 2147483645;
lli INFINF = 9223372036854775807;
int debug = 0;
template <class T>T Max2(T a,T b){return a<b?b:a;}
template <class T>T Min2(T a,T b){return a<b?a:b;}
template <class T>T Max3(T a,T b,T c){return Max2(Max2(a,b),c);}
template <class T>T Min3(T a,T b,T c){return Min2(Min2(a,b),c);}
template <class T>T Max4(T a,T b,T c,T d){return Max2(Max2(a,b),Max2(c,d));}
template <class T>T Min4(T a,T b,T c,T d){return Min2(Min2(a,b),Min2(c,d));}
using namespace std;
lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
lli bit(lli _mask,lli _i){return (_mask&(1<<_i))==0?0:1;}
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli add(lli a,lli b){lli x=a+b;if(x>MOD)x-=MOD;return x;}
lli sub(lli a,lli b){lli x=a-b;if(x<0)x+=MOD;return x;}
lli mul(lli a,lli b){lli x=a*b;x%=MOD;return x;}
namespace FFT{
void fft(vector<complex<double> >&a,bool invert){
int n=(int) a.size();
for (int i=1,j=0;i<n;++i){
int bit=n>>1;
for(;j>=bit;bit>>=1) j-=bit;
j+=bit;
if(i<j) swap(a[i], a[j]);
}
for (int len=2;len<=n;len<<=1) {
double ang=2*PI/len*(invert?-1:1);
complex<double> wlen(cos(ang),sin(ang));
for (int i=0;i<n;i+=len){
complex<double> w(1);
for(int j=0;j<len/2;++j){
complex<double> u=a[i+j],v=a[i+j+len/2]*w;
a[i+j]=u+v;
a[i+j+len/2]=u-v;
w*=wlen;
}
}
}
if(invert) for(int i=0;i<n;++i) a[i]/=n;
}
void multiply(const vector<lli> &a,const vector<lli> &b,vector<lli> &res){
vector<complex<double> > fa,fb;
for(int i=0;i<a.size();i++) fa.push_back(a[i]);
for(int i=0;i<b.size();i++) fb.push_back(b[i]);
size_t n=1;
while (n<max(a.size(), b.size()))n <<= 1;n<<=1;
fa.resize(n),fb.resize(n);
fft(fa,false),fft(fb,false);
for(int i=0;i<n;++i) fa[i]*=fb[i];
fft (fa, true);
res.resize(n);
for(int i=0;i<n;++i) res[i]=(lli)(fa[i].real() + 0.5);
}
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
debug = 1;
#endif
srand (time(NULL));
return 0;
}
<file_sep>/*
By : <NAME>
Dhirubhai Ambani Institute Of Information And Communication Technology, Gandhinagar (DA-IICT GANDHINAGAR)
2nd Year ICT BTECH student
*/
#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);
const double EPS = 1e-10;
const lli MOD = 1000000007ll;
const lli mod1 = 1000000009ll;
const lli mod2 = 1100000009ll;
const double PI = 3.14159265359;
int INF = 2147483645;
lli INFINF = 9223372036854775807;
int debug = 0;
template <class T>T Max2(T a,T b){return a<b?b:a;}
template <class T>T Min2(T a,T b){return a<b?a:b;}
template <class T>T Max3(T a,T b,T c){return Max2(Max2(a,b),c);}
template <class T>T Min3(T a,T b,T c){return Min2(Min2(a,b),c);}
template <class T>T Max4(T a,T b,T c,T d){return Max2(Max2(a,b),Max2(c,d));}
template <class T>T Min4(T a,T b,T c,T d){return Min2(Min2(a,b),Min2(c,d));}
using namespace std;
lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
lli bit(lli _mask,lli _i){return (_mask&(1<<_i))==0?0:1;}
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli add(lli a,lli b){lli x=a+b;if(x>MOD)x-=MOD;return x;}
lli sub(lli a,lli b){lli x=a-b;if(x<0)x+=MOD;return x;}
lli mul(lli a,lli b){lli x=a*b;x%=MOD;return x;}
typedef struct TreapNode{
int prior,sz,val;
struct TreapNode *l,*r;
}TreapNode;
typedef TreapNode* pTreapNode;
int TreapSz(pTreapNode t){
return t!=NULL?t->sz:0;
}
void TreapUpdSz(pTreapNode t){
if(t)t->sz=TreapSz(t->l)+1+TreapSz(t->r);
}
void TreapSplit(pTreapNode t,pTreapNode &l,pTreapNode &r,int pos,int add=0){
if(!t)return void(l=r=NULL);
int curr_pos = add + TreapSz(t->l);
if(curr_pos<=pos)
TreapSplit(t->r,t->r,r,pos,curr_pos+1),l=t;
else
TreapSplit(t->l,l,t->l,pos,add),r=t;
TreapUpdSz(t);
}
void TreapMerge(pTreapNode &t,pTreapNode l,pTreapNode r){
if(!l || !r) t = (l==NULL)?r:l;
else if(l->prior>r->prior)TreapMerge(l->r,l->r,r),t=l;
else TreapMerge(r->l,l,r->l),t=r;
TreapUpdSz(t);
}
void init(pTreapNode &t,int val)
{
t->prior=rand();
t->sz=1;
t->val=val;
t->l=t->r=NULL;
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
debug = 1;
#endif
srand (time(NULL));
/*si(N);
for(int i=0;i<N;i++)
si(A[i]);
for(int i=0;i<N;i++){
pnode it = new node;
init(it,A[i]);
if(i==0)
Treap = it;
else
merge(Treap,Treap,it);
}*/
return 0;
}
<file_sep>/*
By : <NAME>
Dhirubhai Ambani Institute Of Information And Communication Technology, Gandhinagar (DA-IICT GANDHINAGAR)
2nd Year ICT BTECH student
*/
#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);
const double EPS = 1e-9;
const lli MOD = 1000000007ll;
const lli HASHMOD[2]={1000000009ll,1100000009ll};
const double PI = 3.14159265359;
int INF = 2147483645;
lli INFINF = 9223372036854775807;
int debug = 0;
template <class T>T Max2(T a,T b){return a<b?b:a;}
template <class T>T Min2(T a,T b){return a<b?a:b;}
template <class T>T Max3(T a,T b,T c){return Max2(Max2(a,b),c);}
template <class T>T Min3(T a,T b,T c){return Min2(Min2(a,b),c);}
template <class T>T Max4(T a,T b,T c,T d){return Max2(Max2(a,b),Max2(c,d));}
template <class T>T Min4(T a,T b,T c,T d){return Min2(Min2(a,b),Min2(c,d));}
using namespace std;
lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
lli bit(lli _mask,lli _i){return (_mask&(1<<_i))==0?0:1;}
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli add(lli a,lli b){lli x=a+b;if(x>MOD)x-=MOD;return x;}
lli sub(lli a,lli b){lli x=a-b;if(x<0)x+=MOD;return x;}
lli mul(lli a,lli b){lli x=a*b;x%=MOD;return x;}
/*
change MAXN
call init(s,t,n)
change datatype
change inf
*/
namespace MCMF
{
struct Edgemcmf{
mcmftype b, c, u, f, back;
};
typedef int mcmftype;
const mcmftype MAXN = 510;
mcmftype s, t, n;
vector<Edgemcmf> g[MAXN];
mcmftype inf = (mcmftype)1e9;
void init(mcmftype _s, mcmftype _t, mcmftype _n){
s = _s;
t = _t;
n = _n;
}
void addEdge(mcmftype from, mcmftype to, mcmftype cost, mcmftype cap)
{
Edgemcmf e1 = {to, cost, cap, 0, (mcmftype)g[to].size()};
Edgemcmf e2 = {from, -cost, 0, 0, (mcmftype)g[from].size()};
g[from].push_back(e1);
g[to].push_back(e2);
}
pair<mcmftype,mcmftype> minCostMaxFlow()
{
mcmftype flow = 0;
mcmftype cost = 0;
mcmftype *state = new mcmftype[n];
mcmftype *from = new mcmftype[n];
mcmftype *from_edge = new mcmftype[n];
mcmftype *d = new mcmftype[n];
mcmftype *q = new mcmftype[n];
mcmftype qh, qt;
qh = 0, qt = 0;
while (true)
{
for (mcmftype i = 0; i < n; i++) state[i] = 2, d[i] = inf;
fill(from, from + n, -1);
state[s] = 1;
q[qh++] = s;
d[s] = 0;
while (qh != qt)
{
mcmftype v = q[qt++];
qt %= n;
state[v] = 0;
for (mcmftype i = 0; i < g[v].size(); i++) if (g[v][i].f < g[v][i].u && d[g[v][i].b] > d[v] + g[v][i].c)
{
mcmftype to = g[v][i].b;
d[to] = d[v] + g[v][i].c;
from[to] = v;
from_edge[to] = i;
if (state[to] == 1) continue;
if (!state[to])
{
qt--;
if (qt == -1) qt = n - 1;
q[qt] = to;
state[to] = 1;
} else
{
state[to] = 1;
q[qh++] = to;
qh %= n;
}
}
}
if (d[t] == inf) break;
mcmftype it = t;
mcmftype addflow = inf;
while (it != s)
{
addflow = min(addflow, (mcmftype)(g[from[it]][from_edge[it]].u - g[from[it]][from_edge[it]].f));
it = from[it];
}
it = t;
while (it != s)
{
g[from[it]][from_edge[it]].f += addflow;
g[it][g[from[it]][from_edge[it]].back].f -= addflow;
cost += g[from[it]][from_edge[it]].c * addflow;
it = from[it];
}
flow += addflow;
}
return {cost,flow};
}
};
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
debug = 1;
#endif
srand (time(NULL));
return 0;
}
<file_sep>#include<bits/stdc++.h>
#define LOCAL 1
#define lli long long int
#define llu unsigned long long int
#define ld long double
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);
const long double EPS = 1e-10;
const lli MOD = 1000000007ll;
const lli mod1 = 1000000009ll;
const lli mod2 = 1100000009ll;
int INF = (int)1e9;
lli INFINF = (lli)1e18;
int debug = 0;
long double PI = acos(-1.0);
using namespace std;
lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
lli bit(lli _mask,lli _i){return (_mask&(1<<_i))==0?0:1;}
lli powermod(lli _a,lli _b,lli _m=MOD){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli add(lli a,lli b,lli m=MOD){lli x=a+b;while(x>=m)x-=m;while(x<0)x+=m;return x;}
lli sub(lli a,lli b,lli m=MOD){lli x=a-b;while(x<0)x+=m;while(x>=m)x-=m;return x;}
lli mul(lli a,lli b,lli m=MOD){lli x=a*1ll*b;x%=m;if(x<0)x+=m;return x;}
/*
change MAXN
call init(N)
*/
namespace Sieve{
const int MAXN = 100010;
int N;
bool isp[MAXN];
void init(int _N){
N = _N;
for(int i=2;i<=N;i++)
isp[i] = true;
for(int i=2;i<=N;i++)
if(isp[i])
for(int j=i+i;j<=N;j+=i)
isp[j] = false;
}
}
namespace Sieve{
const int MAXN = 100010;
int N;
bool isp[MAXN];
int spf[MAXN];
void init(int _N){
N = _N;
for(int i=2;i<=N;i++)
isp[i] = true,
spf[i] = -1;
for(int i=2;i<=N;i++){
if(isp[i]){
spf[i] = i;
for(int j=i+i;j<=N;j+=i){
isp[j] = false;
if(spf[j] == -1)
spf[j] = i;
}
}
}
}
}
namespace Sieve{
const int MAXN = 100010;
int N;
bool isp[MAXN];
vector<int> pfactors[MAXN];
void init(int _N){
N = _N;
for(int i=2;i<=N;i++)
isp[i] = true;
for(int i=2;i<=N;i++){
if(isp[i]){
pfactors[i].pb(i);
for(int j=i+i;j<=N;j+=i){
pfactors[j].pb(i);
isp[j] = false;
}
}
}
}
}
namespace Sieve{
const int MAXN = 1000010;
int N;
bool isp[MAXN];
vector<pair<int,int> > pfactors[MAXN];
void init(int _N){
N = _N;
for(int i=2;i<=N;i++)
isp[i] = true;
for(int i=2;i<=N;i++){
if(isp[i]){
pfactors[i].pb({i,1});
for(int j=i+i;j<=N;j+=i){
int cnt = 0;
int x = j;
while(x%i == 0){
cnt ++;
x /= i;
}
pfactors[j].pb({i,cnt});
isp[j] = false;
}
}
}
}
}
int main()
{
if(LOCAL){
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
debug = 1;
}
srand (time(NULL));
return 0;
}
<file_sep>/*
By : <NAME>
Dhirubhai Ambani Institute Of Information And Communication Technology, Gandhinagar (DA-IICT GANDHINAGAR)
*/
#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);
const double EPS = 1e-10;
const lli MOD = 1000000007ll;
const lli mod1 = 1000000009ll;
const lli mod2 = 1100000009ll;
const double PI = 3.14159265359;
int INF = 2147483645;
lli INFINF = 9223372036854775807;
int debug = 0;
using namespace std;
lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
lli bit(lli _mask,lli _i){return (_mask&(1<<_i))==0?0:1;}
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli add(lli a,lli b){lli x=a+b;if(x>MOD)x-=MOD;return x;}
lli sub(lli a,lli b){lli x=a-b;if(x<0)x+=MOD;return x;}
lli mul(lli a,lli b){lli x=a*b;x%=MOD;return x;}
void dfs1(int u){
int childcnt = 0;
vis[u] = true;
disc[u] = low[u] = ++dfstime;
for(auto it : G[u]){
int v = it;
if(!vis[v]){
childcnt ++;
parent[v] = u;
dfs1(v);
low[u] = min(low[u], low[v]);
if(parent[u] == 0 && childcnt > 1)
arti[u] = true;
if(parent[u] != 0 && low[v]>=disc[u])
arti[u] = true;
}
else if(v!=parent[u]){
low[u] = min(low[u], disc[v]);
}
}
}
/* bridge
int disc[N],low[N],parent[N];
int dfstime;
bool vis[N],bridge[M];
*/
int dual(int i){
if(i%2==0)
return i + 1;
return i - 1;
}
void find_bridge(int u){
vis[u] = true;
disc[u] = low[u] = dfstime++;
for(int i : G[u]){
int v = to[i];
if(!vis[v]){
parent[v] = u;
find_bridge(v);
low[u] = min(low[u], low[v]);
if(low[v] > disc[u]){
bridge[i] = true;
bridge[dual(i)] = true;
}
}
else if(v!=parent[u]){
low[u] = min(low[u], disc[v]);
}
}
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
debug = 1;
#endif
srand (time(NULL));
return 0;
}
<file_sep>/*
By : <NAME>
Dhirubhai Ambani Institute Of Information And Communication Technology, Gandhinagar (DA-IICT GANDHINAGAR)
2nd Year ICT BTECH student
*/
#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);
const double EPS = 1e-4;
const lli MOD = 1000000007ll;
const lli HASHMOD[2]={1000000009ll,1100000009ll};
const double PI = 3.14159265359;
int INF = 2147483645;
lli INFINF = 9223372036854775807;
template <class T>T Max2(T a,T b){return a<b?b:a;}
template <class T>T Min2(T a,T b){return a<b?a:b;}
template <class T>T Max3(T a,T b,T c){return Max2(Max2(a,b),c);}
template <class T>T Min3(T a,T b,T c){return Min2(Min2(a,b),c);}
template <class T>T Max4(T a,T b,T c,T d){return Max2(Max2(a,b),Max2(c,d));}
template <class T>T Min4(T a,T b,T c,T d){return Min2(Min2(a,b),Min2(c,d));}
using namespace std;
lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
lli bit(lli _mask,lli _i){return (_mask&(1<<_i))==0?0:1;}
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
struct LowestCommonAncestor
{
int N;
int LOGN;
vector<vector<int> >GRAPH;
vector<vector<int> >LCA;
vector<int> DEPTH;
void dfs(int u,int p,int l)
{
LCA[u][0]=p;
DEPTH[u]=l;
for(int v:GRAPH[u])
if(v!=p)
dfs(v,u,l+1);
}
void init(int _N,int _LOGN,vector<int> _GRAPH[])
{
N=_N;
LOGN=_LOGN;
GRAPH.resize(N+1);
for(int i=1;i<=N;i++)
GRAPH[i].clear();
for(int i=1;i<=N;i++)
for(int x:_GRAPH[i])
GRAPH[i].push_back(x);
LCA.resize(N+1);
DEPTH.resize(N+1);
for(int i=1;i<=N;i++)
LCA[i].resize(LOGN);
for(int i=1;i<=N;i++)
for(int j=0;j<LOGN;j++)
LCA[i][j]=-1;
dfs(1,-1,1);
for(int j=1;j<LOGN;j++)
for(int i=1;i<=N;i++)
if(LCA[i][j-1]!=-1)
LCA[i][j]=LCA[LCA[i][j-1]][j-1];
}
int getLCA(int u,int v)
{
if(DEPTH[u]<DEPTH[v])
swap(u,v);
int diff=DEPTH[u]-DEPTH[v];
for(int i=0;i<LOGN;i++)
if( (diff>>i)&1 )
u=LCA[u][i];
if(u==v)
return u;
for(int j=LOGN-1;j>=0;j--)
if(LCA[u][j]!=LCA[v][j])
{
u=LCA[u][j];
v=LCA[v][j];
}
return LCA[u][0];
}
};
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
#endif
srand (time(NULL));
return 0;
}
<file_sep>#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);
const double EPS = 1e-10;
const lli MOD = 1000000007ll;
const lli mod1 = 1000000009ll;
const lli mod2 = 1100000009ll;
const double PI = 3.14159265359;
int INF = 2147483645;
lli INFINF = 9223372036854775807;
int debug = 0;
using namespace std;
lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
lli bit(lli _mask,lli _i){return (_mask&(1<<_i))==0?0:1;}
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli add(lli a,lli b){lli x=a+b;if(x>=MOD)x-=MOD;return x;}
lli sub(lli a,lli b){lli x=a-b;if(x<0)x+=MOD;return x;}
lli mul(lli a,lli b){lli x=a*b;x%=MOD;return x;}
/*
1-based
change MAXN, LOGN
change spt
*/
struct SparseTableMAX{
typedef int spt;
static const int MAXN = 100010;
static const int LOGN = 20;
int N;
spt arr[MAXN];
int logTable[MAXN];
int rmq[MAXN][LOGN];
void init(int _N,spt A[]){
N = _N;
for(int i=0;i<N;i++)
arr[i] = A[i+1];
for(int i=2;i<=N;i++)
logTable[i]=logTable[i>>1]+1;
for(int i=0;i<N;++i)
rmq[i][0] = i;
for(int j=1;(1<<j)<=N;j++){
for(int i=0;i+(1<<j)-1<N;i++){
int x = rmq[i][j-1];
int y = rmq[i+(1<<j-1)][j-1];
rmq[i][j] = arr[x]>=arr[y] ? x : y;
}
}
}
int query(int i, int j){
i--;j--;
int k,x,y;
k = logTable[j-i],x = rmq[i][k],y = rmq[j-(1<<k)+1][k];
return (arr[x]>=arr[y] ? x : y) + 1;
}
};
struct SparseTableMIN{
typedef int spt;
static const int MAXN = 100010;
static const int LOGN = 20;
int N;
spt arr[MAXN];
int logTable[MAXN];
int rmq[MAXN][LOGN];
void init(int _N,spt A[]){
N = _N;
for(int i=0;i<N;i++)
arr[i] = A[i+1];
for(int i=2;i<=N;i++)
logTable[i]=logTable[i>>1]+1;
for(int i=0;i<N;++i)
rmq[i][0] = i;
for(int j=1;(1<<j)<=N;j++){
for(int i=0;i+(1<<j)-1<N;i++){
int x = rmq[i][j-1];
int y = rmq[i+(1<<j-1)][j-1];
rmq[i][j] = arr[x]<=arr[y] ? x : y;
}
}
}
int query(int i, int j){
i--;j--;
int k,x,y;
k = logTable[j-i],x = rmq[i][k],y = rmq[j-(1<<k)+1][k];
return (arr[x]<=arr[y] ? x : y) + 1;
}
};
struct SparseTableGCD{
typedef int spt;
static const int MAXN = 100010;
static const int LOGN = 20;
int N;
spt arr[MAXN];
int logTable[MAXN];
spt rmq[MAXN][LOGN];
void init(int _N,spt A[]){
N = _N;
for(int i=0;i<N;i++)
arr[i] = A[i+1];
for(int i=2;i<=N;i++)
logTable[i]=logTable[i>>1]+1;
for(int i=0;i<N;++i)
rmq[i][0] = arr[i];
for(int j=1;(1<<j)<=N;j++){
for(int i=0;i+(1<<j)-1<N;i++){
spt x = rmq[i][j-1];
spt y = rmq[i+(1<<j-1)][j-1];
rmq[i][j] = __gcd(x,y);
}
}
}
int query(int i, int j){
i--;j--;
int k,x,y;
k = logTable[j-i],x = rmq[i][k],y = rmq[j-(1<<k)+1][k];
return __gcd(x,y);
}
};
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
debug = 1;
#endif
srand (time(NULL));
return 0;
}
<file_sep>/*
By : <NAME>
Dhirubhai Ambani Institute Of Information And Communication Technology, Gandhinagar (DA-IICT GANDHINAGAR)
2nd Year ICT BTECH student
*/
#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);
const double EPS = 1e-24;
const lli MOD = 1000000007ll;
const lli MOD1=1000000009ll;
const lli MOD2=1100000009ll;
const double PI = 3.14159265359;
int INF = 2147483645;
lli INFINF = 9223372036854775807;
template <class T>T Max2(T a,T b){return a<b?b:a;}
template <class T>T Min2(T a,T b){return a<b?a:b;}
template <class T>T Max3(T a,T b,T c){return Max2(Max2(a,b),c);}
template <class T>T Min3(T a,T b,T c){return Min2(Min2(a,b),c);}
template <class T>T Max4(T a,T b,T c,T d){return Max2(Max2(a,b),Max2(c,d));}
template <class T>T Min4(T a,T b,T c,T d){return Min2(Min2(a,b),Min2(c,d));}
using namespace std;
lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
lli bit(lli _mask,lli _i){return (_mask&(1<<_i))==0?0:1;}
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
namespace Geometry{
typedef long double T;
struct PT {
T x, y;
PT() {}
PT(T x, T y) : x(x), y(y) {}
PT(const PT &p) : x(p.x), y(p.y) {}
PT operator + (const PT &p) const { return PT(x+p.x,y+p.y); }
PT operator - (const PT &p) const { return PT(x-p.x,y-p.y); }
PT operator * (T c) const { return PT(x*c,y*c); }
PT operator / (T c) const { return PT(x/c,y/c); }
bool operator < (const PT &rhs) const { return mp(y,x) < mp(rhs.y,rhs.x); }
bool operator == (const PT &rhs) const { return mp(y,x) == mp(rhs.y,rhs.x); }
};
T dot(PT p, PT q) { return p.x*q.x + p.y*q.y; }
T dist2(PT p, PT q) { return dot(p-q,p-q); }
T cross(PT p, PT q) { return p.x*q.y - p.y*q.x; }
T area2(PT a, PT b, PT c) { return cross(a,b) + cross(b,c) + cross(c,a); }
#define Det(a,b,c) ((b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x))
bool LinesParallel(PT a, PT b, PT c, PT d) {
return fabs(cross(b-a, c-d)) < EPS;
}
bool LinesCollinear(PT a, PT b, PT c, PT d) {
return LinesParallel(a, b, c, d)
&& fabs(cross(a-b, a-c)) < EPS
&& fabs(cross(c-d, c-a)) < EPS;
}
bool SegmentsIntersect(PT a, PT b, PT c, PT d) { // line segment ab with line segment cd
if (LinesCollinear(a, b, c, d)) {
if (dist2(a, c) < EPS || dist2(a, d) < EPS ||
dist2(b, c) < EPS || dist2(b, d) < EPS) return true;
if (dot(c-a, c-b) > 0 && dot(d-a, d-b) > 0 && dot(c-b, d-b) > 0)
return false;
return true;
}
if (cross(d-a, b-a) * cross(c-a, b-a) > 0) return false;
if (cross(a-c, d-c) * cross(b-c, d-c) > 0) return false;
return true;
}
PT ComputeLineIntersection(PT a, PT b, PT c, PT d) {
b=b-a; d=c-d; c=c-a;
assert(dot(b, b) > EPS && dot(d, d) > EPS);
return a + b*cross(c, d)/cross(b, d);
}
bool PointInPolygon(const vector<PT> &p, PT q) {
bool c = 0;
for (int i = 0; i < p.size(); i++){
int j = (i+1)%p.size();
if ((p[i].y <= q.y && q.y < p[j].y || p[j].y <= q.y && q.y < p[i].y) &&
q.x < p[i].x + (p[j].x - p[i].x) * (q.y - p[i].y) / (p[j].y - p[i].y))
c = !c;
}
return c;
}
bool between(const PT &a, const PT &b, const PT &c) {
return (fabs(area2(a,b,c)) < EPS && (a.x-b.x)*(c.x-b.x) <= 0 && (a.y-b.y)*(c.y-b.y) <= 0);
}
void ConvexHull(vector<PT> &pts) {
sort(pts.begin(), pts.end());
pts.erase(unique(pts.begin(), pts.end()), pts.end());
vector<PT> up, dn;
for (int i = 0; i < pts.size(); i++) {
while (up.size() > 1 && area2(up[up.size()-2], up.back(), pts[i]) >= 0) up.pop_back();
while (dn.size() > 1 && area2(dn[dn.size()-2], dn.back(), pts[i]) <= 0) dn.pop_back();
up.push_back(pts[i]);
dn.push_back(pts[i]);
}
pts = dn;
for (int i = (int) up.size() - 2; i >= 1; i--) pts.push_back(up[i]);
bool remove_redundant = false;
if(remove_redundant){
if (pts.size() <= 2) return;
dn.clear();
dn.push_back(pts[0]);
dn.push_back(pts[1]);
for (int i = 2; i < pts.size(); i++) {
if (between(dn[dn.size()-2], dn[dn.size()-1], pts[i])) dn.pop_back();
dn.push_back(pts[i]);
}
if (dn.size() >= 3 && between(dn.back(), dn[0], dn[1])) {
dn[0] = dn.back();
dn.pop_back();
}
pts = dn;
}
}
bool in_convex(vector<Geometry::PT>& l, Geometry::PT p){
int a = 1, b = l.size()-1, c;
if (Det(l[0], l[a],l[b]) > 0) swap(a,b); // orientation of area, a is above 0 and b below 0
// Allow on edge --> if (Det... > 0 || Det ... < 0)
if (Det(l[0], l[a], p) >= EPS || Det(l[0], l[b], p) < -EPS) return false;
while(abs(a-b) > 1) {
c = (a+b)/2;
if (Det(l[0], l[c], p) > 0) b = c; else a = c;
}
// Alow on edge --> return Det... <= 0
return Det(l[a], l[b], p) < 5*EPS;
}
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
#endif
srand (time(NULL));
return 0;
}
<file_sep>/*
By : <NAME>
Dhirubhai Ambani Institute Of Information And Communication Technology, Gandhinagar (DA-IICT GANDHINAGAR)
1st Year ICT BTECH student
*/
#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
const double EPS = 1e-24;
const lli MOD = 1000000007ll;
const double PI = 3.14159265359;
int INF = 2147483645;
template <class T>T Max2(T a,T b){return a<b?b:a;}
template <class T>T Min2(T a,T b){return a<b?a:b;}
template <class T>T Max3(T a,T b,T c){return Max2(Max2(a,b),c);}
template <class T>T Min3(T a,T b,T c){return Min2(Min2(a,b),c);}
template <class T>T Max4(T a,T b,T c,T d){return Max2(Max2(a,b),Max2(c,d));}
template <class T>T Min4(T a,T b,T c,T d){return Min2(Min2(a,b),Max2(c,d));}
template <class T>void Swap(T& a,T& b){T temp;temp=a;a=b;b=temp;}
using namespace std;
// 0 based
void zalgo(string &s,int z[],int n)
{
z[0]=n;
int L=0,R=0;
for (int i = 1; i < n; i++) {
if (i > R) {
L = R = i;
while (R < n && s[R-L] == s[R]) R++;
z[i] = R-L; R--;
} else {
int k = i-L;
if (z[k] < R-i+1) z[i] = z[k];
else {
L = i;
while (R < n && s[R-L] == s[R]) R++;
z[i] = R-L; R--;
}
}
}
}
void zalgo(char s[],int len,int z[])
{
z[0]=len;
int L=0,R=0;
for(int i=1;i<len;i++)
{
if(i>R)
{
L=R=i;
while(R<len && s[R-L]==s[R])
R++;
z[i]=R-L;
R--;
}
else
{
int k=i-L;
if(z[k]<R-i+1)
z[i]=z[k];
else
{
L=i;
while(R<len && s[R-L]==s[R])
R++;
z[i]=R-L;
R--;
}
}
}
}
void zalgo(string &s,int z[],int n)
{
z[1]=n;
int L=0,R=1;
for(int i=2;i<=n;i++)
{
if(i>R)
{
L=R=i;
while(R<=n && s[R-L+1]==s[R])
R++;
z[i]=R-L;
R--;
}
else
{
int k=i-L+1;
if(z[k]<R-i+1)
z[i]=z[k];
else
{
L=i;
while(R<=n && s[R-L+1]==s[R])
R++;
z[i]=R-L;
R--;
}
}
}
}
int main()
{
std::ios::sync_with_stdio(false);
cin.tie(NULL);
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
return 0;
}
<file_sep>#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
#define ld long double
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);
const long double EPS = 1e-10;
const lli MOD = 1000000007ll;
const lli mod1 = 1000000009ll;
const lli mod2 = 1100000009ll;
int INF = 2147483645;
lli INFINF = 9223372036854775807;
int debug = 0;
using namespace std;
void print(int a[],int s,int e){for(int i=s;i<=e;i++)cout<<a[i]<<" ";cout<<"\n";}
void print(vector<int> &v,int s,int e){for(int i=s;i<=e;i++)cout<<v[i]<<" ";cout<<"\n";}
void print(vector<int> &v){for(int x:v)cout<<x<<" ";cout<<"\n";}
lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
lli bit(lli _mask,lli _i){return (_mask&(1<<_i))==0?0:1;}
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli add(lli a,lli b,lli m=MOD){lli x=a+b;while(x>=m)x-=m;return x;}
lli sub(lli a,lli b,lli m=MOD){lli x=a-b;while(x<0)x+=m;return x;}
lli mul(lli a,lli b,lli m=MOD){lli x=a*b;x%=m;return x;}
namespace Treap{
struct Node{
int val,prior,sz;
struct Node *l,*r;
};
int GetSz(Node* t){
return t?t->sz:0;
}
void UpdateSz(Node* t){
if(t) t->sz = GetSz(t->l)+1+GetSz(t->r);
}
void Split(Node* t,Node* &l,Node* &r,int key){
if(!t) l=r=NULL;
else if(t->val<=key) Split(t->r,t->r,r,key),l=t;
else Split(t->l,l,t->l,key),r=t;
UpdateSz(t);
}
void Merge(Node* &t,Node* l,Node* r){
if(!l || !r) t=l?l:r;
else if(l->prior > r->prior)Merge(l->r,l->r,r),t=l;
else Merge(r->l,l,r->l),t=r;
UpdateSz(t);
}
void Insert(Node* &t,Node* it){
if(!t) t=it;
else if(it->prior>t->prior) Split(t,it->l,it->r,it->val),t=it;
else Insert(t->val<=it->val?t->r:t->l,it);
UpdateSz(t);
}
void Erase(Node* &t,int key){
if(!t)return;
else if(t->val==key){Node* temp=t;Merge(t,t->l,t->r);delete temp;}
else Erase(t->val<key?t->r:t->l,key);
UpdateSz(t);
}
Node* Init(int val){
Node* ret = new Node();
ret->val=val;ret->sz=1;ret->prior=rand();ret->l=ret->r=NULL;
return ret;
}
int LessThanAndEqual(Node* &t, lli l){
if(t==NULL)
return 0;
if(t->val>l)
return LessThanAndEqual(t->l,l);
return 1+GetSz(t->l)+LessThanAndEqual(t->r,l);
}
}
Treap::Node* treap[10010];
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
debug = 1;
#endif
srand (time(NULL));
/*for(int i=1;i<=N;i++)
treap[i] = NULL;
for(int i=1;i<=N;i++){
if(treap[F[i]] == NULL)
treap[F[i]] = Treap::Init(X[i]);
else
Treap::Insert(treap[F[i]],Treap::Init(X[i]));
}*/
return 0;
}
<file_sep>/*
By : <NAME>
Dhirubhai Ambani Institute Of Information And Communication Technology, Gandhinagar (DA-IICT GANDHINAGAR)
2nd Year ICT BTECH student
*/
#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);
const double EPS = 1e-4;
const lli MOD = 1000000007ll;
const lli mod1 = 1000000009;
const lli mod2 = 1100000009;
const double PI = 3.14159265359;
int INF = 2147483645;
lli INFINF = 9223372036854775807;
int debug = 0;
template <class T>T Max2(T a,T b){return a<b?b:a;}
template <class T>T Min2(T a,T b){return a<b?a:b;}
template <class T>T Max3(T a,T b,T c){return Max2(Max2(a,b),c);}
template <class T>T Min3(T a,T b,T c){return Min2(Min2(a,b),c);}
template <class T>T Max4(T a,T b,T c,T d){return Max2(Max2(a,b),Max2(c,d));}
template <class T>T Min4(T a,T b,T c,T d){return Min2(Min2(a,b),Min2(c,d));}
using namespace std;
lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
lli bit(lli _mask,lli _i){return (_mask&(1<<_i))==0?0:1;}
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli add(lli a,lli b){lli x=a+b;if(x>MOD)x-=MOD;return x;}
lli sub(lli a,lli b){lli x=a-b;if(x<0)x+=MOD;return x;}
lli mul(lli a,lli b){lli x=a*b;x%=MOD;return x;}
int sign(double a){return a < -EPS ? -1 : a > EPS ? 1 : 0;}
/* insert '$' at begging of string
call buildSA(),buildLCP(),buildLogs(),buildLcpSparseTable();
string is 1 based, constructed suffix array is also 1 based, 0th suffix is the whole string
sa[i] is the ith suffix 1 based
pos[i] is the rank of ith suffix
lcp[i] is the lcp of ith suffix with (i+1)th
s = "$banana"
0123456
sa[] = {0,6,4,2,1,5,3};
pos[] = {0,4,3,6,2,5,1};
lcp[] = {0,1,3,0,0,2,0};
*/
namespace SA{
static const int MAXN = 2200010;
static const int MAXLOGN = 23;
string s;
int n,gap;
int sa[MAXN], pos[MAXN], tmp[MAXN], lcp[MAXN], logs[MAXN], lcptable[MAXLOGN][MAXN];
bool sufCmp(int i,int j){
if(pos[i] != pos[j])
return pos[i] < pos[j];
i += gap;j += gap;
return(i < n && j < n) ? pos[i] < pos[j] : i > j;
}
void buildSA(){
n = s.size();
for(int i=0;i<n;i++)
sa[i] = i,pos[i] = s[i];
for(gap = 1;;gap *= 2){
sort(sa,sa+n,sufCmp);
for(int i=0;i<n-1;i++)
tmp[i + 1] = tmp[i] + sufCmp(sa[i],sa[i + 1]);
for(int i=0;i<n;i++)
pos[sa[i]] = tmp[i];
if(tmp[n-1] == n-1)
break;
}
}
void buildLCP(){
for (int i=0,k=0;i<n;++i){
if(pos[i]!=n-1){
for(int j=sa[pos[i]+1];s[i+k]==s[j+k];)
++k;
lcp[pos[i]]=k;
if(k)
--k;
}
}
}
void buildLogs(){
int g=2;
while(g<=n){
logs[g]=1;
g=(g<<1);
}
for(int i=1;i<=n;i++)
logs[i]+=logs[i-1];
}
void buildLcpSparseTable(){
for(int i=0;i<n;i++)
lcptable[0][i]=lcp[i];
for(int j=1;(1<<j)<=n;j++)
for(int i=0;i+(1<<j)-1<n;i++)
lcptable[j][i]=min(lcptable[j-1][i],lcptable[j-1][i+(1<<(j-1))]);
}
int lcpQuery(int l,int r){
if(l>r) swap(l,r);
if(l==r) return INF;
if(l+1==r) return lcp[l];
r--;
int k=logs[r-l+1];
return min(lcptable[k][l],lcptable[k][r-(1<<k)+1]);
}
};
int main()
{
#ifndef ONLINE_JUDGE
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
debug = 1;
#endif
srand (time(NULL));
return 0;
}
<file_sep>/*
By : <NAME>
Dhirubhai Ambani Institute Of Information And Communication Technology, Gandhinagar (DA-IICT GANDHINAGAR)
1st Year ICT BTECH student
*/
#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
const double EPS = 1e-24;
const lli MOD = 1000000007ll;
const double PI = 3.14159265359;
int INF = 2147483645;
template <class T>T Max2(T a,T b){return a<b?b:a;}
template <class T>T Min2(T a,T b){return a<b?a:b;}
template <class T>T Max3(T a,T b,T c){return Max2(Max2(a,b),c);}
template <class T>T Min3(T a,T b,T c){return Min2(Min2(a,b),c);}
template <class T>T Max4(T a,T b,T c,T d){return Max2(Max2(a,b),Max2(c,d));}
template <class T>T Min4(T a,T b,T c,T d){return Min2(Min2(a,b),Max2(c,d));}
using namespace std;
void Gaussian_Elimination(vector<vector<double> > &_a,int _N)
{
int _max;
for(int i=1;i<=_N;i++)
{
_max=i;
for(int j=i+1;j<=_N;j++)
{
if(_a[j][i] > _a[_max][i])
_max=j;
}
for(int j=1;j<=_N+1;j++)
{
int _temp=_a[_max][j];
_a[_max][j]=_a[i][j];
_a[i][j]=_temp;
}
for(int j=i;j<=_N+1;j++)
for(int k=i+1;k<=_N;k++)
_a[k][j]-=_a[k][i]/_a[i][i] * _a[i][j];
for(int i=1;i<=3;i++)
{
for(int j=1;j<=4;j++)
cout<<_a[i][j]<<" ";
cout<<endl;
}cout<<"\n";
}
for(int i=_N;i>=1;i--)
{
_a[i][_N+1]=_a[i][_N+1]/_a[i][i];
_a[i][i]=1;
for(int j=i-1;j>=1;j--)
{
_a[j][_N+1]-=_a[j][i]*_a[i][_N+1];
_a[j][i]=0;
}
}
}
int main()
{
std::ios::sync_with_stdio(false);
cin.tie(NULL);
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
vector<vector<double> > a={{0,0,0,0,0},
{0,2,1,-1,8},
{0,-3,-1,2,-11},
{0,-2,1,2,-3}};
for(int i=1;i<=3;i++)
{
for(int j=1;j<=4;j++)
cout<<a[i][j]<<" ";
cout<<endl;
}
Gaussian_Elimination(a,3);
cout<<"\n\n";
for(int i=1;i<=3;i++)
{
for(int j=1;j<=4;j++)
cout<<a[i][j]<<" ";
cout<<endl;
}
return 0;
}
<file_sep>/*
By : <NAME>
Dhirubhai Ambani Institute Of Information And Communication Technology, Gandhinagar (DA-IICT GANDHINAGAR)
2nd Year ICT BTECH student
*/
#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);
const double EPS = 1e-10;
const lli MOD = 1000000007ll;
const lli mod1 = 1000000009ll;
const lli mod2 = 1100000009ll;
const double PI = 3.14159265359;
int INF = 2147483645;
lli INFINF = 9223372036854775807;
int debug = 0;
template <class T>T Max2(T a,T b){return a<b?b:a;}
template <class T>T Min2(T a,T b){return a<b?a:b;}
template <class T>T Max3(T a,T b,T c){return Max2(Max2(a,b),c);}
template <class T>T Min3(T a,T b,T c){return Min2(Min2(a,b),c);}
template <class T>T Max4(T a,T b,T c,T d){return Max2(Max2(a,b),Max2(c,d));}
template <class T>T Min4(T a,T b,T c,T d){return Min2(Min2(a,b),Min2(c,d));}
using namespace std;
lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
lli bit(lli _mask,lli _i){return (_mask&(1<<_i))==0?0:1;}
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli add(lli a,lli b){lli x=a+b;if(x>MOD)x-=MOD;return x;}
lli sub(lli a,lli b){lli x=a-b;if(x<0)x+=MOD;return x;}
lli mul(lli a,lli b){lli x=a*b;x%=MOD;return x;}
typedef struct node{
int prior,size,val,sum,lazy;
struct node *l,*r;
}node;
typedef node* pnode;
int sz(pnode t){
return t!=NULL?t->size:0;
}
void upd_sz(pnode t){
if(t)t->size=sz(t->l)+1+sz(t->r);
}
void lazy(pnode t){
if(!t || !t->lazy)return;
swap(t->r,t->l);
if(t->l)t->l->lazy = !t->l->lazy;
if(t->r)t->r->lazy = !t->r->lazy;
t->lazy = 0;
}
void reset(pnode t){
if(t)t->sum = t->val;
}
void combine(pnode& t,pnode l,pnode r){
if(!l || !r)return void(t = l?l:r);
t->sum = l->sum + r->sum;
}
void operation(pnode t){
if(!t)return;
reset(t);
lazy(t->l);lazy(t->r);
combine(t,t->l,t);
combine(t,t,t->r);
}
void split(pnode t,pnode &l,pnode &r,int pos,int add=0){
if(!t)return void(l=r=NULL);
lazy(t);
int curr_pos = add + sz(t->l);
if(curr_pos<=pos)
split(t->r,t->r,r,pos,curr_pos+1),l=t;
else
split(t->l,l,t->l,pos,add),r=t;
upd_sz(t);
operation(t);
}
void merge(pnode &t,pnode l,pnode r){
lazy(l);lazy(r);
if(!l || !r) t = (l==NULL)?r:l;
else if(l->prior>r->prior)merge(l->r,l->r,r),t=l;
else merge(r->l,l,r->l),t=r;
upd_sz(t);
operation(t);
}
void init(pnode &t,int val)
{
t->prior=rand();
t->size=1;
t->val=val;
t->sum=val;
t->lazy=0;
t->l=t->r=NULL;
}
int range_query(pnode t,int l,int r){
pnode L,mid,R;
split(t,L,mid,l-1);
split(mid,t,R,r-l);
int ans = t->sum;
merge(mid,L,t);
merge(t,mid,R);
return ans;
}
void range_update(pnode t,int l,int r,int val){
pnode L,mid,R;
split(t,L,mid,l-1);
split(mid,t,R,r-l);
t->lazy+=val;
merge(mid,L,t);
merge(t,mid,R);
}
void subArrayReverse(pnode t,int l,int r){
pnode L1,L2,R1,R2;
split(t,L1,L2,l-1);
split(L2,R1,R2,r-l);
R1->lazy = !R1->lazy;
merge(L2,R1,R2);
merge(t,L1,L2);
}
int kthQuery(pnode t,int k){
lazy(t);
if(k == sz(t->l)) return t->val;
if(k < sz(t->l)) return kthQuery(t->l,k);
else return kthQuery(t->r,k - sz(t->l) -1);
upd_sz(t);
operation(t);
}
void updateTreap(pnode t,int k,int x){
lazy(t);
if(k==sz(t->l)){
t->val += x;
upd_sz(t);
operation(t);
return;
}
if(k < sz(t->l)) updateTreap(t->l,k,x);
else updateTreap(t->r,k - sz(t->l) - 1,x);
upd_sz(t);
operation(t);
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
debug = 1;
#endif
srand (time(NULL));
si(N);
for(int i=0;i<N;i++)
si(A[i]);
for(int i=0;i<N;i++){
pnode it = new node;
init(it,A[i]);
if(i==0)
Treap = it;
else
merge(Treap,Treap,it);
}
return 0;
}
<file_sep>/*
By : <NAME>
Dhirubhai Ambani Institute Of Information And Communication Technology, Gandhinagar (DA-IICT GANDHINAGAR)
1st Year ICT BTECH student
*/
#include<bits/stdc++.h>
#define lli long long int
#define llu unsigned long long int
const double EPS = 1e-24;
const lli MOD = 1000000007ll;
const double PI = 3.14159265359;
int INF = 2147483645;
template <class T>T Max2(T a,T b){return a<b?b:a;}
template <class T>T Min2(T a,T b){return a<b?a:b;}
template <class T>T Max3(T a,T b,T c){return Max2(Max2(a,b),c);}
template <class T>T Min3(T a,T b,T c){return Min2(Min2(a,b),c);}
template <class T>T Max4(T a,T b,T c,T d){return Max2(Max2(a,b),Max2(c,d));}
template <class T>T Min4(T a,T b,T c,T d){return Min2(Min2(a,b),Max2(c,d));}
using namespace std;
/*
struct trie root = new trie()
*/
struct trie
{
const static int bits = 30;
const static int sz = 2;
struct trie *children[sz];
trie(){
for(int i=0;i<sz;i++)
this->children[i] = NULL;
}
void trie_insert(int x)
{
vector<int> t;
for(int i=0;i<bits;i++){
t.pb(x&1);
x >>= 1;
}
reverse(all(t));
struct trie *pCrawl = this;
for(int i=0;i<t.size();i++)
{
int idx=t[i];
if(pCrawl->children[idx]==NULL)
pCrawl->children[idx] = new trie();
pCrawl=pCrawl->children[idx];
}
}
int trie_query(int x)
{
vector<int> t;
for(int i=0;i<bits;i++){
t.pb(x&1);
x >>= 1;
}
reverse(all(t));
int ret = 0;
struct trie *pCrawl = this;
for(int i=0,j=bits-1;i<t.size();i++,j--)
{
int idx=t[i];
if(pCrawl->children[!idx]!=NULL){
pCrawl=pCrawl->children[!idx];
ret += (1<<j);
}
else{
pCrawl=pCrawl->children[idx];
}
}
return ret;
}
};
int main()
{
std::ios::sync_with_stdio(false);
cin.tie(NULL);
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
return 0;
}
<file_sep>template<typename H> void _dt(string u, H&& v) {
pi p = _gp(u);
cerr << u.substr(p.fi, p.se - p.fi + 1) << " = " << forward<H>(v) << " |" << endl;
}
template<typename H, typename ...T> void _dt(string u, H&& v, T&&... r) {
pi p = _gp(u);
cerr << u.substr(p.fi, p.se - p.fi + 1) << " = " << forward<H>(v) << " | ";
_dt(u.substr(p.se + 2), forward<T>(r)...);
}
template<typename T>
ostream &operator <<(ostream &o, vector<T> v) { // print a vector
o << "[";
fo(i, si(v) - 1) o << v[i] << ", ";
if(si(v)) o << v.back();
o << "]";
return o;
}
template<typename T1, typename T2>
ostream &operator <<(ostream &o, map<T1, T2> m) { // print a map
o << "{";
for(auto &p: m) {
o << " (" << p.fi << " -> " << p.se << ")";
}
o << " }";
return o;
}
template<typename T>
ostream &operator <<(ostream &o, set<T> s) { // print a set
o << "{";
bool first = true;
for(auto &entry: s) {
if(!first) o << ", ";
o << entry;
first = false;
}
o << "}";
return o;
}
template <size_t n, typename... T>
typename enable_if<(n >= sizeof...(T))>::type
print_tuple(ostream&, const tuple<T...>&) {}
template <size_t n, typename... T>
typename enable_if<(n < sizeof...(T))>::type
print_tuple(ostream& os, const tuple<T...>& tup) {
if (n != 0)
os << ", ";
os << get<n>(tup);
print_tuple<n+1>(os, tup);
}
template <typename... T>
ostream& operator<<(ostream& os, const tuple<T...>& tup) { // print a tuple
os << "("; print_tuple<0>(os, tup); return os << ")"; } template <typename T1, typename T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& p) { // print a pair
return os << "(" << p.fi << ", " << p.se << ")";
}
|
4ecd4e57089f5494d930a3ca982b374ff1636bfa
|
[
"C++"
] | 21 |
C++
|
karanthakkar1996/Kittybag
|
5d410471bfaadb2f9a9acdc581d928a33a19e2f5
|
e879344d1c01cb533c3b7e9b995e6fedaa384257
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.